cashocs.io.mesh.export_mesh#

cashocs.io.mesh.export_mesh(mesh: fenics.Mesh, mesh_file: str, subdomains: fenics.MeshFunction | None = None, boundaries: fenics.MeshFunction | None = None, comm: MPI.Comm | None = None) None[source]#

Exports a mesh (together with its subdomains and boundaries).

This is useful so that the mesh can be reimported later on again. This is used for checkpointing in cashocs, but also has other use cases, e.g., storing a function on hard disk and later reimporting it to perform a post-processing.

Parameters:
  • mesh (fenics.Mesh) – The fenics mesh which shall be exported.

  • mesh_file (str) – Filename / path to the exported mesh. Has to end in .xdmf. Boundaries and subdomains will be named accordingly.

  • subdomains (fenics.MeshFunction | None) – The subdomains meshfunction corresponding to the mesh. Optional, default is None, so that no subdomain information is used.

  • boundaries (fenics.MeshFunction | None) – The boundaries meshfunction corresponding to the mesh. Optional, default is None, so that no boundary information is used.

  • comm (MPI.Comm | None) – The MPI communicator used. Optional, default is None, so that the fenics.MPI.comm_world is used.

Return type:

None