Muscat.IO.XdmfReader module

Xdmf file reader

CheckIntegrity()[source]
Example1()[source]
Example2()[source]
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:

Mesh

class Xdmf[source]

Bases: XdmfBase

Top class for the xdmf Document

GetDomain(nameOrNumber: str | int64) XdmfDomain[source]

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

class XdmfAttribute[source]

Bases: XdmfBase

XdmfAttribute class: to store the data over the grids

ReadAttributes(attrs)[source]
class XdmfBase[source]

Bases: object

Base class for all the xdmf related objects

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

“ Helper to read attributes

TreatCDATA() None[source]

Default implementation to read the heavy data

class 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 implementation to read the heavy data

class XdmfDomain[source]

Bases: XdmfBase

A Domain. Can contain many grids

GetGrid(NameOrNumber: str | int64) XdmfGrid[source]

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

ReadAttributes(attrs)[source]
class XdmfGeometry[source]

Bases: XdmfBase

XdmfGeometry class: stores the point positions

GetNodes() np.ndarray[source]
GetOrigin() np.ndarray[source]
GetSpacing() np.ndarray[source]
ReadAttributes(attrs)[source]
class XdmfGrid[source]

Bases: XdmfBase

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

GetCellField(name) List[np.ndarray][source]
GetCellFields() List[np.ndarray][source]
GetCellFieldsNames() List[str][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) List[np.ndarray][source]
GetGridFields() List[np.ndarray][source]
GetGridFieldsNames() List[str][source]
GetPointField(name) List[np.ndarray][source]
GetPointFields() List[np.ndarray][source]
GetPointFieldsNames() List[str][source]
GetSupport() Mesh[source]

Returns the support defined in the Xdmf file

Returns:

output mesh object containing reading result

Return type:

Mesh 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 XdmfInformation[source]

Bases: XdmfBase

class for extra information in the xmdf file

ReadAttributes(attrs)[source]
class 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:

Mesh 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 XdmfTime[source]

Bases: XdmfBase

XdmfTime class: to store the data over the grids

ReadAttributes(attrs)[source]
class XdmfTopology[source]

Bases: XdmfBase

XdmfTopology class: stores the connectivity of the Grid

GetConnectivity() AllElements[source]
GetDimensions() np.ndarray[source]
ReadAttributes(attrs)[source]