]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Change execute_{coarsening,refinement} to only one function.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 4 Mar 1999 15:32:24 +0000 (15:32 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 4 Mar 1999 15:32:24 +0000 (15:32 +0000)
git-svn-id: https://svn.dealii.org/trunk@947 0785d39b-7218-0410-832d-ea1e28bc413d

12 files changed:
deal.II/deal.II/Attic/examples/convergence/convergence.cc
deal.II/deal.II/Attic/examples/dof/dof_test.cc
deal.II/deal.II/Attic/examples/grid/grid_test.cc
deal.II/deal.II/Attic/examples/multigrid/multigrid.cc
deal.II/deal.II/Attic/examples/poisson/problem.cc
deal.II/deal.II/include/grid/tria.h
deal.II/deal.II/source/grid/tria.cc
tests/big-tests/convergence/convergence.cc
tests/big-tests/dof/dof_test.cc
tests/big-tests/grid/grid_test.cc
tests/big-tests/multigrid/multigrid.cc
tests/big-tests/poisson/problem.cc

index 2584e4fe4614490e6f4f55f2a29c00ba53a2609d..ea600558835c138c44f87a18e3562fa2def88145 100644 (file)
@@ -271,7 +271,7 @@ int PoissonProblem<dim>::run (const unsigned int level) {
   tria->set_boundary (&boundary_description);
   tria->begin_active()->set_refine_flag();
   (++(++(tria->begin_active())))->set_refine_flag();
-  tria->execute_refinement ();
+  tria->execute_coarsening_and_refinement ();
   tria->refine_global (level);
   cout << tria->n_active_cells() << " active cells." << endl;
 
index 9144ac0f1165559f1a086d49ede8487e48700c00..1c6768560139eaac65965c1c73354604496847da 100644 (file)
@@ -249,11 +249,11 @@ void TestCases<dim>::run (ParameterHandler &prm) {
       {
                                         // refine first cell
        tria->begin_active()->set_refine_flag();
-       tria->execute_refinement ();
+       tria->execute_coarsening_and_refinement ();
                                         // refine first active cell
                                         // on coarsest level
        tria->begin_active()->set_refine_flag ();
-       tria->execute_refinement ();
+       tria->execute_coarsening_and_refinement ();
 
        Triangulation<dim>::active_cell_iterator cell;
        for (int i=0; i<17; ++i) 
@@ -264,7 +264,7 @@ void TestCases<dim>::run (ParameterHandler &prm) {
            cell = tria->last_active(tria->n_levels()-1);
            --cell;
            cell->set_refine_flag ();
-           tria->execute_refinement ();
+           tria->execute_coarsening_and_refinement ();
          };
 
        break;
@@ -287,7 +287,7 @@ void TestCases<dim>::run (ParameterHandler &prm) {
        
                                         // refine once
        tria->begin_active()->set_refine_flag();
-       tria->execute_refinement ();
+       tria->execute_coarsening_and_refinement ();
        
        Triangulation<dim>::active_cell_iterator cell, endc;
        for (int i=0; i<6-dim; ++i) 
@@ -301,7 +301,7 @@ void TestCases<dim>::run (ParameterHandler &prm) {
              if (cell->at_boundary())
                cell->set_refine_flag();
            
-           tria->execute_refinement();
+           tria->execute_coarsening_and_refinement();
          };
        
        break;
@@ -311,7 +311,7 @@ void TestCases<dim>::run (ParameterHandler &prm) {
       {
                                         // refine once
        tria->begin_active()->set_refine_flag();
-       tria->execute_refinement ();
+       tria->execute_coarsening_and_refinement ();
        
        Triangulation<dim>::active_cell_iterator cell, endc;
        for (int i=0; i<(dim==2 ? 12 : (dim==3 ? 7 : 20)); ++i) 
@@ -331,7 +331,7 @@ void TestCases<dim>::run (ParameterHandler &prm) {
                  cell->set_refine_flag ();
              };
            
-           tria->execute_refinement ();
+           tria->execute_coarsening_and_refinement ();
          };
        break;  
       }
index 91ee5dfa7a9fc346ebf2f9ee1b2ab66667d077d1..fe2dd4feff905622e23c33a35c315f33a41e1c8c 100644 (file)
@@ -178,13 +178,13 @@ void test (const int test_case) {
                                         // refine first cell
        tria.begin_active()->set_refine_flag();
 //     tria.save_refine_flags (history);
-       tria.execute_refinement ();
+       tria.execute_coarsening_and_refinement ();
        
                                         // refine first active cell
                                         // on coarsest level
        tria.begin_active()->set_refine_flag ();
 //     tria.save_refine_flags (history);
-       tria.execute_refinement ();
+       tria.execute_coarsening_and_refinement ();
 
        Triangulation<dim>::active_cell_iterator cell;
        for (int i=0; i<17; ++i) 
@@ -196,7 +196,7 @@ void test (const int test_case) {
            --cell;
            cell->set_refine_flag ();
 //         tria.save_refine_flags (history);
-           tria.execute_refinement ();
+           tria.execute_coarsening_and_refinement ();
          };
 
 //     tria.refine_global (5);
@@ -224,7 +224,7 @@ void test (const int test_case) {
        
                                         // refine once
        tria.begin_active()->set_refine_flag();
-       tria.execute_refinement ();
+       tria.execute_coarsening_and_refinement ();
        
        Triangulation<dim>::active_cell_iterator cell, endc;
        const unsigned int steps[4] = { 0, 10, 7, 2 };
@@ -239,7 +239,7 @@ void test (const int test_case) {
              if (cell->at_boundary())
                cell->set_refine_flag();
            
-           tria.execute_refinement();
+           tria.execute_coarsening_and_refinement();
          };
 
        tria.set_boundary (0);
@@ -250,7 +250,7 @@ void test (const int test_case) {
       {
                                         // refine once
        tria.begin_active()->set_refine_flag();
-       tria.execute_refinement ();
+       tria.execute_coarsening_and_refinement ();
        
        Triangulation<dim>::active_cell_iterator cell, endc;
        for (int i=0; i<(dim==2 ? 13 : (dim==3 ? 7 : 30)); ++i) 
@@ -270,7 +270,7 @@ void test (const int test_case) {
                  cell->set_refine_flag ();
              };
            
-           tria.execute_refinement ();
+           tria.execute_coarsening_and_refinement ();
          };
        break;  
       }
index 4b41c688f81feb06fcb9c3ef6f7de98cfdd10245..b48010db69758e068fafeededddd65b9c92d1531 100644 (file)
@@ -427,7 +427,7 @@ int PoissonProblem<dim>::run (const unsigned int level) {
   tria->set_boundary (&boundary_description);
   tria->begin_active()->set_refine_flag();
   (++(++(tria->begin_active())))->set_refine_flag();
-  tria->execute_refinement ();
+  tria->execute_coarsening_and_refinement ();
   tria->refine_global (level);
   cout << tria->n_active_cells() << " active cells." << endl;
 
index 2a8452b97ce78401508615a1d356de2dc61bd8fd..5355fd04f9817d0eb41611072b4ffb332f5b2163 100644 (file)
@@ -379,7 +379,7 @@ bool PoissonProblem<dim>::make_grid (ParameterHandler &prm) {
              {
                tria->begin_active(tria->n_levels()-1)->set_refine_flag();
                (--(tria->last_active()))->set_refine_flag();
-               tria->execute_refinement ();
+               tria->execute_coarsening_and_refinement ();
              };
            break;
       case 7:
@@ -408,11 +408,11 @@ void PoissonProblem<dim>::make_zoom_in_grid () {
   tria->create_hypercube ();
                                   // refine first cell
   tria->begin_active()->set_refine_flag();
-  tria->execute_refinement ();
+  tria->execute_coarsening_and_refinement ();
                                   // refine first active cell
                                   // on coarsest level
   tria->begin_active()->set_refine_flag ();
-  tria->execute_refinement ();
+  tria->execute_coarsening_and_refinement ();
   
   Triangulation<dim>::active_cell_iterator cell;
   for (int i=0; i<(dim==3 ? 5 : 17); ++i) 
@@ -423,7 +423,7 @@ void PoissonProblem<dim>::make_zoom_in_grid () {
       cell = tria->last_active(tria->n_levels()-1);
       --cell;
       cell->set_refine_flag ();
-      tria->execute_refinement ();
+      tria->execute_coarsening_and_refinement ();
     };
 };
 
@@ -453,7 +453,7 @@ void PoissonProblem<dim>::make_random_grid () {
            cell->set_refine_flag ();
        };
       
-      tria->execute_refinement ();
+      tria->execute_coarsening_and_refinement ();
     };
 };
   
@@ -529,7 +529,7 @@ void PoissonProblem<dim>::run (ParameterHandler &prm) {
   if (!set_boundary_values (prm))
     return;
   
-  FEQuadraticSub<dim>                   fe;
+  FELinear<dim>                   fe;
   PoissonEquation<dim>            equation (*rhs);
   QGauss2<dim>                    quadrature;
   
index cddb2210c29891b54e396f6d6e037fd8df79a449..2a6641c129175656cacb49694fa8d981a30dda1f 100644 (file)
@@ -412,7 +412,7 @@ class TriaDimensionInfo<3> {
  *
  *        for (; cell != endc; ++cell)
  *          cell->set_refine_flag ();
- *        execute_refinement ();
+ *        execute_coarsening_and_refinement ();
  *      };
  *    \end{verbatim}
  *  \end{itemize}
@@ -435,13 +435,13 @@ class TriaDimensionInfo<3> {
  *                                     // refine first cell
  *    tria.begin_active()->set_refine_flag();
  *    tria.save_refine_flags (history);
- *    tria.execute_refinement ();
+ *    tria.execute_coarsening_and_refinement ();
  *
  *                                     // refine first active cell
  *                                     // on coarsest level
  *    tria.begin_active()->set_refine_flag ();
  *    tria.save_refine_flags (history);
- *    tria.execute_refinement ();
+ *    tria.execute_coarsening_and_refinement ();
  *    
  *    Triangulation<2>::active_cell_iterator cell;
  *    for (int i=0; i<17; ++i) 
@@ -453,7 +453,7 @@ class TriaDimensionInfo<3> {
  *        --cell;
  *        cell->set_refine_flag ();
  *        tria.save_refine_flags (history);
- *        tria.execute_refinement ();
+ *        tria.execute_coarsening_and_refinement ();
  *      };
  *                                       // output the grid
  *    ofstream out("grid.1");
@@ -616,22 +616,24 @@ class TriaDimensionInfo<3> {
  *   refinement. Marking non-active cells results in an error.
  *
  *   After all the cells you wanted to mark for refinement, call the
- *   #execute_refinement# function to actually perform the refinement. This
- *   function itself first calls the #prepare_refinement# function to regularise
- *   the resulting triangulation: since a face between two adjacent cells may
- *   only be subdivided once (i.e. the levels of two adjacent cells may
- *   differ by one at most; it is not possible to have a cell refined twice
- *   while the neighboring one is not refined), some additional cells are
- *   flagged for refinement to smooth the grid. This enlarges the number of
- *   resulting cells but makes the grid more regular, thus leading to better
- *   approximationonal properties and, above all, making the handling of data
- *   structures and algorithms much much easier. To be honest, this is mostly
- *   an algorithmic step than one needed by the finite element method.
+ *   #execute_coarsening_and_refinement# function to actually perform
+ *   the refinement. This function itself first calls the
+ *   #prepare_coarsening_and_refinement# function to regularise the resulting
+ *   triangulation: since a face between two adjacent cells may only
+ *   be subdivided once (i.e. the levels of two adjacent cells may
+ *   differ by one at most; it is not possible to have a cell refined
+ *   twice while the neighboring one is not refined), some additional
+ *   cells are flagged for refinement to smooth the grid. This
+ *   enlarges the number of resulting cells but makes the grid more
+ *   regular, thus leading to better approximationonal properties and,
+ *   above all, making the handling of data structures and algorithms
+ *   much much easier. To be honest, this is mostly an algorithmic
+ *   step than one needed by the finite element method.
  *
  *   To coarsen a grid, the same way as above is possible by using
- *   #i->set_coarsen_flag# and calling #execute_coarsening#. You can use
- *   #execute_coarsening_and_refinement# to get both actions done, first
- *   coarsening and refinement. The reason for this order is that the
+ *   #i->set_coarsen_flag# and calling #execute_coarsening_and_refinement#.
+ *
+ *   The reason for first coarsening, then refining is that the
  *   refinement usually adds some additional cells to keep the triangulation
  *   regular and thus satifies all refinement requests, while the coarsening
  *   does not delete cells not requested for; therefore the refinement will
@@ -731,14 +733,13 @@ class TriaDimensionInfo<3> {
  *   \subsection{Smoothing of a triangulation}
  *
  *   Some degradation of approximation properties has been observed
- *   for grids which are too unstructured. Therefore, the #prepare_refinement#
- *   function which is automatically called by the #execute_refinement# function
- *   can do some smoothing of the triangulation. The same holds for the
- *   #prepare_coarsening# function called by #execute_coarsening#.Note that
- *   mesh smoothing is only done for two or more space dimensions, no smoothing
- *   is available at present for one spatial dimension. In the sequel,
- *   let #execute_*# stand for any of #execute_refinement#, #execute_coarsening#
- *   or #execute_refinement_and_coarsening#.
+ *   for grids which are too unstructured. Therefore, the
+ *   #prepare_refinement# function which is automatically called by
+ *   the #execute_coarsening_and_refinement# function can do some
+ *   smoothing of the triangulation. Note that mesh smoothing is only
+ *   done for two or more space dimensions, no smoothing is available
+ *   at present for one spatial dimension. In the sequel, let
+ *   #execute_*# stand for #execute_coarsening_and_refinement#.
  *
  *   For the purpose of smoothing, the
  *   #Triangulation# constructor takes an argument specifying whether a
@@ -924,7 +925,7 @@ class TriaDimensionInfo<3> {
  *       // flag cells according to some criterion
  *       ...;
  *       tria.save_refine_flags (history);
- *       tria.execute_refinement ();
+ *       tria.execute_coarsening_and_refinement ();
  *     };        
  *   \end{verbatim}
  *
@@ -935,7 +936,7 @@ class TriaDimensionInfo<3> {
  *                                 // do 10 refinement steps
  *     for (int step=0; step<10; ++step) {
  *       tria.load_refine_flags (history);
- *       tria.execute_refinement ();
+ *       tria.execute_coarsening_and_refinement ();
  *     };        
  *   \end{verbatim}
  *
@@ -1039,7 +1040,7 @@ class TriaDimensionInfo<3> {
  *             if (cell->at_boundary())
  *               cell->set_refine_flag();
  *
- *           tria.execute_refinement();
+ *           tria.execute_coarsening_and_refinement();
  *         };
  *     };            
  *   \end{verbatim}
@@ -1065,10 +1066,11 @@ class TriaDimensionInfo<3> {
  *   each step of the mesh history, when coming to the point of refining it
  *   further the assumptions also hold.
  *
- *   The regularisation and smoothing is done in the #prepare_refinement#
- *   function, which is called by #execute_refinement# at the very beginning.
- *   It decides which additional cells to flag for refinement by looking at the
- *   old grid and the refinement flags for each cell.
+ *   The regularisation and smoothing is done in the
+ *   #prepare_refinement# function, which is called by
+ *   #execute_coarsening_and_refinement# at the very beginning.  It
+ *   decides which additional cells to flag for refinement by looking
+ *   at the old grid and the refinement flags for each cell.
  *
  *   \begin{itemize}
  *   \item {\it Regularisation:} The algorithm walks over all cells checking
@@ -1410,8 +1412,7 @@ class TriaDimensionInfo<3> {
  *
  *   @memo Implementation of a multilevel triangulation of a domain
  *   @see TriaRawIterator
- *   @author Wolfgang Bangerth, 1998
- */
+ *   @author Wolfgang Bangerth, 1998 */
 template <int dim>
 class Triangulation : public TriaDimensionInfo<dim>, public Subscriptor {
   public:
@@ -1472,7 +1473,7 @@ class Triangulation : public TriaDimensionInfo<dim>, public Subscriptor {
                                      *  object remains with the caller of this
                                      *  function, i.e. you have to make sure
                                      *  that it is not destroyed before
-                                     *  #Triangulation<>::execute_refinement()#
+                                     *  #Triangulation<>::execute_refinement_and_refinement()#
                                      *  is called the last time. Checking this
                                      *  is mostly done by the library by
                                      *  using a #Subscriptor# object as base
@@ -1635,7 +1636,7 @@ class Triangulation : public TriaDimensionInfo<dim>, public Subscriptor {
                                     /**
                                      *  Refine all cells #times# times, by
                                      *  alternatingly calling #refine_global()#
-                                     *  and #execute_refinement()#.
+                                     *  and #execute_coarsening_and_refinement()#.
                                      *  This function actually starts the
                                      *  refinement process, so you have no way
                                      *  to store the refinement flags.
@@ -1663,7 +1664,7 @@ class Triangulation : public TriaDimensionInfo<dim>, public Subscriptor {
                                      * The cells are only flagged for
                                      * refinement, they are not actually
                                      * refined. To do so, you have to call the
-                                     * #execute_refinement# function.
+                                     * #execute_coarsening_and_refinement# function.
                                      *
                                      * There are more sophisticated strategies
                                      * for mesh refinement; refer to the
@@ -1704,7 +1705,7 @@ class Triangulation : public TriaDimensionInfo<dim>, public Subscriptor {
                                      * the fraction #bottom_fraction_of_cells#
                                      * with the least error. To actually
                                      * perform the refinement, call
-                                     * #execute_refinement#.
+                                     * #execute_coarsening_and_refinement#.
                                      *
                                      * #fraction_of_cells# shall be a value
                                      * between zero and one.
@@ -1749,23 +1750,6 @@ class Triangulation : public TriaDimensionInfo<dim>, public Subscriptor {
                                            const double         top_fraction,
                                            const double         bottom_fraction);
     
-                                    /**
-                                     *  Refine all cells on all levels which
-                                     *  were previously flagged for refinement.
-                                     *
-                                     *  The function resets all refinement
-                                     *  flags to false. In three spatial
-                                     *  dimensions, the user flag is used
-                                     *  for lines and quads, but not for
-                                     *  cells.
-                                     *
-                                      *  See the general docs for more
-                                      *  information.
-                                      *
-                                     *  This function is dimension specific.
-                                     */ 
-    void execute_refinement ();
-
                                     /**
                                      *  Prepare the refinement process by
                                      *  fixing the
@@ -1789,24 +1773,6 @@ class Triangulation : public TriaDimensionInfo<dim>, public Subscriptor {
                                      */
     bool prepare_refinement ();
 
-                                    /**
-                                     * Coarsen all cells which were flagged for
-                                     * coarsening, or rather: delete all
-                                     * children of those cells of which all
-                                     * child cells are flagged for coarsening
-                                     * and several other constraints hold (see
-                                     * the general doc of this class).
-                                     *
-                                     * The function resets all coarsen
-                                     * flags to false. It uses the user flags,
-                                      * so make sure to save them if you still
-                                      * need them after calling this function.
-                                     *
-                                      * See the general docs for more
-                                      * information.
-                                     */
-    void execute_coarsening ();
-
                                     /**
                                      * This function does the analogue
                                      * of the #prepare_refinement# function:
@@ -1839,6 +1805,14 @@ class Triangulation : public TriaDimensionInfo<dim>, public Subscriptor {
                                     /**
                                      * Execute both refinement and coarsening
                                      * of the triangulation.
+                                     *
+                                     * The function resets all
+                                     * refinement and coarsening
+                                     * flags to false. It uses the
+                                     * user flags.
+                                     *
+                                      * See the general docs for more
+                                      * information.
                                      */
     void execute_coarsening_and_refinement ();
                                     /*@}*/
@@ -2923,6 +2897,22 @@ class Triangulation : public TriaDimensionInfo<dim>, public Subscriptor {
                                     //@}
   protected:
 
+                                    /**
+                                     *  Refine all cells on all levels which
+                                     *  were previously flagged for refinement.
+                                     */ 
+    void execute_refinement ();
+
+                                    /**
+                                     * Coarsen all cells which were flagged for
+                                     * coarsening, or rather: delete all
+                                     * children of those cells of which all
+                                     * child cells are flagged for coarsening
+                                     * and several other constraints hold (see
+                                     * the general doc of this class).
+                                     */
+    void execute_coarsening ();
+
                                     /**
                                      *  Write a bool vector to the given stream,
                                      *  writing a pre- and a postfix magica
index 85108aead8148de549fbf4c63334438583541261..473387905ee79df8123a85640a7941b72581eefd 100644 (file)
@@ -3914,6 +3914,9 @@ Triangulation<dim>::refine_and_coarsen_fixed_fraction (const Vector<number> &cri
 
 template <int dim>
 void Triangulation<dim>::execute_coarsening_and_refinement () {
+  prepare_refinement ();
+  prepare_coarsening ();
+
   execute_coarsening();
   execute_refinement();
 };
@@ -3926,7 +3929,6 @@ void Triangulation<dim>::execute_coarsening_and_refinement () {
 template <>
 void Triangulation<1>::execute_refinement () {
   const unsigned int dim = 2;
-  prepare_refinement ();
   
                                   // check whether a new level is needed
                                   // we have to check for this on the
@@ -4147,7 +4149,6 @@ void Triangulation<1>::execute_refinement () {
 template <>
 void Triangulation<2>::execute_refinement () {
   const unsigned int dim = 2;
-  prepare_refinement ();
   
                                   // check whether a new level is needed
                                   // we have to check for this on the
@@ -4755,9 +4756,6 @@ template <>
 void Triangulation<3>::execute_refinement () {
   const unsigned int dim = 3;
 
-                                  // do some grid smoothing
-  prepare_refinement ();
-  
                                   // check whether a new level is needed
                                   // we have to check for this on the
                                   // highest level only (on this, all
@@ -5953,7 +5951,6 @@ void Triangulation<3>::execute_refinement () {
 
 template <int dim>
 void Triangulation<dim>::execute_coarsening () {
-  prepare_coarsening ();
                                   // loop over all cells. Flag all cells of
                                   // which all children are flagged for
                                   // coarsening and delete the childrens'
index 2584e4fe4614490e6f4f55f2a29c00ba53a2609d..ea600558835c138c44f87a18e3562fa2def88145 100644 (file)
@@ -271,7 +271,7 @@ int PoissonProblem<dim>::run (const unsigned int level) {
   tria->set_boundary (&boundary_description);
   tria->begin_active()->set_refine_flag();
   (++(++(tria->begin_active())))->set_refine_flag();
-  tria->execute_refinement ();
+  tria->execute_coarsening_and_refinement ();
   tria->refine_global (level);
   cout << tria->n_active_cells() << " active cells." << endl;
 
index 9144ac0f1165559f1a086d49ede8487e48700c00..1c6768560139eaac65965c1c73354604496847da 100644 (file)
@@ -249,11 +249,11 @@ void TestCases<dim>::run (ParameterHandler &prm) {
       {
                                         // refine first cell
        tria->begin_active()->set_refine_flag();
-       tria->execute_refinement ();
+       tria->execute_coarsening_and_refinement ();
                                         // refine first active cell
                                         // on coarsest level
        tria->begin_active()->set_refine_flag ();
-       tria->execute_refinement ();
+       tria->execute_coarsening_and_refinement ();
 
        Triangulation<dim>::active_cell_iterator cell;
        for (int i=0; i<17; ++i) 
@@ -264,7 +264,7 @@ void TestCases<dim>::run (ParameterHandler &prm) {
            cell = tria->last_active(tria->n_levels()-1);
            --cell;
            cell->set_refine_flag ();
-           tria->execute_refinement ();
+           tria->execute_coarsening_and_refinement ();
          };
 
        break;
@@ -287,7 +287,7 @@ void TestCases<dim>::run (ParameterHandler &prm) {
        
                                         // refine once
        tria->begin_active()->set_refine_flag();
-       tria->execute_refinement ();
+       tria->execute_coarsening_and_refinement ();
        
        Triangulation<dim>::active_cell_iterator cell, endc;
        for (int i=0; i<6-dim; ++i) 
@@ -301,7 +301,7 @@ void TestCases<dim>::run (ParameterHandler &prm) {
              if (cell->at_boundary())
                cell->set_refine_flag();
            
-           tria->execute_refinement();
+           tria->execute_coarsening_and_refinement();
          };
        
        break;
@@ -311,7 +311,7 @@ void TestCases<dim>::run (ParameterHandler &prm) {
       {
                                         // refine once
        tria->begin_active()->set_refine_flag();
-       tria->execute_refinement ();
+       tria->execute_coarsening_and_refinement ();
        
        Triangulation<dim>::active_cell_iterator cell, endc;
        for (int i=0; i<(dim==2 ? 12 : (dim==3 ? 7 : 20)); ++i) 
@@ -331,7 +331,7 @@ void TestCases<dim>::run (ParameterHandler &prm) {
                  cell->set_refine_flag ();
              };
            
-           tria->execute_refinement ();
+           tria->execute_coarsening_and_refinement ();
          };
        break;  
       }
index 91ee5dfa7a9fc346ebf2f9ee1b2ab66667d077d1..fe2dd4feff905622e23c33a35c315f33a41e1c8c 100644 (file)
@@ -178,13 +178,13 @@ void test (const int test_case) {
                                         // refine first cell
        tria.begin_active()->set_refine_flag();
 //     tria.save_refine_flags (history);
-       tria.execute_refinement ();
+       tria.execute_coarsening_and_refinement ();
        
                                         // refine first active cell
                                         // on coarsest level
        tria.begin_active()->set_refine_flag ();
 //     tria.save_refine_flags (history);
-       tria.execute_refinement ();
+       tria.execute_coarsening_and_refinement ();
 
        Triangulation<dim>::active_cell_iterator cell;
        for (int i=0; i<17; ++i) 
@@ -196,7 +196,7 @@ void test (const int test_case) {
            --cell;
            cell->set_refine_flag ();
 //         tria.save_refine_flags (history);
-           tria.execute_refinement ();
+           tria.execute_coarsening_and_refinement ();
          };
 
 //     tria.refine_global (5);
@@ -224,7 +224,7 @@ void test (const int test_case) {
        
                                         // refine once
        tria.begin_active()->set_refine_flag();
-       tria.execute_refinement ();
+       tria.execute_coarsening_and_refinement ();
        
        Triangulation<dim>::active_cell_iterator cell, endc;
        const unsigned int steps[4] = { 0, 10, 7, 2 };
@@ -239,7 +239,7 @@ void test (const int test_case) {
              if (cell->at_boundary())
                cell->set_refine_flag();
            
-           tria.execute_refinement();
+           tria.execute_coarsening_and_refinement();
          };
 
        tria.set_boundary (0);
@@ -250,7 +250,7 @@ void test (const int test_case) {
       {
                                         // refine once
        tria.begin_active()->set_refine_flag();
-       tria.execute_refinement ();
+       tria.execute_coarsening_and_refinement ();
        
        Triangulation<dim>::active_cell_iterator cell, endc;
        for (int i=0; i<(dim==2 ? 13 : (dim==3 ? 7 : 30)); ++i) 
@@ -270,7 +270,7 @@ void test (const int test_case) {
                  cell->set_refine_flag ();
              };
            
-           tria.execute_refinement ();
+           tria.execute_coarsening_and_refinement ();
          };
        break;  
       }
index 4b41c688f81feb06fcb9c3ef6f7de98cfdd10245..b48010db69758e068fafeededddd65b9c92d1531 100644 (file)
@@ -427,7 +427,7 @@ int PoissonProblem<dim>::run (const unsigned int level) {
   tria->set_boundary (&boundary_description);
   tria->begin_active()->set_refine_flag();
   (++(++(tria->begin_active())))->set_refine_flag();
-  tria->execute_refinement ();
+  tria->execute_coarsening_and_refinement ();
   tria->refine_global (level);
   cout << tria->n_active_cells() << " active cells." << endl;
 
index 2a8452b97ce78401508615a1d356de2dc61bd8fd..5355fd04f9817d0eb41611072b4ffb332f5b2163 100644 (file)
@@ -379,7 +379,7 @@ bool PoissonProblem<dim>::make_grid (ParameterHandler &prm) {
              {
                tria->begin_active(tria->n_levels()-1)->set_refine_flag();
                (--(tria->last_active()))->set_refine_flag();
-               tria->execute_refinement ();
+               tria->execute_coarsening_and_refinement ();
              };
            break;
       case 7:
@@ -408,11 +408,11 @@ void PoissonProblem<dim>::make_zoom_in_grid () {
   tria->create_hypercube ();
                                   // refine first cell
   tria->begin_active()->set_refine_flag();
-  tria->execute_refinement ();
+  tria->execute_coarsening_and_refinement ();
                                   // refine first active cell
                                   // on coarsest level
   tria->begin_active()->set_refine_flag ();
-  tria->execute_refinement ();
+  tria->execute_coarsening_and_refinement ();
   
   Triangulation<dim>::active_cell_iterator cell;
   for (int i=0; i<(dim==3 ? 5 : 17); ++i) 
@@ -423,7 +423,7 @@ void PoissonProblem<dim>::make_zoom_in_grid () {
       cell = tria->last_active(tria->n_levels()-1);
       --cell;
       cell->set_refine_flag ();
-      tria->execute_refinement ();
+      tria->execute_coarsening_and_refinement ();
     };
 };
 
@@ -453,7 +453,7 @@ void PoissonProblem<dim>::make_random_grid () {
            cell->set_refine_flag ();
        };
       
-      tria->execute_refinement ();
+      tria->execute_coarsening_and_refinement ();
     };
 };
   
@@ -529,7 +529,7 @@ void PoissonProblem<dim>::run (ParameterHandler &prm) {
   if (!set_boundary_values (prm))
     return;
   
-  FEQuadraticSub<dim>                   fe;
+  FELinear<dim>                   fe;
   PoissonEquation<dim>            equation (*rhs);
   QGauss2<dim>                    quadrature;
   

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.