dolfinx.io
IO module for input data, post-processing file outout and checkpointing
Functions
|
For a given gmsh model, extract the mesh geometry as a numpy (N, 3) array where the i-th row corresponds to the i-th node in the mesh. |
|
Extract all entities tagged with a physical marker in the gmsh model, and collect the data per cell type. |
|
Create a UFL mesh from a Gmsh cell identifier and the geometric dimension. |
Classes
|
Interface to VTK files |
|
- class dolfinx.io.VTKFile(self: dolfinx.cpp.io.VTKFile, comm: MPICommWrapper, filename: os.PathLike, mode: str) None [source]
Bases:
dolfinx.cpp.io.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.
- write_function(u: Union[List[dolfinx.fem.function.Function], dolfinx.fem.function.Function], t: float = 0.0) None [source]
Write a single function or a list of functions to file for a given time (default 0.0)
- write_mesh(mesh: dolfinx.mesh.Mesh, t: float = 0.0) None [source]
Write mesh to file for a given time (default 0.0)
- 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>) None [source]
Bases:
dolfinx.cpp.io.XDMFFile
- read_mesh(ghost_mode=<GhostMode.shared_facet: 1>, name='mesh', xpath='/Xdmf/Domain') dolfinx.mesh.Mesh [source]
Read mesh data from file
- read_meshtags(self: dolfinx.cpp.io.XDMFFile, mesh: dolfinx.cpp.mesh.Mesh, name: str, xpath: str = '/Xdmf/Domain') dolfinx.cpp.mesh.MeshTags_int32 [source]
- write_function(*args, **kwargs)[source]
Overloaded function.
write_function(self: dolfinx.cpp.io.XDMFFile, function: dolfinx.cpp.fem.Function_float64, t: float, mesh_xpath: str) -> None
write_function(self: dolfinx.cpp.io.XDMFFile, function: dolfinx.cpp.fem.Function_complex128, t: float, mesh_xpath: str) -> None
- write_mesh(mesh: dolfinx.mesh.Mesh) None [source]
Write mesh to file for a given time (default 0.0)
- dolfinx.io.cell_perm_gmsh()
perm_gmsh(arg0: dolfinx.cpp.mesh.CellType, arg1: int) -> List[int]
Permutation array to map from Gmsh to DOLFINx node ordering
- dolfinx.io.distribute_entity_data(arg0: dolfinx.cpp.mesh.Mesh, arg1: int, arg2: numpy.ndarray[numpy.int64], arg3: numpy.ndarray[numpy.int32]) Tuple[numpy.ndarray[numpy.int32], numpy.ndarray[numpy.int32]]