From 81a488f18b82a05b967f3e415e7eae21db9b37c2 Mon Sep 17 00:00:00 2001 From: wolf Date: Wed, 23 May 2001 08:15:25 +0000 Subject: [PATCH] Revert to the old style scheme of explicitely specializing GeometryInfo for all dimensions. git-svn-id: https://svn.dealii.org/trunk@4710 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/grid/geometry_info.h | 87 ++++++++++++-------- deal.II/deal.II/source/grid/geometry_info.cc | 79 ++++++++++++++++-- 2 files changed, 123 insertions(+), 43 deletions(-) diff --git a/deal.II/deal.II/include/grid/geometry_info.h b/deal.II/deal.II/include/grid/geometry_info.h index 3c53ed37ab..dd4a99b61f 100644 --- a/deal.II/deal.II/include/grid/geometry_info.h +++ b/deal.II/deal.II/include/grid/geometry_info.h @@ -194,50 +194,69 @@ struct GeometryInfo<0> -/* -------------- declaration of explicit specializations ------------- */ - +//TODO:[WB] Document new classes, and reference in old one. +template <> +struct GeometryInfo<1> +{ + static const unsigned int dim = 1; + static const unsigned int children_per_cell = 2; + static const unsigned int faces_per_cell = 2; + static const unsigned int subfaces_per_face = 0; + static const unsigned int vertices_per_cell = 2; + static const unsigned int vertices_per_face = 1; + static const unsigned int lines_per_face = 0; + static const unsigned int quads_per_face = 0; + static const unsigned int lines_per_cell = 1; + static const unsigned int quads_per_cell = 0; + static const unsigned int hexes_per_cell = 0; + static const unsigned int opposite_face[faces_per_cell]; + static unsigned int child_cell_on_face (const unsigned int face, + const unsigned int subface); +}; -template <> const unsigned int GeometryInfo<1>::opposite_face[GeometryInfo<1>::faces_per_cell]; -template <> const unsigned int GeometryInfo<2>::opposite_face[GeometryInfo<2>::faces_per_cell]; -template <> const unsigned int GeometryInfo<3>::opposite_face[GeometryInfo<3>::faces_per_cell]; +template <> +struct GeometryInfo<2> +{ + static const unsigned int dim = 2; + static const unsigned int children_per_cell = 4; + static const unsigned int faces_per_cell = 4; + static const unsigned int subfaces_per_face = 2; + static const unsigned int vertices_per_cell = 4; + static const unsigned int vertices_per_face = 2; + static const unsigned int lines_per_face = 1; + static const unsigned int quads_per_face = 0; + static const unsigned int lines_per_cell = 4; + static const unsigned int quads_per_cell = 1; + static const unsigned int hexes_per_cell = 0; + static const unsigned int opposite_face[faces_per_cell]; + static unsigned int child_cell_on_face (const unsigned int face, + const unsigned int subface); +}; -/*---------------------------- Inline functions --------------------------------*/ -template<> -inline unsigned int -GeometryInfo<2>::child_cell_on_face (const unsigned int face, - const unsigned int subface) +template <> +struct GeometryInfo<3> { - Assert (face -inline -unsigned int GeometryInfo<3>::child_cell_on_face (const unsigned int face, - const unsigned int subface) -{ - Assert (face -template const unsigned int GeometryInfo::vertices_per_cell; -template const unsigned int GeometryInfo::lines_per_cell; -template const unsigned int GeometryInfo::quads_per_cell; -template const unsigned int GeometryInfo::hexes_per_cell; -template const unsigned int GeometryInfo::children_per_cell; +const unsigned int GeometryInfo<1>::dim; +const unsigned int GeometryInfo<1>::children_per_cell; +const unsigned int GeometryInfo<1>::faces_per_cell; +const unsigned int GeometryInfo<1>::subfaces_per_face; +const unsigned int GeometryInfo<1>::vertices_per_cell; +const unsigned int GeometryInfo<1>::vertices_per_face; +const unsigned int GeometryInfo<1>::lines_per_face; +const unsigned int GeometryInfo<1>::quads_per_face; +const unsigned int GeometryInfo<1>::lines_per_cell; +const unsigned int GeometryInfo<1>::quads_per_cell; +const unsigned int GeometryInfo<1>::hexes_per_cell; + +const unsigned int GeometryInfo<2>::dim; +const unsigned int GeometryInfo<2>::children_per_cell; +const unsigned int GeometryInfo<2>::faces_per_cell; +const unsigned int GeometryInfo<2>::subfaces_per_face; +const unsigned int GeometryInfo<2>::vertices_per_cell; +const unsigned int GeometryInfo<2>::vertices_per_face; +const unsigned int GeometryInfo<2>::lines_per_face; +const unsigned int GeometryInfo<2>::quads_per_face; +const unsigned int GeometryInfo<2>::lines_per_cell; +const unsigned int GeometryInfo<2>::quads_per_cell; +const unsigned int GeometryInfo<2>::hexes_per_cell; + +const unsigned int GeometryInfo<3>::dim; +const unsigned int GeometryInfo<3>::children_per_cell; +const unsigned int GeometryInfo<3>::faces_per_cell; +const unsigned int GeometryInfo<3>::subfaces_per_face; +const unsigned int GeometryInfo<3>::vertices_per_cell; +const unsigned int GeometryInfo<3>::vertices_per_face; +const unsigned int GeometryInfo<3>::lines_per_face; +const unsigned int GeometryInfo<3>::quads_per_face; +const unsigned int GeometryInfo<3>::lines_per_cell; +const unsigned int GeometryInfo<3>::quads_per_cell; +const unsigned int GeometryInfo<3>::hexes_per_cell; + -template <> const unsigned int GeometryInfo<1>::opposite_face[GeometryInfo<1>::faces_per_cell] = { 0, 1 }; -template <> const unsigned int GeometryInfo<2>::opposite_face[GeometryInfo<2>::faces_per_cell] = { 2, 3, 0, 1 }; -template <> const unsigned int GeometryInfo<3>::opposite_face[GeometryInfo<3>::faces_per_cell] = { 1, 0, 4, 5, 2, 3 }; -template class GeometryInfo; + + +unsigned int +GeometryInfo<2>::child_cell_on_face (const unsigned int face, + const unsigned int subface) +{ + Assert (face::child_cell_on_face (const unsigned int face, + const unsigned int subface) +{ + Assert (face