Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/dolfinx/v0.9.0/cpp/doxygen/de/ded/xdmf__mesh_8h_source.html
DOLFINx  0.5.1
DOLFINx C++ interface
xdmf_mesh.h
1 // Copyright (C) 2012-2018 Chris N. Richardson and Garth N. Wells
2 //
3 // This file is part of DOLFINx (https://www.fenicsproject.org)
4 //
5 // SPDX-License-Identifier: LGPL-3.0-or-later
6 
7 #pragma once
8 
9 #include <array>
10 #include <hdf5.h>
11 #include <mpi.h>
12 #include <span>
13 #include <string>
14 #include <utility>
15 #include <vector>
16 
17 namespace pugi
18 {
19 class xml_node;
20 } // namespace pugi
21 
22 namespace dolfinx
23 {
24 
25 namespace mesh
26 {
27 class Geometry;
28 class Mesh;
29 class Topology;
30 } // namespace mesh
31 
33 namespace io::xdmf_mesh
34 {
35 
40 void add_mesh(MPI_Comm comm, pugi::xml_node& xml_node, const hid_t h5_id,
41  const mesh::Mesh& mesh, const std::string path_prefix);
42 
53 void add_topology_data(MPI_Comm comm, pugi::xml_node& xml_node,
54  const hid_t h5_id, const std::string path_prefix,
55  const mesh::Topology& topology,
56  const mesh::Geometry& geometry, int cell_dim,
57  const std::span<const std::int32_t>& entities);
58 
60 void add_geometry_data(MPI_Comm comm, pugi::xml_node& xml_node,
61  const hid_t h5_id, const std::string path_prefix,
62  const mesh::Geometry& geometry);
63 
70 std::pair<std::vector<double>, std::array<std::size_t, 2>>
71 read_geometry_data(MPI_Comm comm, const hid_t h5_id,
72  const pugi::xml_node& node);
73 
80 std::pair<std::vector<std::int64_t>, std::array<std::size_t, 2>>
81 read_topology_data(MPI_Comm comm, const hid_t h5_id,
82  const pugi::xml_node& node);
83 
84 } // namespace io::xdmf_mesh
85 } // namespace dolfinx
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
Topology stores the topology of a mesh, consisting of mesh entities and connectivity (incidence relat...
Definition: Topology.h:44
void add_mesh(MPI_Comm comm, pugi::xml_node &xml_node, const hid_t h5_id, const mesh::Mesh &mesh, const std::string path_prefix)
Add Mesh to xml node.
Definition: xdmf_mesh.cpp:202
void add_topology_data(MPI_Comm comm, pugi::xml_node &xml_node, const hid_t h5_id, const std::string path_prefix, const mesh::Topology &topology, const mesh::Geometry &geometry, int cell_dim, const std::span< const std::int32_t > &entities)
Add Topology xml node.
Definition: xdmf_mesh.cpp:20
std::pair< std::vector< double >, std::array< std::size_t, 2 > > read_geometry_data(MPI_Comm comm, const hid_t h5_id, const pugi::xml_node &node)
Read geometry (coordinate) data.
Definition: xdmf_mesh.cpp:235
std::pair< std::vector< std::int64_t >, std::array< std::size_t, 2 > > read_topology_data(MPI_Comm comm, const hid_t h5_id, const pugi::xml_node &node)
Read topology (cell connectivity) data.
Definition: xdmf_mesh.cpp:276
void add_geometry_data(MPI_Comm comm, pugi::xml_node &xml_node, const hid_t h5_id, const std::string path_prefix, const mesh::Geometry &geometry)
Add Geometry xml node.
Definition: xdmf_mesh.cpp:149