9#include "HDF5Interface.h"
11#include <dolfinx/common/MPI.h>
12#include <dolfinx/mesh/cell_types.h>
28template <std::
floating_po
int T>
30template <dolfinx::scalar T, std::
floating_po
int U>
36template <std::
floating_po
int T>
39template <std::
floating_po
int T>
69 XDMFFile(MPI_Comm
comm,
const std::filesystem::path& filename,
70 std::string file_mode,
Encoding encoding = Encoding::HDF5);
88 template <std::
floating_po
int U>
90 std::string xpath =
"/Xdmf/Domain");
97 std::string xpath =
"/Xdmf/Domain");
109 std::string xpath =
"/Xdmf/Domain")
const;
115 std::pair<std::vector<std::int64_t>, std::array<std::size_t, 2>>
117 std::string xpath =
"/Xdmf/Domain")
const;
123 std::pair<std::variant<std::vector<float>, std::vector<double>>,
124 std::array<std::size_t, 2>>
126 std::string xpath =
"/Xdmf/Domain")
const;
131 std::pair<mesh::CellType, int>
132 read_cell_type(std::string grid_name, std::string xpath =
"/Xdmf/Domain");
150 template <dolfinx::scalar T, std::
floating_po
int U = scalar_value_type_t<T>>
152 std::string mesh_xpath
153 =
"/Xdmf/Domain/Grid[@GridType='Uniform'][1]");
161 template <std::
floating_po
int T>
164 std::string xpath =
"/Xdmf/Domain");
175 std::optional<std::string> attribute_name,
176 std::string xpath =
"/Xdmf/Domain");
183 std::string xpath =
"/Xdmf/Domain/");
189 std::string xpath =
"/Xdmf/Domain/");
193 MPI_Comm
comm()
const;
200 std::filesystem::path _filename;
203 std::string _file_mode;
210 std::unique_ptr<pugi::xml_document> _xml_doc;
A duplicate MPI communicator and manage lifetime of the communicator.
Definition MPI.h:44
Read and write mesh::Mesh, fem::Function and other objects in XDMF.
Definition XDMFFile.h:59
mesh::MeshTags< std::int32_t > read_meshtags(const mesh::Mesh< double > &mesh, std::string name, std::optional< std::string > attribute_name, std::string xpath="/Xdmf/Domain")
Definition XDMFFile.cpp:337
mesh::Mesh< double > read_mesh(const fem::CoordinateElement< double > &element, mesh::GhostMode mode, std::string name, std::string xpath="/Xdmf/Domain") const
Definition XDMFFile.cpp:183
void write_meshtags(const mesh::MeshTags< std::int32_t > &meshtags, const mesh::Geometry< T > &x, std::string geometry_xpath, std::string xpath="/Xdmf/Domain")
Definition XDMFFile.cpp:301
void write_information(std::string name, std::string value, std::string xpath="/Xdmf/Domain/")
Definition XDMFFile.cpp:431
~XDMFFile()
Destructor.
Definition XDMFFile.cpp:132
void write_function(const fem::Function< T, U > &u, double t, std::string mesh_xpath="/Xdmf/Domain/Grid[@GridType='Uniform'][1]")
Write a fem::Function to file.
Definition XDMFFile.cpp:233
void close()
Definition XDMFFile.cpp:134
XDMFFile(XDMFFile &&)=default
Move constructor.
std::pair< std::vector< std::int64_t >, std::array< std::size_t, 2 > > read_topology_data(std::string name, std::string xpath="/Xdmf/Domain") const
Definition XDMFFile.cpp:200
std::pair< mesh::CellType, int > read_cell_type(std::string grid_name, std::string xpath="/Xdmf/Domain")
Definition XDMFFile.cpp:406
std::pair< std::variant< std::vector< float >, std::vector< double > >, std::array< std::size_t, 2 > > read_geometry_data(std::string name, std::string xpath="/Xdmf/Domain") const
Definition XDMFFile.cpp:217
XDMFFile(MPI_Comm comm, const std::filesystem::path &filename, std::string file_mode, Encoding encoding=Encoding::HDF5)
Constructor.
Definition XDMFFile.cpp:27
void write_geometry(const mesh::Geometry< double > &geometry, std::string name, std::string xpath="/Xdmf/Domain")
Definition XDMFFile.cpp:160
std::string read_information(std::string name, std::string xpath="/Xdmf/Domain/")
Definition XDMFFile.cpp:448
MPI_Comm comm() const
Definition XDMFFile.cpp:464
Encoding
File encoding type.
Definition XDMFFile.h:63
void write_mesh(const mesh::Mesh< U > &mesh, std::string xpath="/Xdmf/Domain")
Definition XDMFFile.cpp:142
Geometry stores the geometry imposed on a mesh.
Definition Geometry.h:34
A Mesh consists of a set of connected and numbered mesh topological entities, and geometry data.
Definition Mesh.h:23
Finite element method functionality.
Definition assemble_matrix_impl.h:26
Support for file IO.
Definition cells.h:119
Mesh data structures and algorithms on meshes.
Definition DofMap.h:32
GhostMode
Enum for different partitioning ghost modes.
Definition utils.h:36