]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make the test cases for inhomogeneous constraints a bit smaller so they run faster.
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 30 Apr 2009 07:21:21 +0000 (07:21 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 30 Apr 2009 07:21:21 +0000 (07:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@18797 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/inhomogeneous_constraints_block.cc
tests/deal.II/inhomogeneous_constraints_block/cmp/generic
tests/deal.II/inhomogeneous_constraints_nonsymmetric.cc
tests/deal.II/inhomogeneous_constraints_nonsymmetric/cmp/generic
tests/deal.II/inhomogeneous_constraints_vector.cc
tests/deal.II/inhomogeneous_constraints_vector/cmp/generic

index 379fecf3d7eee2b6a47c27453a622ee51158efbf..a6e778630275e926af03ed93ca33a2d119ebecbe 100644 (file)
@@ -483,14 +483,17 @@ template <int dim>
 void AdvectionProblem<dim>::run () 
 {
   GridGenerator::hyper_cube (triangulation);
-  triangulation.refine_global (2);
+  triangulation.refine_global (4-dim);
 
                                   // manually refine the first two cells to
                                   // create some hanging nodes
   {
     typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
     cell->set_refine_flag();
-    cell++;
+  }
+  triangulation.execute_coarsening_and_refinement();
+  {
+    typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.last();
     cell->set_refine_flag();
   }
   triangulation.execute_coarsening_and_refinement();  
index 6f4fbbccac38a36a0c46f4d8866203e00725e4ff..3af785ade2679afaa5a723fa909579ffd0789f8d 100644 (file)
@@ -1,25 +1,25 @@
 
 DEAL::
 DEAL::
-DEAL::  Number of active cells:       22
-DEAL::  Number of degrees of freedom: 228
-DEAL::  Number of constraints       : 18
-DEAL::  Reference matrix nonzeros: 6700, actually: 1254
-DEAL::  Test matrix 1 nonzeros: 6700, actually: 1254
+DEAL::  Number of active cells:       28
+DEAL::  Number of degrees of freedom: 298
+DEAL::  Number of constraints       : 48
+DEAL::  Reference matrix nonzeros: 9084, actually: 1744
+DEAL::  Test matrix 1 nonzeros: 9084, actually: 1748
 DEAL::  Matrix difference norm: 0
 DEAL::  RHS difference norm: 0
-DEAL::  Test matrix 2 nonzeros: 6700, actually: 1254
+DEAL::  Test matrix 2 nonzeros: 9084, actually: 1748
 DEAL::  Matrix difference norm: 0
 DEAL::  RHS difference norm: 0
 DEAL::
 DEAL::
-DEAL::  Number of active cells:       78
-DEAL::  Number of degrees of freedom: 1856
-DEAL::  Number of constraints       : 174
-DEAL::  Reference matrix nonzeros: 189772, actually: 24098
-DEAL::  Test matrix 1 nonzeros: 189772, actually: 24194
+DEAL::  Number of active cells:       64
+DEAL::  Number of degrees of freedom: 1602
+DEAL::  Number of constraints       : 288
+DEAL::  Reference matrix nonzeros: 165476, actually: 19180
+DEAL::  Test matrix 1 nonzeros: 165476, actually: 19256
 DEAL::  Matrix difference norm: 0
 DEAL::  RHS difference norm: 0
-DEAL::  Test matrix 2 nonzeros: 189772, actually: 24108
+DEAL::  Test matrix 2 nonzeros: 165476, actually: 19170
 DEAL::  Matrix difference norm: 0
 DEAL::  RHS difference norm: 0
index f64e807a1120ca58d7c8b976ec652fe04265290e..628551d6bc75d67641e74d12fd0f4439ad837e64 100644 (file)
@@ -436,15 +436,19 @@ void AdvectionProblem<dim>::assemble_test_2 ()
 template <int dim>
 void AdvectionProblem<dim>::run () 
 {
-  GridGenerator::hyper_cube (triangulation);
-  triangulation.refine_global (2);
+  GridGenerator::hyper_ball (triangulation);
+  triangulation.refine_global (3-dim);
 
-                                  // manually refine the first two cells to
-                                  // create some hanging nodes
+                                  // manually refine the first two cells
+                                  // and then one of these cells once again
+                                  // to create some hanging nodes
   {
     typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
     cell->set_refine_flag();
-    cell++;
+  }
+  triangulation.execute_coarsening_and_refinement();
+  {
+    typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.last();
     cell->set_refine_flag();
   }
   triangulation.execute_coarsening_and_refinement();  
index 468b03c5320ba82954d1db533396525aac5c5697..405114df8486a90ea7bc7cbbfa50072294274a36 100644 (file)
@@ -1,25 +1,25 @@
 
 DEAL::
 DEAL::
-DEAL::  Number of active cells:       22
-DEAL::  Number of degrees of freedom: 114
-DEAL::  Number of constraints       : 9
-DEAL::  Reference matrix nonzeros: 1618, actually: 627
-DEAL::  Test matrix 1 nonzeros: 1618, actually: 627
+DEAL::  Number of active cells:       32
+DEAL::  Number of degrees of freedom: 159
+DEAL::  Number of constraints       : 30
+DEAL::  Reference matrix nonzeros: 2499, actually: 1441
+DEAL::  Test matrix 1 nonzeros: 2499, actually: 1442
 DEAL::  Matrix difference norm: 0
 DEAL::  RHS difference norm: 0
-DEAL::  Test matrix 2 nonzeros: 1618, actually: 627
+DEAL::  Test matrix 2 nonzeros: 2499, actually: 1440
 DEAL::  Matrix difference norm: 0
 DEAL::  RHS difference norm: 0
 DEAL::
 DEAL::
-DEAL::  Number of active cells:       78
-DEAL::  Number of degrees of freedom: 928
-DEAL::  Number of constraints       : 87
-DEAL::  Reference matrix nonzeros: 46980, actually: 12049
-DEAL::  Test matrix 1 nonzeros: 46980, actually: 12097
+DEAL::  Number of active cells:       42
+DEAL::  Number of degrees of freedom: 529
+DEAL::  Number of constraints       : 234
+DEAL::  Reference matrix nonzeros: 30555, actually: 11223
+DEAL::  Test matrix 1 nonzeros: 30555, actually: 11228
 DEAL::  Matrix difference norm: 0
 DEAL::  RHS difference norm: 0
-DEAL::  Test matrix 2 nonzeros: 46980, actually: 12054
+DEAL::  Test matrix 2 nonzeros: 30555, actually: 11194
 DEAL::  Matrix difference norm: 0
 DEAL::  RHS difference norm: 0
index d66685a4117b443652f23c067124ee56948f260f..465b8e047fd6879438f5f4250b0ef42b46ca1d32 100644 (file)
 #include <lac/solver_bicgstab.h>
 #include <lac/precondition.h>
 #include <lac/constraint_matrix.h>
-#include <grid/tria.h>
 #include <dofs/dof_handler.h>
-#include <grid/tria_accessor.h>
-#include <grid/tria_iterator.h>
-#include <grid/grid_generator.h>
 #include <dofs/dof_accessor.h>
 #include <dofs/dof_tools.h>
 #include <fe/fe_q.h>
 #include <fe/fe_values.h>
+#include <grid/tria.h>
+#include <grid/tria_accessor.h>
+#include <grid/tria_iterator.h>
+#include <grid/grid_generator.h>
 #include <numerics/vectors.h>
 #include <numerics/matrices.h>
 #include <numerics/data_out.h>
@@ -213,10 +213,23 @@ void LaplaceProblem<dim>::assemble_system ()
 
       cell->get_dof_indices (local_dof_indices);
 
-      constraints.distribute_local_to_global(cell_matrix, cell_rhs, local_dof_indices, system_matrix, system_rhs);
-      constraints.distribute_local_to_global(cell_rhs, local_dof_indices, test, cell_matrix);
+                                  // use standard function with matrix and
+                                  // vector argument
+      constraints.distribute_local_to_global(cell_matrix, cell_rhs, 
+                                            local_dof_indices, 
+                                            system_matrix, system_rhs);
+
+                                  // now do just the right hand side (with
+                                  // local matrix for eliminating
+                                  // inhomogeneities)
+      constraints.distribute_local_to_global(cell_rhs, 
+                                            local_dof_indices, 
+                                            test, cell_matrix);
 
     }
+
+                                  // and compare whether we really got the
+                                  // same right hand side vector
   test -= system_rhs;
   Assert (test.l2_norm() <= 1e-12, ExcInternalError());
 }
@@ -254,14 +267,17 @@ void LaplaceProblem<dim>::run ()
       else
        {
          GridGenerator::hyper_cube (triangulation, -1, 1);
-         triangulation.refine_global (2);
+         triangulation.refine_global (4-dim);
          {
            typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
            cell->set_refine_flag();
-           cell++;
+         }
+         triangulation.execute_coarsening_and_refinement();
+         {
+           typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.last();
            cell->set_refine_flag();
          }
-         triangulation.execute_coarsening_and_refinement();  
+         triangulation.execute_coarsening_and_refinement();
        }
 
       deallog << "   Number of active cells: "
index ac83885d8c02ef421a7b396e1b5ff8a14688fb81..7b331abbbbce7ee75e9bbb4579a5a3d67f589781 100644 (file)
@@ -1,43 +1,43 @@
 
 DEAL::Cycle 0:
-DEAL::   Number of active cells: 22
-DEAL::   Total number of cells: 29
-DEAL::   Number of degrees of freedom: 34
-DEAL:Bicgstab::Starting value 4.8
-DEAL:Bicgstab::Convergence step 7 value 0
-DEAL::   7 Bicgstab iterations needed to obtain convergence.
+DEAL::   Number of active cells: 28
+DEAL::   Total number of cells: 37
+DEAL::   Number of degrees of freedom: 43
+DEAL:Bicgstab::Starting value 4.9
+DEAL:Bicgstab::Convergence step 8 value 0
+DEAL::   8 Bicgstab iterations needed to obtain convergence.
 DEAL::Cycle 1:
-DEAL::   Number of active cells: 88
-DEAL::   Total number of cells: 117
-DEAL::   Number of degrees of freedom: 111
-DEAL:Bicgstab::Starting value 6.3
-DEAL:Bicgstab::Convergence step 10 value 0
-DEAL::   10 Bicgstab iterations needed to obtain convergence.
+DEAL::   Number of active cells: 112
+DEAL::   Total number of cells: 149
+DEAL::   Number of degrees of freedom: 141
+DEAL:Bicgstab::Starting value 6.4
+DEAL:Bicgstab::Convergence step 13 value 0
+DEAL::   13 Bicgstab iterations needed to obtain convergence.
 DEAL::Cycle 2:
-DEAL::   Number of active cells: 352
-DEAL::   Total number of cells: 469
-DEAL::   Number of degrees of freedom: 397
-DEAL:Bicgstab::Starting value 8.7
-DEAL:Bicgstab::Convergence step 18 value 0
-DEAL::   18 Bicgstab iterations needed to obtain convergence.
+DEAL::   Number of active cells: 448
+DEAL::   Total number of cells: 597
+DEAL::   Number of degrees of freedom: 505
+DEAL:Bicgstab::Starting value 8.9
+DEAL:Bicgstab::Convergence step 21 value 0
+DEAL::   21 Bicgstab iterations needed to obtain convergence.
 DEAL::Cycle 0:
-DEAL::   Number of active cells: 78
-DEAL::   Total number of cells: 89
-DEAL::   Number of degrees of freedom: 158
-DEAL:Bicgstab::Starting value 4.9
-DEAL:Bicgstab::Convergence step 7 value 0
-DEAL::   7 Bicgstab iterations needed to obtain convergence.
+DEAL::   Number of active cells: 64
+DEAL::   Total number of cells: 73
+DEAL::   Number of degrees of freedom: 137
+DEAL:Bicgstab::Starting value 5.7
+DEAL:Bicgstab::Convergence step 8 value 0
+DEAL::   8 Bicgstab iterations needed to obtain convergence.
 DEAL::Cycle 1:
-DEAL::   Number of active cells: 624
-DEAL::   Total number of cells: 713
-DEAL::   Number of degrees of freedom: 909
-DEAL:Bicgstab::Starting value 4.9
-DEAL:Bicgstab::Convergence step 10 value 0
-DEAL::   10 Bicgstab iterations needed to obtain convergence.
+DEAL::   Number of active cells: 512
+DEAL::   Total number of cells: 585
+DEAL::   Number of degrees of freedom: 771
+DEAL:Bicgstab::Starting value 4.8
+DEAL:Bicgstab::Convergence step 11 value 0
+DEAL::   11 Bicgstab iterations needed to obtain convergence.
 DEAL::Cycle 2:
-DEAL::   Number of active cells: 4992
-DEAL::   Total number of cells: 5705
-DEAL::   Number of degrees of freedom: 6065
-DEAL:Bicgstab::Starting value 4.9
-DEAL:Bicgstab::Convergence step 16 value 0
-DEAL::   16 Bicgstab iterations needed to obtain convergence.
+DEAL::   Number of active cells: 4096
+DEAL::   Total number of cells: 4681
+DEAL::   Number of degrees of freedom: 5069
+DEAL:Bicgstab::Starting value 4.8
+DEAL:Bicgstab::Convergence step 18 value 0
+DEAL::   18 Bicgstab iterations needed to obtain convergence.

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.