Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve check for facet->cell connectivity #3281

Merged
merged 3 commits into from
Jun 26, 2024
Merged
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
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(
chrisrichardson marked this conversation as resolved.
Show resolved Hide resolved
"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
Loading