From: Martin Kronbichler Date: Mon, 3 May 2021 15:36:23 +0000 (+0200) Subject: Simplify some calls to make compiler inline function X-Git-Tag: v9.3.0-rc1~152^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12126%2Fhead;p=dealii.git Simplify some calls to make compiler inline function --- diff --git a/include/deal.II/grid/tria_objects.h b/include/deal.II/grid/tria_objects.h index 79622cda7a..414fc47899 100644 --- a/include/deal.II/grid/tria_objects.h +++ b/include/deal.II/grid/tria_objects.h @@ -374,18 +374,7 @@ namespace internal TriaObjects::n_objects() const { // assume that each cell has the same number of faces - - unsigned int faces_per_cell = 1; - - if (this->structdim == 1) - faces_per_cell = GeometryInfo<1>::faces_per_cell; - else if (this->structdim == 2) - faces_per_cell = GeometryInfo<2>::faces_per_cell; - else if (this->structdim == 3) - faces_per_cell = GeometryInfo<3>::faces_per_cell; - else - AssertThrow(false, ExcNotImplemented()); - + const unsigned int faces_per_cell = 2 * this->structdim; return cells.size() / faces_per_cell; } @@ -395,18 +384,7 @@ namespace internal TriaObjects::get_bounding_object_indices(const unsigned int index) { // assume that each cell has the same number of faces - - unsigned int faces_per_cell = 1; - - if (this->structdim == 1) - faces_per_cell = GeometryInfo<1>::faces_per_cell; - else if (this->structdim == 2) - faces_per_cell = GeometryInfo<2>::faces_per_cell; - else if (this->structdim == 3) - faces_per_cell = GeometryInfo<3>::faces_per_cell; - else - AssertThrow(false, ExcNotImplemented()); - + const unsigned int faces_per_cell = 2 * this->structdim; return ArrayView(cells.data() + index * faces_per_cell, faces_per_cell); }