Skip intersection method fails on grid boundaries
Summary
Skip intersection method fails on grid boundaries.
What is the current bug behaviour?
When using the PDELab branch that includes skipping intersection infrastructure (pdelab/dune-pdelab!531 (merged)), the currently implemented skip method (!36 (merged)) assumes that there is always a neighbour to fetch domain index from. This leads to a segfault.
What is the expected correct behaviour?
No segfault while using skip intersection infrastructure.
Ideas how to fix this?
Check if the intersection has a neighbor()
:
template<class IG>
void skip_intersection(const IG& ig, bool& skip) const
{
const auto& entity_i = ig.inside();
std::size_t domain_i = subDomain(entity_i);
if constexpr (SubLOP::doSkipIntersection)
_local_operator[domain_i]->skip_intersection(ig, skip);
if (ig.neighbor()) {
const auto& entity_o = ig.outside();
std::size_t domain_o = subDomain(entity_o);
skip &= (domain_i != domain_o);
}
}