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);
108 template <std::
floating_po
int U>
110 std::string_view xpath =
"/Xdmf/Domain");
117 std::string_view name,
118 std::string_view xpath =
"/Xdmf/Domain");
133 std::string_view name, std::string_view xpath =
"/Xdmf/Domain",
134 std::optional<std::int32_t> max_facet_to_cell_links = 2,
135 int num_threads = 1)
const;
141 std::pair<std::vector<std::int64_t>, std::array<std::size_t, 2>>
143 std::string_view xpath =
"/Xdmf/Domain")
const;
149 std::pair<std::variant<std::vector<float>, std::vector<double>>,
150 std::array<std::size_t, 2>>
152 std::string_view xpath =
"/Xdmf/Domain")
const;
157 std::pair<mesh::CellType, int>
read_cell_type(std::string_view grid_name,
158 std::string_view xpath
159 =
"/Xdmf/Domain")
const;
177 template <dolfinx::scalar T, std::
floating_po
int U = scalar_value_t<T>>
179 std::string_view mesh_xpath
180 =
"/Xdmf/Domain/Grid[@GridType='Uniform'][1]");
188 template <std::
floating_po
int T>
191 std::string_view geometry_xpath,
192 std::string_view xpath =
"/Xdmf/Domain");
203 std::optional<std::string_view> attribute_name,
204 std::string_view xpath =
"/Xdmf/Domain")
const;
211 std::string_view xpath =
"/Xdmf/Domain/");
217 std::string_view xpath =
"/Xdmf/Domain/")
const;
225 MPI_Comm
comm()
const;
232 std::filesystem::path _filename;
235 std::string _file_mode;
243 std::unique_ptr<pugi::xml_document> _xml_doc;
A duplicate MPI communicator and manage lifetime of the communicator.
Definition MPI.h:47
Definition CoordinateElement.h:39
Read and write mesh::Mesh, fem::Function and other objects in XDMF.
Definition XDMFFile.h:60
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:253
XDMFFile(MPI_Comm comm, const std::filesystem::path &filename, std::string_view file_mode, Encoding encoding=Encoding::HDF5)
Constructor.
Definition XDMFFile.cpp:31
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:232
XDMFFile(XDMFFile &&file) noexcept
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:210
std::pair< mesh::CellType, int > read_cell_type(std::string_view grid_name, std::string_view xpath="/Xdmf/Domain") const
Definition XDMFFile.cpp:432
void close()
Definition XDMFFile.cpp:138
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:322
void write_information(std::string_view name, std::string_view value, std::string_view xpath="/Xdmf/Domain/")
Definition XDMFFile.cpp:462
XDMFFile & operator=(XDMFFile &&file) noexcept
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:165
std::string read_information(std::string_view name, std::string_view xpath="/Xdmf/Domain/") const
Definition XDMFFile.cpp:480
void write_mesh(const mesh::Mesh< U > &mesh, std::string_view xpath="/Xdmf/Domain")
Definition XDMFFile.cpp:146
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, int num_threads=1) const
Definition XDMFFile.cpp:188
MPI_Comm comm() const
Definition XDMFFile.cpp:508
void flush()
Definition XDMFFile.cpp:501
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:360
Scope guard for an HDF5 identifier.
Definition HDF5Interface.h:39
Geometry stores the geometry imposed on a mesh.
Definition Geometry.h:39
A Mesh consists of a set of connected and numbered mesh topological entities, and geometry data.
Definition Mesh.h:25
Finite element method functionality.
Definition assemble_expression_impl.h:28
Geometry data structures and algorithms.
Definition BoundingBoxTree.h:26
Support for file IO.
Definition ADIOS2Writers.h:44
Mesh data structures and algorithms on meshes.
Definition DofMap.h:32
GhostMode
Enum for different partitioning ghost modes.
Definition types.h:19