]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Adjust the test so that mesh refinement no longer depends on an estimated error....
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 17 Jan 2013 16:18:45 +0000 (16:18 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 17 Jan 2013 16:18:45 +0000 (16:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@28102 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/inhomogeneous_constraints.cc
tests/deal.II/inhomogeneous_constraints/cmp/generic

index 50bc3a333a8613ca8b6456500661d7b07331b7b2..6a0c760c38354dd58779377277eb426795c81706 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2009 by the deal.II authors
+//    Copyright (C) 2009, 2013 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -526,58 +526,13 @@ template <int dim>
 void LaplaceProblem<dim>::postprocess ()
 {
   Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
-  KellyErrorEstimator<dim>::estimate (dof_handler,
-                                     face_quadrature_collection,
-                                     typename FunctionMap<dim>::type(),
-                                     solution,
-                                     estimated_error_per_cell);
-
-  Vector<float> smoothness_indicators (triangulation.n_active_cells());
-  estimate_smoothness (smoothness_indicators);
-
-
-  {
-    GridRefinement::refine_and_coarsen_fixed_number (triangulation,
-                                                    estimated_error_per_cell,
-                                                    0.3, 0.03);
-
-    float max_smoothness = *std::min_element (smoothness_indicators.begin(),
-                                             smoothness_indicators.end()),
-         min_smoothness = *std::max_element (smoothness_indicators.begin(),
-                                             smoothness_indicators.end());
-    {
-      typename hp::DoFHandler<dim>::active_cell_iterator
-       cell = dof_handler.begin_active(),
-       endc = dof_handler.end();
-      for (unsigned int index=0; cell!=endc; ++cell, ++index)
-       if (cell->refine_flag_set())
-         {
-           max_smoothness = std::max (max_smoothness,
-                                      smoothness_indicators(index));
-           min_smoothness = std::min (min_smoothness,
-                                      smoothness_indicators(index));
-         }
-    }
-    const float threshold_smoothness = (max_smoothness + min_smoothness) / 2;
+  for (unsigned int i=0; i<estimated_error_per_cell.size(); ++i)
+    estimated_error_per_cell(i) = i;
 
-    {
-      typename hp::DoFHandler<dim>::active_cell_iterator
-       cell = dof_handler.begin_active(),
-       endc = dof_handler.end();
-      for (unsigned int index=0; cell!=endc; ++cell, ++index)
-       if (cell->refine_flag_set()
-           &&
-           (smoothness_indicators(index) > threshold_smoothness)
-           &&
-           (cell->active_fe_index()+1 < fe_collection.size()))
-         {
-           cell->clear_refine_flag();
-           cell->set_active_fe_index (cell->active_fe_index() + 1);
-         }
-    } 
-
-    triangulation.execute_coarsening_and_refinement ();
-  }
+  GridRefinement::refine_and_coarsen_fixed_number (triangulation,
+                                                  estimated_error_per_cell,
+                                                  0.3, 0.03);
+  triangulation.execute_coarsening_and_refinement ();
 }
 
 
index 2a78e7a212f4cfda3b18489d968312d7c9dba7d3..ae49e378f078cf5743b008f758e900b2977a8084 100644 (file)
@@ -17,35 +17,35 @@ DEAL:2d:cg::Convergence step 26 value 2.2e-07
 DEAL:2d::Distribute error: 0
 DEAL:2d::
 DEAL:2d::
-DEAL:2d::   Number of active cells:             237
-DEAL:2d::   Number of degrees of freedom:       1385
-DEAL:2d::   Number of hanging node constraints: 162
-DEAL:2d::   Total number of constraints:        380
-DEAL:2d::  Reference matrix nonzeros: 24829, actually: 15897
-DEAL:2d::  Test matrix 1 nonzeros: 24829, actually: 15897
+DEAL:2d::   Number of active cells:             363
+DEAL:2d::   Number of degrees of freedom:       1600
+DEAL:2d::   Number of hanging node constraints: 36
+DEAL:2d::   Total number of constraints:        284
+DEAL:2d::  Reference matrix nonzeros: 24284, actually: 17700
+DEAL:2d::  Test matrix 1 nonzeros: 24284, actually: 17700
 DEAL:2d::  Matrix difference norm: 0
 DEAL:2d::  RHS difference norm: 0
-DEAL:2d::  Test matrix 2 nonzeros: 24829, actually: 15897
+DEAL:2d::  Test matrix 2 nonzeros: 24284, actually: 17700
 DEAL:2d::  Matrix difference norm: 0
 DEAL:2d::  RHS difference norm: 0
-DEAL:2d:cg::Starting value 22.
-DEAL:2d:cg::Convergence step 38 value 2.3e-07
+DEAL:2d:cg::Starting value 20.
+DEAL:2d:cg::Convergence step 48 value 1.8e-07
 DEAL:2d::Distribute error: 0
 DEAL:2d::
 DEAL:2d::
-DEAL:2d::   Number of active cells:             261
-DEAL:2d::   Number of degrees of freedom:       2021
-DEAL:2d::   Number of hanging node constraints: 327
-DEAL:2d::   Total number of constraints:        580
-DEAL:2d::  Reference matrix nonzeros: 48091, actually: 30641
-DEAL:2d::  Test matrix 1 nonzeros: 48091, actually: 30641
+DEAL:2d::   Number of active cells:             696
+DEAL:2d::   Number of degrees of freedom:       3006
+DEAL:2d::   Number of hanging node constraints: 108
+DEAL:2d::   Total number of constraints:        408
+DEAL:2d::  Reference matrix nonzeros: 46796, actually: 36608
+DEAL:2d::  Test matrix 1 nonzeros: 46796, actually: 36608
 DEAL:2d::  Matrix difference norm: 0
 DEAL:2d::  RHS difference norm: 0
-DEAL:2d::  Test matrix 2 nonzeros: 48091, actually: 30641
+DEAL:2d::  Test matrix 2 nonzeros: 46796, actually: 36608
 DEAL:2d::  Matrix difference norm: 0
 DEAL:2d::  RHS difference norm: 0
-DEAL:2d:cg::Starting value 30.
-DEAL:2d:cg::Convergence step 52 value 3.9e-07
+DEAL:2d:cg::Starting value 23.
+DEAL:2d:cg::Convergence step 74 value 2.8e-07
 DEAL:2d::Distribute error: 0
 DEAL:3d::
 DEAL:3d::
@@ -65,33 +65,33 @@ DEAL:3d:cg::Convergence step 1 value 0
 DEAL:3d::Distribute error: 0
 DEAL:3d::
 DEAL:3d::
-DEAL:3d::   Number of active cells:             43
-DEAL:3d::   Number of degrees of freedom:       145
-DEAL:3d::   Number of hanging node constraints: 40
-DEAL:3d::   Total number of constraints:        128
-DEAL:3d::  Reference matrix nonzeros: 3663, actually: 209
-DEAL:3d::  Test matrix 1 nonzeros: 3663, actually: 209
+DEAL:3d::   Number of active cells:             29
+DEAL:3d::   Number of degrees of freedom:       74
+DEAL:3d::   Number of hanging node constraints: 20
+DEAL:3d::   Total number of constraints:        68
+DEAL:3d::  Reference matrix nonzeros: 1302, actually: 86
+DEAL:3d::  Test matrix 1 nonzeros: 1302, actually: 86
 DEAL:3d::  Matrix difference norm: 0
 DEAL:3d::  RHS difference norm: 0
-DEAL:3d::  Test matrix 2 nonzeros: 3663, actually: 209
+DEAL:3d::  Test matrix 2 nonzeros: 1302, actually: 86
 DEAL:3d::  Matrix difference norm: 0
 DEAL:3d::  RHS difference norm: 0
-DEAL:3d:cg::Starting value 5.8
-DEAL:3d:cg::Convergence step 6 value 4.5e-09
+DEAL:3d:cg::Starting value 2.2
+DEAL:3d:cg::Convergence step 4 value 4.2e-09
 DEAL:3d::Distribute error: 0
 DEAL:3d::
 DEAL:3d::
-DEAL:3d::   Number of active cells:             99
-DEAL:3d::   Number of degrees of freedom:       561
-DEAL:3d::   Number of hanging node constraints: 197
-DEAL:3d::   Total number of constraints:        422
-DEAL:3d::  Reference matrix nonzeros: 20835, actually: 3425
-DEAL:3d::  Test matrix 1 nonzeros: 20835, actually: 3425
+DEAL:3d::   Number of active cells:             120
+DEAL:3d::   Number of degrees of freedom:       230
+DEAL:3d::   Number of hanging node constraints: 61
+DEAL:3d::   Total number of constraints:        182
+DEAL:3d::  Reference matrix nonzeros: 4702, actually: 696
+DEAL:3d::  Test matrix 1 nonzeros: 4702, actually: 696
 DEAL:3d::  Matrix difference norm: 0
 DEAL:3d::  RHS difference norm: 0
-DEAL:3d::  Test matrix 2 nonzeros: 20835, actually: 3425
+DEAL:3d::  Test matrix 2 nonzeros: 4702, actually: 696
 DEAL:3d::  Matrix difference norm: 0
 DEAL:3d::  RHS difference norm: 0
-DEAL:3d:cg::Starting value 4.8
-DEAL:3d:cg::Convergence step 10 value 4.2e-08
+DEAL:3d:cg::Starting value 3.1
+DEAL:3d:cg::Convergence step 7 value 2.3e-09
 DEAL:3d::Distribute error: 0

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.