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.6.0
DOLFINx C++ interface
Loading...
Searching...
No Matches
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
17namespace pugi
18{
19class xml_node;
20} // namespace pugi
21
22namespace dolfinx
23{
24
25namespace mesh
26{
27class Geometry;
28class Mesh;
29class Topology;
30} // namespace mesh
31
33namespace io::xdmf_mesh
34{
35
40void 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
53void 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 std::span<const std::int32_t> entities);
58
60void 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
70std::pair<std::vector<double>, std::array<std::size_t, 2>>
71read_geometry_data(MPI_Comm comm, const hid_t h5_id,
72 const pugi::xml_node& node);
73
80std::pair<std::vector<std::int64_t>, std::array<std::size_t, 2>>
81read_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:29
A Mesh consists of a set of connected and numbered mesh topological entities, and geometry data.
Definition: Mesh.h:34
Topology stores the topology of a mesh, consisting of mesh entities and connectivity (incidence relat...
Definition: Topology.h:43
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, std::span< const std::int32_t > entities)
Add Topology xml node.
Definition: xdmf_mesh.cpp:20
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
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