Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cpp/dolfinx/mesh/Geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,9 @@ create_geometry(const Topology& topology,
// If the mesh has higher order geometry, permute the dofmap
if (elements.front().needs_dof_permutations())
{
const std::int32_t num_cells
= topology.connectivity(topology.dim(), 0)->num_nodes();
std::int32_t num_cells = 0;
for (const auto& imap : topology.index_maps(topology.dim()))
num_cells += imap->size_local() + imap->num_ghosts();
const std::vector<std::uint32_t>& cell_info
= topology.get_cell_permutation_info();
int d = elements.front().dim();
Expand Down
11 changes: 7 additions & 4 deletions cpp/dolfinx/mesh/Topology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,10 +859,13 @@ Topology::connectivity(int d0, int d1) const
const std::vector<std::uint32_t>& Topology::get_cell_permutation_info() const
{
// Check if this process owns or ghosts any cells
assert(this->index_map(this->dim()));
if (auto i_map = this->index_map(this->dim());
_cell_permutations.empty()
and i_map->size_local() + i_map->num_ghosts() > 0)
if (auto im = this->index_maps(this->dim()); im.empty())
throw std::runtime_error("Missing IndexMap in Topology.");

const bool has_cells = std::ranges::any_of(
this->index_maps(this->dim()), [](const auto& imap)
{ return imap->size_local() + imap->num_ghosts() > 0; });
if (has_cells and _cell_permutations.empty())
{
throw std::runtime_error(
"create_entity_permutations must be called before using this data.");
Expand Down
Loading