BasicTools.IO.XdmfReader module

Xdmf file reader

BasicTools.IO.XdmfReader.CheckIntegrity()[source]
BasicTools.IO.XdmfReader.Example1()[source]
BasicTools.IO.XdmfReader.Example2()[source]
BasicTools.IO.XdmfReader.GetTensorRepOfField(domain, fieldname)[source]

Get The tensor representation of a field in a xdmf domain

Get The tensor representation of a field in a xdmf domain, for the moment works for Cannonic and Train Tensor formats

BasicTools.IO.XdmfReader.ReadXdmf(fileName)[source]

Function API for reading an xdmf file

Parameters:

fileName (str) – name of the file to be read

Returns:

output unstructured mesh object containing reading result

Return type:

UnstructuredMesh

class BasicTools.IO.XdmfReader.Xdmf[source]

Bases: Xdmfbase

Top class for the xdmf Document

GetDomain(nameornumber)[source]

Get a Grid (XdmfGrid) using a name or a number

class BasicTools.IO.XdmfReader.XdmfAttribute[source]

Bases: Xdmfbase

XdmfAttribute class: to store the data over the grids

ReadAttributes(attrs)[source]
class BasicTools.IO.XdmfReader.XdmfDataItem[source]

Bases: Xdmfbase

XdmfDataItem class : class to manage the reading of the data Heavy and light

GetData()[source]
ReadAttributes(attrs, path)[source]
TreatCDATA()[source]

Default inplementation to read the heavy data

class BasicTools.IO.XdmfReader.XdmfDomain[source]

Bases: Xdmfbase

A Domain. Can contain many grids

GetGrid(nameornumber)[source]

Get a Grid (XdmfGrid) using a name or a number

ReadAttributes(attrs)[source]
class BasicTools.IO.XdmfReader.XdmfGeometry[source]

Bases: Xdmfbase

XdmfGeometry class: stores the point positions

GetNodes()[source]
GetOrigin()[source]
GetSpacing()[source]
ReadAttributes(attrs)[source]
class BasicTools.IO.XdmfReader.XdmfGrid[source]

Bases: Xdmfbase

a Grid: contains a mesh (poinst and connectivity ) and fields by (element, nodes, grid)

GetCellField(name)[source]
GetCellFields()[source]
GetCellFieldsNames()[source]
GetFieldData(name, noTranspose=False)[source]
GetFieldTermsAsColMatrix(fieldname, offset=0)[source]
GetFieldTermsAsTensor(fieldname, sep='_', offseti=0, offsetj=0)[source]
GetFieldsNames()[source]
GetFieldsOfType(ftype, name=None)[source]
GetGridField(name)[source]
GetGridFields()[source]
GetGridFieldsNames()[source]
GetPointField(name)[source]
GetPointFields()[source]
GetPointFieldsNames()[source]
GetSupport()[source]

Returns the support defined in the Xdmf file

Returns:

output mesh object containing reading result

Return type:

UnstructuredMesh or ConstantRectilinearMesh

GetTime()[source]

Returns time at which data is read

Returns:

time at which data is read

Return type:

float

HasField(name)[source]
ReadAttributes(attrs)[source]
class BasicTools.IO.XdmfReader.XdmfInformation[source]

Bases: Xdmfbase

class for extra information in the xmdf file

ReadAttributes(attrs)[source]
class BasicTools.IO.XdmfReader.XdmfReader(filename='')[source]

Bases: ContentHandler

Xdmf Reader class

GetAvailableTimes()[source]

Returns the available times at which data can be read

Returns:

available times at which data can be read

Return type:

np.ndarray

Read(fileName=None)[source]

Function that performs the reading of the data defined in an ut file

Parameters:

fileName (str, optional) – name of the file to read, by default None

Returns:

output mesh object containing reading result

Return type:

UnstructuredMesh or ConstantRectilinearMesh

ReadMetaData()[source]

Function that performs the reading of the metadata of a xdmf file: sets the time attribute of the reader

Reset()[source]

Resets the reader

SetFileName(filename)[source]

Sets the name of file to read

Parameters:

filename (str) – file name to set

SetTimeToRead(time=None, timeIndex=None)[source]

Sets the time at which the data is read

Parameters:
  • time (float, optional) – time at which the data is read, by default None

  • timeIndex (int, optional) – time index at which the data is read, by default None

Returns:

time index at which the data is read

Return type:

int

characters(content)[source]

Receive notification of character data.

The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.

endElement(name)[source]

Signals the end of an element in non-namespace mode.

The name parameter contains the name of the element type, just as with the startElement event.

startElement(name, attrs)[source]

Signals the start of an element in non-namespace mode.

The name parameter contains the raw XML 1.0 name of the element type as a string and the attrs parameter holds an instance of the Attributes class containing the attributes of the element.

class BasicTools.IO.XdmfReader.XdmfTime[source]

Bases: Xdmfbase

XdmfTime class: to store the data over the grids

ReadAttributes(attrs)[source]
class BasicTools.IO.XdmfReader.XdmfTopology[source]

Bases: Xdmfbase

XdmfTopology class: stores the connectivity of the Grid

GetConnectivity()[source]
GetDimensions()[source]
ReadAttributes(attrs)[source]
class BasicTools.IO.XdmfReader.Xdmfbase[source]

Bases: object

Base class for all the xdmf Releated objects

ReadAttribute(attrs, name, default=None)[source]

” Helper to read attributes

TreatCDATA()[source]

Default inplementation to read the heavy data