]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move a structure from one file to another where it seemed more appropriate.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 31 Aug 1998 15:41:21 +0000 (15:41 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 31 Aug 1998 15:41:21 +0000 (15:41 +0000)
git-svn-id: https://svn.dealii.org/trunk@538 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/tria.h
deal.II/deal.II/include/numerics/data_io.h
deal.II/deal.II/source/dofs/mg_dof_handler.cc
deal.II/deal.II/source/grid/tria.cc
deal.II/deal.II/source/multigrid/mg_dof_handler.cc
deal.II/deal.II/source/numerics/data_io.cc

index 1f3b0a32e201c880af17578635609fbccf20bbb9..914ed035beaded3cf8dac14ab6a39782648a5eca 100644 (file)
@@ -68,6 +68,81 @@ enum MeshSmoothing {
 
 
 
+/*------------------------------------------------------------------------*/
+
+
+/**
+ *  Structure which is passed to the #Triangulation<dim>::create_triangulation#
+ *  function. It contains all data needed to construct a cell, namely the
+ *  indices of the vertices and the material indicator.
+ */
+template <int dim>
+struct CellData {
+    int           vertices[GeometryInfo<dim>::vertices_per_cell];
+    unsigned char material_id;
+};
+
+
+
+
+
+/**
+ *  Structure to be passed to the #Triangulation<dim>::create_triangulation#
+ *  function to describe boundary information.
+ *
+ *  This structure is the same for all dimensions, since we use an input
+ *  function which is the same for all dimensions. The content of objects
+ *  of this structure varies with the dimensions, however.
+ *
+ *  Since in one space dimension, there is no boundary information apart
+ *  from the two end points of the interval, this structure does not contain
+ *  anything and exists only for consistency, to allow a common interface
+ *  for all space dimensions. All fields should always be empty.
+ *
+ *  Boundary data in 2D consists
+ *  of a list of lines which belong to a given boundary component. A
+ *  boundary component is a list of lines which are given a common
+ *  number describing the boundary condition to hold on this part of the
+ *  boundary. The triangulation creation function gives lines not in this
+ *  list either the boundary indicator zero (if on the boundary) or 255
+ *  (if in the interior). Explicitely giving a line the indicator 255
+ *  will result in an error, as well as giving an interior line a boundary
+ *  indicator.
+ */
+struct SubCellData {
+                                    /**
+                                     * Each record of this vector describes
+                                     * a line on the boundary and its boundary
+                                     * indicator.
+                                     */
+    vector<CellData<1> > boundary_lines;
+
+                                    /**
+                                     * Each record of this vector describes
+                                     * a quad on the boundary and its boundary
+                                     * indicator.
+                                     */
+    vector<CellData<2> > boundary_quads;
+
+                                    /**
+                                     * This function checks whether the vectors
+                                     * which may not be used in a given
+                                     * dimension are really empty. I.e.,
+                                     * whether the #boundary_*# arrays are
+                                     * empty when in one space dimension
+                                     * and whether the #boundary_quads#
+                                     * array is empty when in two dimensions.
+                                     *
+                                     * Since this structure is the same for all
+                                     * dimensions, the actual dimension has
+                                     * to be given as a parameter.
+                                     */
+    bool check_consistency (const unsigned int dim) const;
+};
+
+
+
+
 /*------------------------------------------------------------------------*/
 
 
index 8f67c26f7d72c320a1141bc18cf3eb2c8e4db223..290eaf961b173cf5673adb3391c35e279e9c9889 100644 (file)
@@ -19,80 +19,6 @@ class dVector;
 
 
 
-
-/**
- *  Structure which is passed to the #Triangulation<dim>::create_triangulation#
- *  function. It contains all data needed to construct a cell, namely the
- *  indices of the vertices and the material indicator.
- */
-template <int dim>
-struct CellData {
-    int           vertices[GeometryInfo<dim>::vertices_per_cell];
-    unsigned char material_id;
-};
-
-
-
-
-
-/**
- *  Structure to be passed to the #Triangulation<dim>::create_triangulation#
- *  function to describe boundary information.
- *
- *  This structure is the same for all dimensions, since we use an input
- *  function which is the same for all dimensions. The content of objects
- *  of this structure varies with the dimensions, however.
- *
- *  Since in one space dimension, there is no boundary information apart
- *  from the two end points of the interval, this structure does not contain
- *  anything and exists only for consistency, to allow a common interface
- *  for all space dimensions. All fields should always be empty.
- *
- *  Boundary data in 2D consists
- *  of a list of lines which belong to a given boundary component. A
- *  boundary component is a list of lines which are given a common
- *  number describing the boundary condition to hold on this part of the
- *  boundary. The triangulation creation function gives lines not in this
- *  list either the boundary indicator zero (if on the boundary) or 255
- *  (if in the interior). Explicitely giving a line the indicator 255
- *  will result in an error, as well as giving an interior line a boundary
- *  indicator.
- */
-struct SubCellData {
-                                    /**
-                                     * Each record of this vector describes
-                                     * a line on the boundary and its boundary
-                                     * indicator.
-                                     */
-    vector<CellData<1> > boundary_lines;
-
-                                    /**
-                                     * Each record of this vector describes
-                                     * a quad on the boundary and its boundary
-                                     * indicator.
-                                     */
-    vector<CellData<2> > boundary_quads;
-
-                                    /**
-                                     * This function checks whether the vectors
-                                     * which may not be used in a given
-                                     * dimension are really empty. I.e.,
-                                     * whether the #boundary_*# arrays are
-                                     * empty when in one space dimension
-                                     * and whether the #boundary_quads#
-                                     * array is empty when in two dimensions.
-                                     *
-                                     * Since this structure is the same for all
-                                     * dimensions, the actual dimension has
-                                     * to be given as a parameter.
-                                     */
-    bool check_consistency (const unsigned int dim) const;
-};
-
-
-    
-
-
 /**
  * This class implements an input mechanism for grid data. It allows to
  * read a grid structure into a triangulation object. Future versions
index 09b915a874fa0a63798aa6ded077c0212f6a3428..6466c1ed4277f4308d6c1838b8e5f79855e90d28 100644 (file)
@@ -128,6 +128,7 @@ MGDoFHandler<1>::end () const {
 
 
 
+
 template <>
 MGDoFHandler<1>::raw_cell_iterator
 MGDoFHandler<1>::last_raw () const {
@@ -357,6 +358,7 @@ MGDoFHandler<1>::last_active_quad () const {
 #endif
 
 
+
 #if deal_II_dimension == 2
 
 template <>
@@ -521,6 +523,7 @@ MGDoFHandler<2>::last_active_face (const unsigned int level) const {
 
 
 
+
 template <int dim>
 typename MGDoFHandler<dim>::raw_line_iterator
 MGDoFHandler<dim>::begin_raw_line (const unsigned int level) const {
@@ -714,6 +717,7 @@ MGDoFHandler<dim>::end_quad (const unsigned int level) const {
 
 
 
+
 template <int dim>
 typename MGDoFDimensionInfo<dim>::active_quad_iterator
 MGDoFHandler<dim>::end_active_quad (const unsigned int level) const {
@@ -852,6 +856,7 @@ MGDoFHandler<dim>::last_active_quad () const {
 
 
 
+
 template <int dim>
 void MGDoFHandler<dim>::distribute_dofs (const FiniteElementBase<dim> &fe) {
                                   // first distribute global dofs
@@ -1205,6 +1210,7 @@ void MGDoFHandler<dim>::renumber_dofs (const unsigned int      level,
 
 
 
+
 #if deal_II_dimension == 1
 
 template <>
@@ -1240,6 +1246,8 @@ void MGDoFHandler<1>::do_renumbering (const unsigned int level,
 #endif
 
 
+
+
 #if deal_II_dimension == 2
 
 template <>
@@ -1361,6 +1369,7 @@ void MGDoFHandler<1>::reserve_space () {
 #endif
 
 
+
 #if deal_II_dimension == 2
 
 template <>
@@ -1385,8 +1394,8 @@ void MGDoFHandler<2>::reserve_space () {
                                   // this calls the destructor which
                                   // must free the space
   mg_vertex_dofs.resize (0);
-
-
+  
+  
                                   ////////////////////////////
                                   // CONSTRUCTION
   
@@ -1404,6 +1413,7 @@ void MGDoFHandler<2>::reserve_space () {
                                                 -1);
     };
 
+  
                                   // now allocate space for the
                                   // vertices. To this end, we need
                                   // to construct as many objects as
@@ -1418,8 +1428,14 @@ void MGDoFHandler<2>::reserve_space () {
                                   // vertex we pass by  belongs to
   mg_vertex_dofs.resize (tria->vertices.size());
 
-  vector<unsigned int> min_level (tria->vertices.size(), tria->n_levels());
-  vector<unsigned int> max_level (tria->vertices.size(), 0);
+                                  // here again, gcc2.8 fails to
+                                  // construct the vector properly
+                                  // using parameters to the constructor
+//  vector<unsigned int> min_level (tria->vertices.size(), tria->n_levels());
+//  vector<unsigned int> max_level (tria->vertices.size(), 0);
+  vector<unsigned int> min_level, max_level;
+  min_level.resize (tria->vertices.size(), tria->n_levels());
+  max_level.resize (tria->vertices.size(), 0);
 
   Triangulation<dim>::cell_iterator cell = tria->begin(),
                                    endc = tria->end();
@@ -1434,6 +1450,7 @@ void MGDoFHandler<2>::reserve_space () {
          max_level[vertex_index] = cell->level();
       };
 
+  
                                   // now allocate the needed space
   for (unsigned int vertex=0; vertex<tria->vertices.size(); ++vertex)
     {
index e79388680d4984894af3f53739a01a03ed0aff0d..2f927842ebe664b6ebf103277f2e40aa7c5ca64c 100644 (file)
 #include <cmath>
 
 
+
+bool SubCellData::check_consistency (const unsigned int dim) const {
+  switch (dim) 
+    {
+      case 1:
+           return ((boundary_lines.size() == 0) &&
+                   (boundary_quads.size() == 0));
+      case 2:
+           return (boundary_quads.size() == 0);
+    };
+  return true;
+};
+
+                   
+
+
+
+
+
 template <int dim>
 Triangulation<dim>::Triangulation (const MeshSmoothing smooth_grid) :
                smooth_grid(smooth_grid)
index 09b915a874fa0a63798aa6ded077c0212f6a3428..6466c1ed4277f4308d6c1838b8e5f79855e90d28 100644 (file)
@@ -128,6 +128,7 @@ MGDoFHandler<1>::end () const {
 
 
 
+
 template <>
 MGDoFHandler<1>::raw_cell_iterator
 MGDoFHandler<1>::last_raw () const {
@@ -357,6 +358,7 @@ MGDoFHandler<1>::last_active_quad () const {
 #endif
 
 
+
 #if deal_II_dimension == 2
 
 template <>
@@ -521,6 +523,7 @@ MGDoFHandler<2>::last_active_face (const unsigned int level) const {
 
 
 
+
 template <int dim>
 typename MGDoFHandler<dim>::raw_line_iterator
 MGDoFHandler<dim>::begin_raw_line (const unsigned int level) const {
@@ -714,6 +717,7 @@ MGDoFHandler<dim>::end_quad (const unsigned int level) const {
 
 
 
+
 template <int dim>
 typename MGDoFDimensionInfo<dim>::active_quad_iterator
 MGDoFHandler<dim>::end_active_quad (const unsigned int level) const {
@@ -852,6 +856,7 @@ MGDoFHandler<dim>::last_active_quad () const {
 
 
 
+
 template <int dim>
 void MGDoFHandler<dim>::distribute_dofs (const FiniteElementBase<dim> &fe) {
                                   // first distribute global dofs
@@ -1205,6 +1210,7 @@ void MGDoFHandler<dim>::renumber_dofs (const unsigned int      level,
 
 
 
+
 #if deal_II_dimension == 1
 
 template <>
@@ -1240,6 +1246,8 @@ void MGDoFHandler<1>::do_renumbering (const unsigned int level,
 #endif
 
 
+
+
 #if deal_II_dimension == 2
 
 template <>
@@ -1361,6 +1369,7 @@ void MGDoFHandler<1>::reserve_space () {
 #endif
 
 
+
 #if deal_II_dimension == 2
 
 template <>
@@ -1385,8 +1394,8 @@ void MGDoFHandler<2>::reserve_space () {
                                   // this calls the destructor which
                                   // must free the space
   mg_vertex_dofs.resize (0);
-
-
+  
+  
                                   ////////////////////////////
                                   // CONSTRUCTION
   
@@ -1404,6 +1413,7 @@ void MGDoFHandler<2>::reserve_space () {
                                                 -1);
     };
 
+  
                                   // now allocate space for the
                                   // vertices. To this end, we need
                                   // to construct as many objects as
@@ -1418,8 +1428,14 @@ void MGDoFHandler<2>::reserve_space () {
                                   // vertex we pass by  belongs to
   mg_vertex_dofs.resize (tria->vertices.size());
 
-  vector<unsigned int> min_level (tria->vertices.size(), tria->n_levels());
-  vector<unsigned int> max_level (tria->vertices.size(), 0);
+                                  // here again, gcc2.8 fails to
+                                  // construct the vector properly
+                                  // using parameters to the constructor
+//  vector<unsigned int> min_level (tria->vertices.size(), tria->n_levels());
+//  vector<unsigned int> max_level (tria->vertices.size(), 0);
+  vector<unsigned int> min_level, max_level;
+  min_level.resize (tria->vertices.size(), tria->n_levels());
+  max_level.resize (tria->vertices.size(), 0);
 
   Triangulation<dim>::cell_iterator cell = tria->begin(),
                                    endc = tria->end();
@@ -1434,6 +1450,7 @@ void MGDoFHandler<2>::reserve_space () {
          max_level[vertex_index] = cell->level();
       };
 
+  
                                   // now allocate the needed space
   for (unsigned int vertex=0; vertex<tria->vertices.size(); ++vertex)
     {
index cc82893c6fda78bb4e0333c33950e653269cea85..d81cb748134fa3d160087c413c97ed7e0910fab2 100644 (file)
 
 
 
-bool SubCellData::check_consistency (const unsigned int dim) const {
-  switch (dim) 
-    {
-      case 1:
-           return ((boundary_lines.size() == 0) &&
-                   (boundary_quads.size() == 0));
-      case 2:
-           return (boundary_quads.size() == 0);
-    };
-  return true;
-};
-
-                   
-
-
 
 template <int dim>
 DataIn<dim>::DataIn () :

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.