Skip to content

Commit

Permalink
Improve check for facet->cell connectivity (#3281)
Browse files Browse the repository at this point in the history
* Improve check

* Update utils.cpp
  • Loading branch information
chrisrichardson authored Jun 26, 2024
1 parent cda04e8 commit d125d5e
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cpp/dolfinx/mesh/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,15 @@ mesh::extract_topology(CellType cell_type, const fem::ElementDofLayout& layout,
std::vector<std::int32_t> mesh::exterior_facet_indices(const Topology& topology)
{
const int tdim = topology.dim();
auto facet_map = topology.index_map(tdim - 1);
if (!facet_map)
throw std::runtime_error("Facets have not been computed.");

auto f_to_c = topology.connectivity(tdim - 1, tdim);
if (!f_to_c)
{
throw std::runtime_error(
"Facet to cell connectivity has not been computed.");
}
// Find all owned facets (not ghost) with only one attached cell
auto facet_map = topology.index_map(tdim - 1);
const int num_facets = facet_map->size_local();
auto f_to_c = topology.connectivity(tdim - 1, tdim);
assert(f_to_c);
std::vector<std::int32_t> facets;
for (std::int32_t f = 0; f < num_facets; ++f)
{
Expand Down

0 comments on commit d125d5e

Please sign in to comment.