BasicTools.IO.XdmfWriter module

Xdmf file writer

BasicTools.IO.XdmfWriter.ArrayToString(data)[source]
class BasicTools.IO.XdmfWriter.BinaryStorage(data=None, filePointer=None)[source]

Bases: object

Class to deal with binary storage

ChangePathOfBinaryStorage(newPath)[source]
GetData()[source]
UpdateHeavyStorage(data)[source]
BasicTools.IO.XdmfWriter.CheckIntegrity(GUI=False)[source]
BasicTools.IO.XdmfWriter.CheckIntegrityDDM(GUI=False)[source]

this test function can be launched using the mpirun -n 2 … to test the writer in mpi mode

BasicTools.IO.XdmfWriter.CheckIntegrityHdf5(tempdir)[source]
class BasicTools.IO.XdmfWriter.InMemoryFile(saveFilePointer)[source]

Bases: object

Helper class to write the xmf part of the file into memory

close()[source]
flush()[source]
seek(pos)[source]
tell()[source]
write(data)[source]
BasicTools.IO.XdmfWriter.WriteMeshToXdmf(filename, baseMeshObject, PointFields=None, CellFields=None, GridFields=None, IntegrationPointData=None, PointFieldsNames=None, CellFieldsNames=None, GridFieldsNames=None, IntegrationPointDataNames=None, IntegrationRule=None, Binary=True, HDF5=True)[source]

Function API for writing mesh in the xdmf format file.

Parameters:
  • fileName (str) – name of the file to be written

  • baseMeshObject (UnstructuredMesh) – the mesh to be written

  • PointFields (list[np.ndarray], optional) – fields to write defined at the vertices of the mesh, by default None

  • CellFields (list[np.ndarray], optional) – fields to write defined at the elements of the mesh, by default None

  • GridFields (list[np.ndarray], optional) – grid fields to write, by default None

  • IntegrationPointData (list[np.ndarray], optional) – fields defined at the integration points, by default None

  • PointFieldsNames (list[str], optional) – names of the fields to write defined at the vertices of the mesh, by default None

  • CellFieldsNames (list[str], optional) – names of the fields to write defined at the elements of the mesh, by default None

  • GridFieldsNames (list[str], optional) – names of the grid fields to write, by default None

  • IntegrationPointDataNames (list[str], optional) – names of the fields defined at the integration points, by default None

  • IntegrationRule (dict[IntegrationRuleType], optional) – integration rules associated to the integration point data, by default None

  • Binary (bool, optional) – if True, file is written as binary, by default True

  • HDF5 (bool, optional) – if True, file is written as hdf5 format, by default True

BasicTools.IO.XdmfWriter.WriteTest(tempdir, Temporal, Binary, Hdf5)[source]
BasicTools.IO.XdmfWriter.WriteTestAppend(tempdir, Temporal, Binary)[source]
class BasicTools.IO.XdmfWriter.XdmfWriter(fileName=None)[source]

Bases: WriterBase

Class to Write Xdmf files for:
  • classic finite element solutions

  • domain decomposition problem (multi mesh)

  • transient solution (the mesh changes in time)

  • solution written in parafac format (monolithic or in ddm mpi)

Close()[source]

Closes writen file after writing operations are done

GetHdf5()[source]
IsHdf5()[source]
IsParafacOutput()[source]
MakeStep(Time=None, TimeStep=None)[source]

Increases time step in output files

Parameters:
  • Time (float, optional) – time value of the time step, by default None

  • TimeStep (int, optional) – number of the time step, by default None

NewBinaryFilename()[source]
NewHdf5Filename()[source]
NextDomain()[source]
Open(filename=None)[source]

Open file for writing

Parameters:

filename (str, optional) – name of the file to write

SetBinary(val=True)[source]

Sets the binary status of the file to read

Parameters:

val (bool, optional) – if True, sets the file to read as binary, by default True

SetChunkSize(size)[source]
SetFileName(fileName)[source]

Sets the fileName parameter of the class

Parameters:

string (str) – fileName to set

SetHdf5(val=True)[source]
SetParafac(val=True)[source]
SetXmlSizeLimit(val)[source]
Step(dt=1)[source]
Write(baseMeshObject, PointFields=None, CellFields=None, GridFields=None, PointFieldsNames=None, CellFieldsNames=None, GridFieldsNames=None, Time=None, TimeStep=None, domainName=None, IntegrationRule=None, IntegrationPointData=None, IntegrationPointDataNames=None)[source]

Write data to file in xdmf format

Parameters:
  • baseMeshObject (UnstructuredMesh) – the mesh to be written

  • PointFields (list[np.ndarray], optional) – fields to write defined at the vertices of the mesh, by default None

  • CellFields (list[np.ndarray], optional) – fields to write defined at the elements of the mesh, by default None

  • GridFields (list[np.ndarray], optional) – grid fields to write, by default None

  • PointFieldsNames (list[str], optional) – names of the fields to write defined at the vertices of the mesh, by default None

  • CellFieldsNames (list[str], optional) – names of the fields to write defined at the elements of the mesh, by default None

  • GridFieldsNames (list[str], optional) – names of the grid fields to write, by default None

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

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

  • domainName (str, optional) – Not Used, by default None

  • IntegrationRule (dict[IntegrationRuleType], optional) – integration rules associated to the integration point data, by default None

  • IntegrationPointData (list[np.ndarray], optional) – fields defined at the integration points, by default None

  • IntegrationPointDataNames (list[str], optional) – names of the fields defined at the integration points, by default None

WriteIntegrationsPointData(names, allData)[source]

Writes integration points data to file

WriteIntegrationsPoints(allData)[source]

Writes integration points information to file

WriteTail()[source]

Writes the end of the file

isBinary()[source]