From 2493b0611886a48a2e09e7993b8bb0747377ed09 Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 7 Jul 2005 14:43:00 +0000 Subject: [PATCH] Re-write the initializers of a few data elements recursively, rather than using ?: for a fixed number of dimensions. git-svn-id: https://svn.dealii.org/trunk@11095 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/grid/geometry_info.h | 33 +++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/deal.II/deal.II/include/grid/geometry_info.h b/deal.II/deal.II/include/grid/geometry_info.h index 93101156cb..9378e244c6 100644 --- a/deal.II/deal.II/include/grid/geometry_info.h +++ b/deal.II/deal.II/include/grid/geometry_info.h @@ -228,29 +228,52 @@ struct GeometryInfo /** * Number of lines on each face. */ - static const unsigned int lines_per_face = GeometryInfo::lines_per_cell; + static const unsigned int lines_per_face + = GeometryInfo::lines_per_cell; /** * Number of quads on each face. */ - static const unsigned int quads_per_face = (dim == 3) ? 1 : 0; + static const unsigned int quads_per_face + = GeometryInfo::quads_per_cell; /** * Number of lines of a cell. + * + * The formula to compute this makes use + * of the fact that when going from one + * dimension to the next, the object of + * the lower dimension is copied once + * (thus twice the old number of lines) + * and then a new line is inserted + * between each vertex of the old object + * and the corresponding one in the copy. */ - static const unsigned int lines_per_cell = (dim == 3) ? 12 : ((dim == 2) ? 4 : 1); + static const unsigned int lines_per_cell + = (2*GeometryInfo::lines_per_cell + + GeometryInfo::vertices_per_cell); /** * Number of quadrilaterals of a * cell. + * + * This number is computed recursively + * just as the previous one, with the + * exception that new quads result from + * connecting an original line and its + * copy. */ - static const unsigned int quads_per_cell = (dim == 3) ? 6 : ((dim == 2) ? 1 : 0); + static const unsigned int quads_per_cell + = (2*GeometryInfo::quads_per_cell + + GeometryInfo::lines_per_cell); /** * Number of hexahedra of a * cell. */ - static const unsigned int hexes_per_cell = (dim == 3) ? 1 : 0; + static const unsigned int hexes_per_cell + = (2*GeometryInfo::hexes_per_cell + + GeometryInfo::quads_per_cell); /** * List of numbers which -- 2.39.5