dolfinx.io.vtkhdf

Functions

read_mesh(comm, filename[, dtype, gdim, ...])

Read a mesh from a VTKHDF format file.

write_cell_data(filename, mesh, data, time)

Write data at cells of the mesh.

write_mesh(filename, mesh)

Write a mesh to file in VTKHDF format

write_point_data(filename, mesh, data, time)

Write data at vertices of the mesh.

dolfinx.io.vtkhdf.read_mesh(comm: ~mpi4py.MPI.Comm, filename: str | ~pathlib.Path, dtype: ~numpy.dtype[~typing.Any] | None | type[~typing.Any] | ~numpy._typing._dtype_like._SupportsDType[~numpy.dtype[~typing.Any]] | str | tuple[~typing.Any, int] | tuple[~typing.Any, ~typing.SupportsIndex | ~collections.abc.Sequence[~typing.SupportsIndex]] | list[~typing.Any] | ~numpy._typing._dtype_like._DTypeDict | tuple[~typing.Any, ~typing.Any] = <class 'numpy.float64'>, gdim: int = 3, max_facet_to_cell_links: int = 2)[source]

Read a mesh from a VTKHDF format file.

Note

Changing max_facet_to_cell_links from the default value should only be required when working on branching manifolds. Changing this value on non-branching meshes will only result in a slower mesh partitioning and creation.

Parameters:
  • comm – An MPI communicator.

  • filename – File to read from.

  • dtype – Scalar type of mesh geometry (need not match dtype in file).

  • gdim – Geometric dimension of the mesh.

  • max_facet_to_cell_links – Maximum number of cells that can be linked to a facet.

dolfinx.io.vtkhdf.write_cell_data(filename: str | Path, mesh: Mesh, data: ndarray[tuple[int, ...], dtype[_ScalarType_co]], time: float)[source]

Write data at cells of the mesh.

Parameters:
  • filename – File to write to.

  • mesh – Mesh.

  • data – Data at the cells of the mesh, local to each process.

  • time – Timestamp.

dolfinx.io.vtkhdf.write_mesh(filename: str | Path, mesh: Mesh)[source]

Write a mesh to file in VTKHDF format

Parameters:
  • filename – File to write to.

  • mesh – Mesh.

dolfinx.io.vtkhdf.write_point_data(filename: str | Path, mesh: Mesh, data: ndarray[tuple[int, ...], dtype[_ScalarType_co]], time: float)[source]

Write data at vertices of the mesh.

Parameters:
  • filename – File to write to.

  • mesh – Mesh.

  • data – Data at the points of the mesh, local to each process.

  • time – Timestamp.