]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve performance of CellAccessor::has_periodic_neighbor 18468/head
authorMartin Kronbichler <martin.kronbichler@rub.de>
Tue, 20 May 2025 12:13:36 +0000 (14:13 +0200)
committerMartin Kronbichler <martin.kronbichler@rub.de>
Tue, 20 May 2025 12:13:36 +0000 (14:13 +0200)
source/grid/tria_accessor.cc

index 39b9541f51532e6cbaa0556355c606762b097636..1d258ff96e52bf9e115c6fb06d11a0ed5568897e 100644 (file)
@@ -2686,10 +2686,9 @@ CellAccessor<dim, spacedim>::has_periodic_neighbor(
   AssertIndexRange(i_face, this->n_faces());
   using cell_iterator = TriaIterator<CellAccessor<dim, spacedim>>;
 
-  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;
 }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.