From: wolf Date: Thu, 10 Dec 1998 16:24:39 +0000 (+0000) Subject: Initial things for the 3D support. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=065915bf051d6e7a930c1803115c014374628bcf;p=dealii-svn.git Initial things for the 3D support. git-svn-id: https://svn.dealii.org/trunk@691 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/grid/geometry_info.h b/deal.II/deal.II/include/grid/geometry_info.h index 5c42ee9560..e1cbdd25ff 100644 --- a/deal.II/deal.II/include/grid/geometry_info.h +++ b/deal.II/deal.II/include/grid/geometry_info.h @@ -14,7 +14,7 @@ template struct GeometryInfo; /** * Publish some information about geometrical interconnections to the - * outside world, for one spacial dimension in this case. These are, + * outside world, for one spatial dimension in this case. These are, * for example the numbers of children per cell, faces per cell, etc, * but also neighborship information, It is especially useful if you * want to loop over all faces in any space dimension, but don't want @@ -61,7 +61,7 @@ struct GeometryInfo<1> { /** * Publish some information about geometrical interconnections to the - * outside world, for two spacial dimensions in this case. These are, + * outside world, for two spatial dimensions in this case. These are, * for example the numbers of children per cell, faces per cell, etc, * but also neighborship information, It is especially useful if you * want to loop over all faces in any space dimension, but don't want @@ -152,6 +152,61 @@ struct GeometryInfo<2> { +/** + * Publish some information about geometrical interconnections to the + * outside world, for three spatial dimensions in this case. These are, + * for example the numbers of children per cell, faces per cell, etc, + * but also neighborship information, It is especially useful if you + * want to loop over all faces in any space dimension, but don't want + * to think about their number in a dimension independent expression. + * This not only reduces thinking effort but also error possibilities. + */ +template <> +struct GeometryInfo<3> { + public: + /** + * Present dimension + */ + static const unsigned int dim = 3; + + /** + * Number of children a cell has. + */ + static const unsigned int children_per_cell = (1< #include #include +#include #include @@ -173,6 +174,7 @@ class TriangulationLevel<0> { * this one. * * @memo Information belonging to one level of the multilevel hierarchy. + * @author Wolfgang Bangerth, 1998 */ template <> class TriangulationLevel<1> : public TriangulationLevel<0> { @@ -243,7 +245,7 @@ class TriangulationLevel<1> : public TriangulationLevel<0> { /** * Store boundary and material data. In * one dimension, this field stores - * the material id of a line, which is + * the material id of a line, which is a * number between 0 and 254. In more * than one dimension, lines have no * material id, but they may be at the @@ -321,6 +323,7 @@ class TriangulationLevel<1> : public TriangulationLevel<0> { * #TriangulationLevel<1>#. * * @memo Information belonging to one level of the multilevel hierarchy. + * @author Wolfgang Bangerth, 1998 */ template <> class TriangulationLevel<2> : public TriangulationLevel<1> @@ -361,7 +364,7 @@ class TriangulationLevel<2> : public TriangulationLevel<1> /** * Store boundary and material data. In * two dimension, this field stores - * the material id of a quad, which is + * the material id of a quad, which is a * number between 0 and 254. In more * than two dimensions, quads have no * material id, but they may be at the @@ -417,6 +420,114 @@ class TriangulationLevel<2> : public TriangulationLevel<1> +/** + * Store all information which belongs to one level of the multilevel hierarchy. + * + * In 3D this is a vector of the lines, one of quads and one of the + * hexaeders on this levels, as well as a the associated vectors holding + * information about the children of these lines, quads and hexs. + * + * The vectors of lines and quads and their children are derived from + * #TriangulationLevel<2>#. + * + * @memo Information belonging to one level of the multilevel hierarchy. + * @author Wolfgang Bangerth, 1998 + */ +template <> +class TriangulationLevel<3> : public TriangulationLevel<2> +{ + /** + * This subclass groups together all that + * is needed to describe the hexs on one + * level. + * + * It is fully analogous to the + * #LinesData# structure inherited from + * #Triangulation<1>#. + */ + struct HexesData { + /** + * Same as for the #lines# array. + */ + vector hexes; + /** + * Same as for the #LineData::chilren# + * array, but since there are four + * children, the index points to the + * first while the other three are + * following immediately afterwards. + */ + vector children; + + /** + * Same as for #LineData::used#. + */ + vector used; + + /** + * Same as for #LineData::used#. + */ + vector user_flags; + + /** + * Store boundary and material data. In + * two dimension, this field stores + * the material id of a hex, which is a + * number between 0 and 254. In more + * than three dimensions, hexes have no + * material id, but they may be at the + * boundary; then, we store the + * boundary indicator in this field, + * which denotes to which part of the + * boundary this line belongs and which + * boundary conditions hold on this + * part. The boundary indicator also + * is a number between zero and 254; + * the id 255 is reserved for hexes + * in the interior and may be used + * to check whether a hex is at the + * boundary or not, which otherwise + * is not possible if you don't know + * which cell it belongs to. + */ + vector material_id; + + + /** + * Pointer which is not used by the + * library but may be accessed an set + * by the user to handle data local to + * a line/quad/etc. + */ + vector user_pointers; + }; + + public: + /** + * Data about the hexes. + */ + HexesData hexes; + + /** + * Assert that enough space is allocated + * to accomodate #new_quads# new quads. + */ + void reserve_space (const unsigned int new_quads); + + /** + * Check the memory consistency of the + * different containers. Should only be + * called with the prepro flag #DEBUG# + * set. The function should be called from + * the functions of the higher + * #TriangulationLevel# classes. + */ + void monitor_memory (const unsigned int true_dimension) const; +}; + + + + /*---------------------------- tria_levels.h ---------------------------*/ /* end of #ifndef __tria_levels_H */ #endif