11#include <dolfinx/common/IndexMap.h>
35 requires std::is_convertible_v<std::remove_cvref_t<U>,
36 std::vector<std::int32_t>>
47 throw std::runtime_error(
48 "No index map for entities, call `Topology::create_entities("
49 + std::to_string(_dim) +
")");
52 std::size_t num_ents = e_imap->size_local() + e_imap->num_ghosts();
53 if (num_ents != _sub_topology_to_topology.size())
55 throw std::runtime_error(
56 "Size mismatch between `sub_topology_to_topology` and index map.");
72 std::size_t
dim()
const;
76 std::shared_ptr<const Topology>
topology()
const;
102 std::vector<std::int32_t>
111 std::shared_ptr<const Topology> _topology;
116 std::vector<std::int32_t> _sub_topology_to_topology;
120 std::shared_ptr<const Topology> _sub_topology;
std::vector< std::int32_t > sub_topology_to_topology(std::span< const std::int32_t > entities, bool inverse) const
Map entities between the sub-topology and the parent topology.
Definition EntityMap.cpp:30
EntityMap(EntityMap &&map)=default
Move constructor.
std::size_t dim() const
Get the topological dimension of the entities related by this EntityMap.
Definition EntityMap.cpp:17
EntityMap(std::shared_ptr< const Topology > topology, std::shared_ptr< const Topology > sub_topology, int dim, U &&sub_topology_to_topology)
Constructor of a bidirectional map relating entities of dimension dim in topology and sub_topology.
Definition EntityMap.h:37
EntityMap(const EntityMap &map)=default
Copy constructor.
std::shared_ptr< const Topology > sub_topology() const
Get the sub-topology.
Definition EntityMap.cpp:24
std::shared_ptr< const Topology > topology() const
Get the (parent) topology.
Definition EntityMap.cpp:19
Mesh data structures and algorithms on meshes.
Definition DofMap.h:32