DOLFINx
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 <hdf5.h>
10#include <mpi.h>
11#include <string>
12#include <xtensor/xtensor.hpp>
13#include <xtl/xspan.hpp>
14
15namespace pugi
16{
17class xml_node;
18} // namespace pugi
19
20namespace dolfinx
21{
22
23namespace mesh
24{
25class Geometry;
26class Mesh;
27class Topology;
28} // namespace mesh
29
31namespace io::xdmf_mesh
32{
33
38void add_mesh(MPI_Comm comm, pugi::xml_node& xml_node, const hid_t h5_id,
39 const mesh::Mesh& mesh, const std::string path_prefix);
40
51void add_topology_data(MPI_Comm comm, pugi::xml_node& xml_node,
52 const hid_t h5_id, const std::string path_prefix,
53 const mesh::Topology& topology,
54 const mesh::Geometry& geometry, int cell_dim,
55 const xtl::span<const std::int32_t>& entities);
56
58void add_geometry_data(MPI_Comm comm, pugi::xml_node& xml_node,
59 const hid_t h5_id, const std::string path_prefix,
60 const mesh::Geometry& geometry);
61
64xt::xtensor<double, 2> read_geometry_data(MPI_Comm comm, const hid_t h5_id,
65 const pugi::xml_node& node);
66
69xt::xtensor<std::int64_t, 2> read_topology_data(MPI_Comm comm,
70 const hid_t h5_id,
71 const pugi::xml_node& node);
72
73} // namespace io::xdmf_mesh
74} // 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:57
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:200
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:281
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:232
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 xtl::span< const std::int32_t > &entities)
Add Topology xml node.
Definition: xdmf_mesh.cpp:18
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:147