From: Peter Munch Date: Fri, 19 Jun 2020 10:46:45 +0000 (+0200) Subject: Simplify CellAccessor::at_boundary() X-Git-Tag: v9.3.0-rc1~1415^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60cc2c2d3a8825ccbeb5daa6f7bd525f169a1e5f;p=dealii.git Simplify CellAccessor::at_boundary() --- 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; }