dolfinx.io
Tools for file input/output (IO).
- class dolfinx.io.VTKFile(self: dolfinx.cpp.io.VTKFile, comm: MPICommWrapper, filename: os.PathLike, mode: str)[source]
Bases:
VTKFile
Interface to VTK files.
VTK supports arbitrary order Lagrange finite elements for the geometry description. XDMF is the preferred format for geometry order <= 2.
- class dolfinx.io.XDMFFile(self: dolfinx.cpp.io.XDMFFile, comm: MPICommWrapper, filename: os.PathLike, file_mode: str, encoding: dolfinx.cpp.io.XDMFFile.Encoding = <Encoding.HDF5: 0>)[source]
Bases:
XDMFFile
- read_mesh(ghost_mode=<GhostMode.shared_facet: 1>, name='mesh', xpath='/Xdmf/Domain') Mesh [source]
Read mesh data from file
- read_meshtags(self: dolfinx.cpp.io.XDMFFile, mesh: dolfinx.cpp.mesh.Mesh_float64, name: str, xpath: str = '/Xdmf/Domain') dolfinx.cpp.mesh.MeshTags_int32 [source]
- write_function(u: Function, t: float = 0.0, mesh_xpath="/Xdmf/Domain/Grid[@GridType='Uniform'][1]")[source]
Write function to file for a given time.
Note
Function is interpolated onto the mesh nodes, as a Nth order Lagrange function, where N is the order of the coordinate map. If the Function is a cell-wise constant, it is saved as a cell-wise constant.
- Parameters:
u – Function to write to file.
t – Time associated with Function output .
mesh_xpath – Path to mesh associated with the Function in the XDMFFile.
- write_meshtags(tags: MeshTags, x: Geometry_float32 | Geometry_float64, geometry_xpath: str = '/Xdmf/Domain/Grid/Geometry', xpath: str = '/Xdmf/Domain') None [source]
Write mesh tags to file