From dcea655bbf27b1c354ce34810df8d229b5231f80 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Mon, 3 May 2021 17:36:23 +0200 Subject: [PATCH] Simplify some calls to make compiler inline function --- include/deal.II/grid/tria_objects.h | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) 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); } -- 2.39.5