MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / EntityMap

Method EntityMap

cpp/dolfinx/mesh/EntityMap.h:38–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 requires std::is_convertible_v<std::remove_cvref_t<U>,
37 std::vector<std::int32_t>>
38 EntityMap(std::shared_ptr<const Topology> topology,
39 std::shared_ptr<const Topology> sub_topology, int dim,
40 U&& sub_topology_to_topology)
41 : _dim(dim), _topology(topology),
42 _sub_topology_to_topology(std::forward<U>(sub_topology_to_topology)),
43 _sub_topology(sub_topology)
44 {
45 auto e_imap = sub_topology->index_map(_dim);
46 if (!e_imap)
47 {
48 throw std::runtime_error(
49 "No index map for entities, call `Topology::create_entities("
50 + std::to_string(_dim) + ")");
51 }
52
53 std::size_t num_ents = e_imap->size_local() + e_imap->num_ghosts();
54 if (num_ents != _sub_topology_to_topology.size())
55 {
56 throw std::runtime_error(
57 "Size mismatch between `sub_topology_to_topology` and index map.");
58 }
59 }
60
61 /// Copy constructor
62 EntityMap(const EntityMap& map) = default;

Callers 1

entity_mapFunction · 0.80

Calls 4

size_localMethod · 0.80
num_ghostsMethod · 0.80
index_mapMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected