| 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; |
no test coverage detected