Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/v0.3.0/v0.9.0/cpp
DOLFINx  0.3.0
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 <dolfinx/mesh/cell_types.h>
10 #include <hdf5.h>
11 #include <mpi.h>
12 #include <string>
13 #include <tuple>
14 #include <vector>
15 #include <xtl/xspan.hpp>
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 
54 void add_topology_data(MPI_Comm comm, pugi::xml_node& xml_node,
55  const hid_t h5_id, const std::string path_prefix,
56  const mesh::Topology& topology,
57  const mesh::Geometry& geometry, const int cell_dim,
58  const xtl::span<const std::int32_t>& active_entities);
59 
61 void add_geometry_data(MPI_Comm comm, pugi::xml_node& xml_node,
62  const hid_t h5_id, const std::string path_prefix,
63  const mesh::Geometry& geometry);
64 
67 xt::xtensor<double, 2> read_geometry_data(MPI_Comm comm, const hid_t h5_id,
68  const pugi::xml_node& node);
69 
72 xt::xtensor<std::int64_t, 2> read_topology_data(MPI_Comm comm,
73  const hid_t h5_id,
74  const pugi::xml_node& node);
75 
76 } // namespace io::xdmf_mesh
77 } // namespace dolfinx
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:53
Topology stores the topology of a mesh, consisting of mesh entities and connectivity (incidence relat...
Definition: Topology.h:56
xt::xtensor< std::int64_t, 2 > read_topology_data(MPI_Comm comm, const hid_t h5_id, const pugi::xml_node &node)
Read Topology data.
Definition: xdmf_mesh.cpp:280
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:199
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:146
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 xtl::span< const std::int32_t > &active_entities)
Add Topology xml node.
Definition: xdmf_mesh.cpp:19
xt::xtensor< double, 2 > read_geometry_data(MPI_Comm comm, const hid_t h5_id, const pugi::xml_node &node)
Read Geometry data.
Definition: xdmf_mesh.cpp:231