9#include "HDF5Interface.h"
11#include <dolfinx/common/MPI.h>
12#include <dolfinx/mesh/cell_types.h>
29template <std::
floating_po
int T>
31template <dolfinx::scalar T, std::
floating_po
int U>
37template <std::
floating_po
int T>
40template <std::
floating_po
int T>
70 XDMFFile(MPI_Comm
comm,
const std::filesystem::path& filename,
71 std::string_view file_mode,
Encoding encoding = Encoding::HDF5);
89 template <std::
floating_po
int U>
91 std::string_view xpath =
"/Xdmf/Domain");
98 std::string_view name,
99 std::string_view xpath =
"/Xdmf/Domain");
113 std::string_view name, std::string_view xpath =
"/Xdmf/Domain",
114 std::optional<std::int32_t> max_facet_to_cell_links = 2)
const;
120 std::pair<std::vector<std::int64_t>, std::array<std::size_t, 2>>
122 std::string_view xpath =
"/Xdmf/Domain")
const;
128 std::pair<std::variant<std::vector<float>, std::vector<double>>,
129 std::array<std::size_t, 2>>
131 std::string_view xpath =
"/Xdmf/Domain")
const;
136 std::pair<mesh::CellType, int>
read_cell_type(std::string_view grid_name,
137 std::string_view xpath
138 =
"/Xdmf/Domain")
const;
156 template <dolfinx::scalar T, std::
floating_po
int U = scalar_value_t<T>>
158 std::string_view mesh_xpath
159 =
"/Xdmf/Domain/Grid[@GridType='Uniform'][1]");
167 template <std::
floating_po
int T>
170 std::string_view geometry_xpath,
171 std::string_view xpath =
"/Xdmf/Domain");
182 std::optional<std::string_view> attribute_name,
183 std::string_view xpath =
"/Xdmf/Domain")
const;
190 std::string_view xpath =
"/Xdmf/Domain/");
196 std::string_view xpath =
"/Xdmf/Domain/")
const;
204 MPI_Comm
comm()
const;
211 std::filesystem::path _filename;
214 std::string _file_mode;
221 std::unique_ptr<pugi::xml_document> _xml_doc;
A duplicate MPI communicator and manage lifetime of the communicator.
Definition MPI.h:43
Definition CoordinateElement.h:38
void write_function(const fem::Function< T, U > &u, double t, std::string_view mesh_xpath="/Xdmf/Domain/Grid[@GridType='Uniform'][1]")
Write a fem::Function to file.
Definition XDMFFile.cpp:245
XDMFFile(MPI_Comm comm, const std::filesystem::path &filename, std::string_view file_mode, Encoding encoding=Encoding::HDF5)
Constructor.
Definition XDMFFile.cpp:30
std::pair< std::variant< std::vector< float >, std::vector< double > >, std::array< std::size_t, 2 > > read_geometry_data(std::string_view name, std::string_view xpath="/Xdmf/Domain") const
Definition XDMFFile.cpp:226
~XDMFFile()
Destructor.
Definition XDMFFile.cpp:135
std::pair< std::vector< std::int64_t >, std::array< std::size_t, 2 > > read_topology_data(std::string_view name, std::string_view xpath="/Xdmf/Domain") const
Definition XDMFFile.cpp:206
std::pair< mesh::CellType, int > read_cell_type(std::string_view grid_name, std::string_view xpath="/Xdmf/Domain") const
Definition XDMFFile.cpp:423
void close()
Definition XDMFFile.cpp:137
mesh::Mesh< double > read_mesh(const fem::CoordinateElement< double > &element, mesh::GhostMode mode, std::string_view name, std::string_view xpath="/Xdmf/Domain", std::optional< std::int32_t > max_facet_to_cell_links=2) const
Definition XDMFFile.cpp:188
void write_meshtags(const mesh::MeshTags< std::int32_t > &meshtags, const mesh::Geometry< T > &x, std::string_view geometry_xpath, std::string_view xpath="/Xdmf/Domain")
Definition XDMFFile.cpp:314
XDMFFile(XDMFFile &&)=default
Move constructor.
void write_information(std::string_view name, std::string_view value, std::string_view xpath="/Xdmf/Domain/")
Definition XDMFFile.cpp:451
Encoding
File encoding type.
Definition XDMFFile.h:64
void write_geometry(const mesh::Geometry< double > &geometry, std::string_view name, std::string_view xpath="/Xdmf/Domain")
Definition XDMFFile.cpp:164
std::string read_information(std::string_view name, std::string_view xpath="/Xdmf/Domain/") const
Definition XDMFFile.cpp:469
void write_mesh(const mesh::Mesh< U > &mesh, std::string_view xpath="/Xdmf/Domain")
Definition XDMFFile.cpp:145
MPI_Comm comm() const
Definition XDMFFile.cpp:494
void flush()
Definition XDMFFile.cpp:488
mesh::MeshTags< std::int32_t > read_meshtags(const mesh::Mesh< double > &mesh, std::string_view name, std::optional< std::string_view > attribute_name, std::string_view xpath="/Xdmf/Domain") const
Definition XDMFFile.cpp:352
Geometry stores the geometry imposed on a mesh.
Definition Geometry.h:37
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:24
Support for file IO.
Definition ADIOS2Writers.h:43
Mesh data structures and algorithms on meshes.
Definition DofMap.h:32
GhostMode
Enum for different partitioning ghost modes.
Definition utils.h:44