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 const std::string& file_mode,
Encoding encoding = Encoding::HDF5);
88 template <std::
floating_po
int U>
90 const std::string& xpath =
"/Xdmf/Domain");
97 const std::string& name,
98 const std::string& xpath =
"/Xdmf/Domain");
112 const std::string& name,
const std::string& xpath =
"/Xdmf/Domain",
113 std::optional<std::int32_t> max_facet_to_cell_links = 2)
const;
119 std::pair<std::vector<std::int64_t>, std::array<std::size_t, 2>>
121 const std::string& xpath =
"/Xdmf/Domain")
const;
127 std::pair<std::variant<std::vector<float>, std::vector<double>>,
128 std::array<std::size_t, 2>>
130 const std::string& xpath =
"/Xdmf/Domain")
const;
135 std::pair<mesh::CellType, int>
read_cell_type(
const std::string& grid_name,
136 const std::string& xpath
155 template <dolfinx::scalar T, std::
floating_po
int U = scalar_value_t<T>>
157 std::string mesh_xpath
158 =
"/Xdmf/Domain/Grid[@GridType='Uniform'][1]");
166 template <std::
floating_po
int T>
169 const std::string& geometry_xpath,
170 const std::string& xpath =
"/Xdmf/Domain");
181 std::optional<std::string> attribute_name,
182 const std::string& xpath =
"/Xdmf/Domain");
189 const std::string& xpath =
"/Xdmf/Domain/");
195 const std::string& xpath =
"/Xdmf/Domain/");
199 MPI_Comm
comm()
const;
206 std::filesystem::path _filename;
209 std::string _file_mode;
216 std::unique_ptr<pugi::xml_document> _xml_doc;
A duplicate MPI communicator and manage lifetime of the communicator.
Definition MPI.h:42
Definition CoordinateElement.h:38
mesh::Mesh< double > read_mesh(const fem::CoordinateElement< double > &element, mesh::GhostMode mode, const std::string &name, const std::string &xpath="/Xdmf/Domain", std::optional< std::int32_t > max_facet_to_cell_links=2) const
Definition XDMFFile.cpp:186
XDMFFile(MPI_Comm comm, const std::filesystem::path &filename, const std::string &file_mode, Encoding encoding=Encoding::HDF5)
Constructor.
Definition XDMFFile.cpp:28
~XDMFFile()
Destructor.
Definition XDMFFile.cpp:133
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:239
void close()
Definition XDMFFile.cpp:135
std::string read_information(const std::string &name, const std::string &xpath="/Xdmf/Domain/")
Definition XDMFFile.cpp:454
std::pair< std::variant< std::vector< float >, std::vector< double > >, std::array< std::size_t, 2 > > read_geometry_data(const std::string &name, const std::string &xpath="/Xdmf/Domain") const
Definition XDMFFile.cpp:222
std::pair< std::vector< std::int64_t >, std::array< std::size_t, 2 > > read_topology_data(const std::string &name, const std::string &xpath="/Xdmf/Domain") const
Definition XDMFFile.cpp:204
XDMFFile(XDMFFile &&)=default
Move constructor.
void write_information(const std::string &name, const std::string &value, const std::string &xpath="/Xdmf/Domain/")
Definition XDMFFile.cpp:436
Encoding
File encoding type.
Definition XDMFFile.h:63
std::pair< mesh::CellType, int > read_cell_type(const std::string &grid_name, const std::string &xpath="/Xdmf/Domain")
Definition XDMFFile.cpp:412
MPI_Comm comm() const
Definition XDMFFile.cpp:471
void write_meshtags(const mesh::MeshTags< std::int32_t > &meshtags, const mesh::Geometry< T > &x, const std::string &geometry_xpath, const std::string &xpath="/Xdmf/Domain")
Definition XDMFFile.cpp:307
mesh::MeshTags< std::int32_t > read_meshtags(const mesh::Mesh< double > &mesh, const std::string &name, std::optional< std::string > attribute_name, const std::string &xpath="/Xdmf/Domain")
Definition XDMFFile.cpp:344
void write_mesh(const mesh::Mesh< U > &mesh, const std::string &xpath="/Xdmf/Domain")
Definition XDMFFile.cpp:143
void write_geometry(const mesh::Geometry< double > &geometry, const std::string &name, const std::string &xpath="/Xdmf/Domain")
Definition XDMFFile.cpp:163
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_expression_impl.h:23
Geometry data structures and algorithms.
Definition BoundingBoxTree.h:22
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:41