From: Martin Kronbichler Date: Tue, 20 May 2025 12:13:36 +0000 (+0200) Subject: Improve performance of CellAccessor::has_periodic_neighbor X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F18468%2Fhead;p=dealii.git Improve performance of CellAccessor::has_periodic_neighbor --- diff --git a/source/grid/tria_accessor.cc b/source/grid/tria_accessor.cc index 39b9541f51..1d258ff96e 100644 --- a/source/grid/tria_accessor.cc +++ b/source/grid/tria_accessor.cc @@ -2686,10 +2686,9 @@ CellAccessor::has_periodic_neighbor( AssertIndexRange(i_face, this->n_faces()); using cell_iterator = TriaIterator>; - cell_iterator current_cell(*this); - if (this->tria->periodic_face_map.find( - std::make_pair(current_cell, i_face)) != - this->tria->periodic_face_map.end()) + if (at_boundary(i_face) && this->tria->periodic_face_map.find( + std::make_pair(cell_iterator(*this), i_face)) != + this->tria->periodic_face_map.end()) return true; return false; }