From 457673a0b5fc0fda756c739651bf60c66c0ca6a2 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 24 May 2001 08:25:22 +0000 Subject: [PATCH] Document and remove old classes. git-svn-id: https://svn.dealii.org/trunk@4724 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/grid/geometry_info.h | 502 ++++++++++++++++--- 1 file changed, 434 insertions(+), 68 deletions(-) diff --git a/deal.II/deal.II/include/grid/geometry_info.h b/deal.II/deal.II/include/grid/geometry_info.h index dd4a99b61f..6873b9241a 100644 --- a/deal.II/deal.II/include/grid/geometry_info.h +++ b/deal.II/deal.II/include/grid/geometry_info.h @@ -14,8 +14,24 @@ + /** - * Topological description of cells. + * Topological description of cells. This general template is not + * used, rather explicit specializations are provided for all + * dimensions for which this class might be of use. The fields + * provided by each of these specializations are identical, so that + * access to them in a dimension independent way is possible. + * + * @author Wolfgang Bangerth, 1998 + */ +template +struct GeometryInfo +{}; + + + +/** + * Topological description of one dimensional cells. * * This class contains as static members information on vertices and * faces of a @p{dim}-dimensional grid cell. The interface is the same @@ -25,39 +41,39 @@ * * This information should always replace hard-coded numbers of * vertices, neighbors and so on, since it can be used dimension - * independent. + * independently. * - * @author Wolfgang Bangerth, Guido Kanschat, 1998, 1999 + * @author Wolfgang Bangerth, 1998 */ -template -struct GeometryInfo +template <> +struct GeometryInfo<1> { /** * Present dimension. Does not * look useful, but might be. */ - static const unsigned int dim = dim_; + static const unsigned int dim = 1; /** * Number of children a cell has. */ - static const unsigned int children_per_cell = (1<::children_per_cell; + static const unsigned int subfaces_per_face = 0; /** * Number of vertices a cell has. */ - static const unsigned int vertices_per_cell = (1<::vertices_per_cell; + static const unsigned int vertices_per_face = 1; /** * Number of lines each face has. */ - static const unsigned int lines_per_face = GeometryInfo::lines_per_cell; + static const unsigned int lines_per_face = 0; /** * Number of quads on each face. */ - static const unsigned int quads_per_face = GeometryInfo::quads_per_cell; + static const unsigned int quads_per_face = 0; /** * Number of lines of a cell. - * - * Computation of this value - * follows the idea, that - * building a hypercube of - * dimension @p{dim} from one of - * dimension @p{dim}-1 can be done - * in the following two steps: - * - * 1. Duplicated it in the new coordinate direction. - * - * 2. Connect all corresponding - * vertices of the original - * hypercube and the copy by - * lines. */ - static const unsigned int lines_per_cell = (2*GeometryInfo::lines_per_cell - + GeometryInfo::vertices_per_cell); - + static const unsigned int lines_per_cell = 1; + /** - * Number of quadrilaterals of a cell. - * - * Computation is analogous to @p{lines_per_cell}. + * Number of quadrilaterals of a + * cell. */ - static const unsigned int quads_per_cell = (2*GeometryInfo::quads_per_cell - + GeometryInfo::lines_per_cell); + static const unsigned int quads_per_cell = 0; /** - * Number of hexahedra of a cell. - * - * Computation is analogous to - * @p{lines_per_cell}. Very - * important for more than three - * dimensions! + * Number of hexahedra of a + * cell. */ - static const unsigned int hexes_per_cell = (2*GeometryInfo::hexes_per_cell - + GeometryInfo::quads_per_cell); + static const unsigned int hexes_per_cell = 0; /** * List of numbers which is @@ -175,88 +169,460 @@ struct GeometryInfo /** - * Pseudo-class for recursive functions in - * @ref{GeometryInfo<1>}. Actually this class is a starting point for - * the induction ladder by which the higher @p{GeometryInfo} classes - * are built. + * Topological description of zero dimensional cells, + * i.e. points. This class might not look too useful but often is if + * in a certain dimension we would like to enquire information about + * objects with dimension one lower than the present, e.g. about + * faces. + * + * This class contains as static members information on vertices and + * faces of a @p{dim}-dimensional grid cell. The interface is the same + * for all dimensions. If a value is of no use in a low dimensional + * cell, it is (correctly) set to zero, e.g. @p{subfaces_per_cell} in + * 1d. + * + * This information should always replace hard-coded numbers of + * vertices, neighbors and so on, since it can be used dimension + * independently. * - * @author Wolfgang Bangerth, Guido Kanschat, 1998, 1999 + * @author Wolfgang Bangerth, 1998 */ template <> -struct GeometryInfo<0> +struct GeometryInfo<0> { - static const unsigned int vertices_per_cell = 1; - static const unsigned int lines_per_cell = 0; - static const unsigned int quads_per_cell = 0; - static const unsigned int hexes_per_cell = 0; - static const unsigned int children_per_cell = 0; -}; + /** + * Present dimension. Does not + * look useful, but might be. + */ + static const unsigned int dim = 0; + /** + * Number of children a cell has. + */ + static const unsigned int children_per_cell = 1; + /** + * Number of faces a cell has. + */ + static const unsigned int faces_per_cell = 0; -//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; + /** + * Number of children each face has + * when the adjacent cell is refined. + */ static const unsigned int subfaces_per_face = 0; - static const unsigned int vertices_per_cell = 2; - static const unsigned int vertices_per_face = 1; + + /** + * Number of vertices a cell has. + */ + static const unsigned int vertices_per_cell = 1; + + /** + * Number of vertices each face has. + * Since this is not useful in one + * dimension, we provide a useless + * number (in the hope that a compiler + * may warn when it sees constructs like + * @p{for (i=0; i struct GeometryInfo<2> { + /** + * Present dimension. Does not + * look useful, but might be. + */ static const unsigned int dim = 2; + + /** + * Number of children a cell has. + */ static const unsigned int children_per_cell = 4; + + /** + * Number of faces a cell has. + */ static const unsigned int faces_per_cell = 4; + + /** + * Number of children each face has + * when the adjacent cell is refined. + */ static const unsigned int subfaces_per_face = 2; + + /** + * Number of vertices a cell has. + */ static const unsigned int vertices_per_cell = 4; + + /** + * Number of vertices each face has. + * Since this is not useful in one + * dimension, we provide a useless + * number (in the hope that a compiler + * may warn when it sees constructs like + * @p{for (i=0; i--2 + * . | | + * . 3 ^ ^ 1 + * . | | + * . 0-->--1 + * . 0 + * @end{verbatim} + * Vertices and faces are indicated + * with their numbers, faces also with + * their directions. + * + * Now, when refined, the layout is + * like this: + * @begin{verbatim} + * *--*--* + * | 3|2 | + * *--*--* + * | 0|1 | + * *--*--* + * @end{verbatim} + * + * Thus, the child cells on face zero + * are (ordered in the direction of the + * face) 0 and 1, on face 2 they are + * 3 and 2, etc. + * + * For three spatial dimensions, + * the exact order of the children is + * laid down in the documentation of + * the @ref{Triangulation} class. + */ static unsigned int child_cell_on_face (const unsigned int face, const unsigned int subface); }; +/** + * Topological description of three dimensional cells. + * + * This class contains as static members information on vertices and + * faces of a @p{dim}-dimensional grid cell. The interface is the same + * for all dimensions. If a value is of no use in a low dimensional + * cell, it is (correctly) set to zero, e.g. @p{subfaces_per_cell} in + * 1d. + * + * This information should always replace hard-coded numbers of + * vertices, neighbors and so on, since it can be used dimension + * independently. + * + * @author Wolfgang Bangerth, 1998 + */ template <> struct GeometryInfo<3> { + /** + * Present dimension. Does not + * look useful, but might be. + */ static const unsigned int dim = 3; + + /** + * Number of children a cell has. + */ static const unsigned int children_per_cell = 8; + + /** + * Number of faces a cell has. + */ static const unsigned int faces_per_cell = 6; + + /** + * Number of children each face has + * when the adjacent cell is refined. + */ static const unsigned int subfaces_per_face = 4; + + /** + * Number of vertices a cell has. + */ static const unsigned int vertices_per_cell = 8; + + /** + * Number of vertices each face has. + * Since this is not useful in one + * dimension, we provide a useless + * number (in the hope that a compiler + * may warn when it sees constructs like + * @p{for (i=0; i--2 + * . | | + * . 3 ^ ^ 1 + * . | | + * . 0-->--1 + * . 0 + * @end{verbatim} + * Vertices and faces are indicated + * with their numbers, faces also with + * their directions. + * + * Now, when refined, the layout is + * like this: + * @begin{verbatim} + * *--*--* + * | 3|2 | + * *--*--* + * | 0|1 | + * *--*--* + * @end{verbatim} + * + * Thus, the child cells on face zero + * are (ordered in the direction of the + * face) 0 and 1, on face 2 they are + * 3 and 2, etc. + * + * For three spatial dimensions, + * the exact order of the children is + * laid down in the documentation of + * the @ref{Triangulation} class. + */ static unsigned int child_cell_on_face (const unsigned int face, const unsigned int subface); }; +/** + * Topological description of four dimensional cells. This class is + * required in some exotic cases where we compute information in a + * one-larger dimension than the present, and do so also in 3d (for + * example, stacking the solutions of a d-dimensional time dependent + * equation timestep after timestep in a (d+1)-dimensional space). + * + * This class contains as static members information on vertices and + * faces of a @p{dim}-dimensional grid cell. The interface is the same + * for all dimensions. If a value is of no use in a low dimensional + * cell, it is (correctly) set to zero, e.g. @p{subfaces_per_cell} in + * 1d. + * + * This information should always replace hard-coded numbers of + * vertices, neighbors and so on, since it can be used dimension + * independently. + * + * @author Wolfgang Bangerth, 1998 + */ +template <> +struct GeometryInfo<4> +{ + /** + * Present dimension. Does not + * look useful, but might be. + */ + static const unsigned int dim = 4; + + /** + * Number of children a cell has. + */ + static const unsigned int children_per_cell = 16; + + /** + * Number of faces a cell has. + */ + static const unsigned int faces_per_cell = 8; + + /** + * Number of children each face has + * when the adjacent cell is refined. + */ + static const unsigned int subfaces_per_face = 8; + + /** + * Number of vertices a cell has. + */ + static const unsigned int vertices_per_cell = 16; + + /** + * Number of vertices each face has. + * Since this is not useful in one + * dimension, we provide a useless + * number (in the hope that a compiler + * may warn when it sees constructs like + * @p{for (i=0; i