# dolfinx.cpp.io

I/O module

Classes

`VTKFile`(self, comm, filename, mode) |
`VTXMeshPolicy`(*values) |
`VTXWriter_float32`() |
`VTXWriter_float64`() |
`XDMFFile`(self, comm, filename, file_mode[, ...]) |

class dolfinx.cpp.io.VTKFile(self, comm: MPICommWrapper, filename: str | os.PathLike, mode: str)

  Bases: `object`

  close(self) → None
  write(self, mesh: dolfinx.cpp.mesh.Mesh_float32, t: float = 0) → None
  write(self, mesh: dolfinx.cpp.mesh.Mesh_float64, t: float = 0) → None
  write(self, u: collections.abc.Sequence[dolfinx.cpp.fem.Function_float32], t: float = 0) → None
  write(self, u: collections.abc.Sequence[dolfinx.cpp.fem.Function_float64], t: float = 0) → None
  write(self, u: collections.abc.Sequence[dolfinx.cpp.fem.Function_complex64], t: float = 0) → None
  write(self, u: collections.abc.Sequence[dolfinx.cpp.fem.Function_complex128], t: float = 0) → None

class dolfinx.cpp.io.VTXMeshPolicy(*values)

  Bases: `Enum`

  reuse = 1
  update = 0

class dolfinx.cpp.io.VTXWriter_float32(self, comm: MPICommWrapper, filename: str | os.PathLike, mesh: dolfinx.cpp.mesh.Mesh_float32, engine: str)
class dolfinx.cpp.io.VTXWriter_float32(self, comm: MPICommWrapper, filename: str | os.PathLike, u: collections.abc.Sequence[dolfinx.cpp.fem.Function_float32 | dolfinx::fem::Function<double, float> | dolfinx.cpp.fem.Function_complex64 | dolfinx::fem::Function<std::complex<double>, float>], engine: str = 'BPFile', policy: dolfinx.cpp.io.VTXMeshPolicy = VTXMeshPolicy.update)

  Bases: `object`

  close(self) → None
  write(self, t: float) → None

class dolfinx.cpp.io.VTXWriter_float64(self, comm: MPICommWrapper, filename: str | os.PathLike, mesh: dolfinx.cpp.mesh.Mesh_float64, engine: str)
class dolfinx.cpp.io.VTXWriter_float64(self, comm: MPICommWrapper, filename: str | os.PathLike, u: collections.abc.Sequence[dolfinx::fem::Function<float, double> | dolfinx.cpp.fem.Function_float64 | dolfinx::fem::Function<std::complex<float>, double> | dolfinx.cpp.fem.Function_complex128], engine: str = 'BPFile', policy: dolfinx.cpp.io.VTXMeshPolicy = VTXMeshPolicy.update)

  Bases: `object`

  close(self) → None
  write(self, t: float) → None

class dolfinx.cpp.io.XDMFFile(self, comm: MPICommWrapper, filename: str | os.PathLike, file_mode: str, encoding: dolfinx.cpp.io.XDMFFile.Encoding = Encoding.HDF5)

  Bases: `object`

  class Encoding(*values)

    Bases: `Enum`

    ASCII = 1
    HDF5 = 0
  close(self) → None
  property comm

    (self) -> MPICommWrapper

  flush(self) → None
  read_cell_type(self, name: str = 'mesh', xpath: str = '/Xdmf/Domain') → tuple[dolfinx.cpp.mesh.CellType, int]
  read_geometry_data(self, name: str = 'mesh', xpath: str = '/Xdmf/Domain') → numpy.ndarray[dtype=float64]
  read_geometry_data(self, name: str = 'mesh', xpath: str = '/Xdmf/Domain') → tuple[list[float] | list[float], std::array<unsigned long, 2ul>]
  read_information(self, name: str, xpath: str = '/Xdmf/Domain') → str
  read_meshtags(self, mesh: dolfinx.cpp.mesh.Mesh_float64, name: str, attribute_name: str | None, xpath: str) → dolfinx.cpp.mesh.MeshTags_int32
  read_topology_data(self, name: str = 'mesh', xpath: str = '/Xdmf/Domain') → numpy.ndarray[dtype=int64]
  write_function(self, u: dolfinx.cpp.fem.Function_float32, t: float, mesh_xpath: str = "/Xdmf/Domain/Grid[@GridType='Uniform'][1]") → None
  write_function(self, u: dolfinx.cpp.fem.Function_float64, t: float, mesh_xpath: str = "/Xdmf/Domain/Grid[@GridType='Uniform'][1]") → None
  write_function(self, u: dolfinx.cpp.fem.Function_complex64, t: float, mesh_xpath: str = "/Xdmf/Domain/Grid[@GridType='Uniform'][1]") → None
  write_function(self, u: dolfinx.cpp.fem.Function_complex128, t: float, mesh_xpath: str = "/Xdmf/Domain/Grid[@GridType='Uniform'][1]") → None
  write_geometry(self, geometry: dolfinx.cpp.mesh.Geometry_float64, name: str = 'geometry', xpath: str = '/Xdmf/Domain') → None
  write_information(self, name: str, value: str, xpath: str = '/Xdmf/Domain') → None
  write_mesh(self, mesh: dolfinx.cpp.mesh.Mesh_float32, xpath: str = '/Xdmf/Domain') → None
  write_mesh(self, mesh: dolfinx.cpp.mesh.Mesh_float64, xpath: str = '/Xdmf/Domain') → None
  write_meshtags(self, meshtags: dolfinx.cpp.mesh.MeshTags_int32, x: dolfinx.cpp.mesh.Geometry_float32, geometry_xpath: str, xpath: str = '/Xdmf/Domain') → None
  write_meshtags(self, meshtags: dolfinx.cpp.mesh.MeshTags_int32, x: dolfinx.cpp.mesh.Geometry_float64, geometry_xpath: str, xpath: str = '/Xdmf/Domain') → None