From 60cc2c2d3a8825ccbeb5daa6f7bd525f169a1e5f Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Fri, 19 Jun 2020 12:46:45 +0200 Subject: [PATCH] Simplify CellAccessor::at_boundary() --- source/grid/tria_accessor.cc | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/source/grid/tria_accessor.cc b/source/grid/tria_accessor.cc index 51a0971543..4a48e71df8 100644 --- a/source/grid/tria_accessor.cc +++ b/source/grid/tria_accessor.cc @@ -2023,20 +2023,11 @@ template bool CellAccessor::at_boundary() const { - switch (dim) - { - case 1: - return at_boundary(0) || at_boundary(1); - case 2: - return (at_boundary(0) || at_boundary(1) || at_boundary(2) || - at_boundary(3)); - case 3: - return (at_boundary(0) || at_boundary(1) || at_boundary(2) || - at_boundary(3) || at_boundary(4) || at_boundary(5)); - default: - Assert(false, ExcNotImplemented()); - return false; - } + for (const auto face : GeometryInfo::face_indices()) + if (at_boundary(face)) + return true; + + return false; } -- 2.39.5