9 #include "HDF5Interface.h"
10 #include <dolfinx/common/MPI.h>
11 #include <dolfinx/mesh/cell_types.h>
24 class CoordinateElement;
67 static const Encoding default_encoding = Encoding::HDF5;
70 XDMFFile(MPI_Comm comm,
const std::filesystem::path& filename,
71 const std::string file_mode,
72 const Encoding encoding = default_encoding);
88 const std::string xpath =
"/Xdmf/Domain");
94 void write_geometry(
const mesh::Geometry& geometry,
const std::string name,
95 const std::string xpath =
"/Xdmf/Domain");
107 const std::string xpath =
"/Xdmf/Domain")
const;
113 std::pair<std::vector<std::int64_t>, std::array<std::size_t, 2>>
114 read_topology_data(
const std::string name,
115 const std::string xpath =
"/Xdmf/Domain")
const;
121 std::pair<std::vector<double>, std::array<std::size_t, 2>>
122 read_geometry_data(
const std::string name,
123 const std::string xpath =
"/Xdmf/Domain")
const;
128 std::pair<mesh::CellType, int> read_cell_type(
const std::string grid_name,
129 const std::string xpath
138 const std::string& mesh_xpath
139 =
"/Xdmf/Domain/Grid[@GridType='Uniform'][1]");
146 void write_function(
const fem::Function<std::complex<double>>& u,
double t,
147 const std::string& mesh_xpath
148 =
"/Xdmf/Domain/Grid[@GridType='Uniform'][1]");
156 const std::string& geometry_xpath,
157 const std::string& xpath =
"/Xdmf/Domain");
164 read_meshtags(
const std::shared_ptr<const mesh::Mesh>& mesh,
165 const std::string name,
166 const std::string xpath =
"/Xdmf/Domain");
172 void write_information(
const std::string name,
const std::string value,
173 const std::string xpath =
"/Xdmf/Domain/");
178 std::string read_information(
const std::string name,
179 const std::string xpath =
"/Xdmf/Domain/");
183 MPI_Comm comm()
const;
190 std::filesystem::path _filename;
193 std::string _file_mode;
200 std::unique_ptr<pugi::xml_document> _xml_doc;
A duplicate MPI communicator and manage lifetime of the communicator.
Definition: MPI.h:41
A CoordinateElement manages coordinate mappings for isoparametric cells.
Definition: CoordinateElement.h:32
This class represents a function in a finite element function space , given by.
Definition: Function.h:45
Read and write mesh::Mesh, fem::Function and other objects in XDMF.
Definition: XDMFFile.h:57
Encoding
File encoding type.
Definition: XDMFFile.h:61
Geometry stores the geometry imposed on a mesh.
Definition: Geometry.h:28
A Mesh consists of a set of connected and numbered mesh topological entities, and geometry data.
Definition: Mesh.h:33
Finite element method functionality.
Definition: assemble_matrix_impl.h:25
Support for file IO.
Definition: ADIOS2Writers.h:39
Mesh data structures and algorithms on meshes.
Definition: DofMap.h:30
GhostMode
Enum for different partitioning ghost modes.
Definition: utils.h:29