DOLFIN-X
DOLFIN-X 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 <dolfinx/common/array2d.h>
10 #include <dolfinx/common/span.hpp>
11 #include <dolfinx/mesh/cell_types.h>
12 #include <hdf5.h>
13 #include <mpi.h>
14 #include <string>
15 #include <tuple>
16 #include <vector>
17 
18 namespace pugi
19 {
20 class xml_node;
21 } // namespace pugi
22 
23 namespace dolfinx
24 {
25 
26 namespace mesh
27 {
28 class Geometry;
29 class Mesh;
30 class Topology;
31 } // namespace mesh
32 
34 namespace io::xdmf_mesh
35 {
36 
41 void add_mesh(MPI_Comm comm, pugi::xml_node& xml_node, const hid_t h5_id,
42  const mesh::Mesh& mesh, const std::string path_prefix);
43 
55 void add_topology_data(MPI_Comm comm, pugi::xml_node& xml_node,
56  const hid_t h5_id, const std::string path_prefix,
57  const mesh::Topology& topology,
58  const mesh::Geometry& geometry, const int cell_dim,
59  const tcb::span<const std::int32_t>& active_entities);
60 
62 void add_geometry_data(MPI_Comm comm, pugi::xml_node& xml_node,
63  const hid_t h5_id, const std::string path_prefix,
64  const mesh::Geometry& geometry);
65 
68 array2d<double> read_geometry_data(MPI_Comm comm, const hid_t h5_id,
69  const pugi::xml_node& node);
70 
73 array2d<std::int64_t> read_topology_data(MPI_Comm comm, const hid_t h5_id,
74  const pugi::xml_node& node);
75 
76 } // namespace io::xdmf_mesh
77 } // namespace dolfinx
This class provides a dynamic 2-dimensional row-wise array data structure.
Definition: array2d.h:21
Geometry stores the geometry imposed on a mesh.
Definition: Geometry.h:35
A Mesh consists of a set of connected and numbered mesh topological entities, and geometry data.
Definition: Mesh.h:57
Topology stores the topology of a mesh, consisting of mesh entities and connectivity (incidence relat...
Definition: Topology.h:57
array2d< double > read_geometry_data(MPI_Comm comm, const hid_t h5_id, const pugi::xml_node &node)
Read Geometry data.
Definition: xdmf_mesh.cpp:226
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:194
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:141
array2d< std::int64_t > read_topology_data(MPI_Comm comm, const hid_t h5_id, const pugi::xml_node &node)
Read Topology data.
Definition: xdmf_mesh.cpp:264
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, const int cell_dim, const tcb::span< const std::int32_t > &active_entities)
Add Topology xml node.
Definition: xdmf_mesh.cpp:20