]> https://gitweb.dealii.org/ - dealii.git/commitdiff
improve test
authorTimo Heister <timo.heister@gmail.com>
Sun, 5 Jul 2015 16:54:51 +0000 (12:54 -0400)
committerTimo Heister <timo.heister@gmail.com>
Sun, 5 Jul 2015 16:54:51 +0000 (12:54 -0400)
tests/multigrid/constrained_dofs_01.cc
tests/multigrid/constrained_dofs_01.mpirun=1.output
tests/multigrid/constrained_dofs_01.mpirun=3.output

index 96a99b9ced83deaa7fdd59e7a28ca185617b510b..b9d7be377e664a7c9b58898a77c6570086a22c6d 100644 (file)
@@ -64,10 +64,26 @@ void setup_tria(parallel::distributed::Triangulation<dim> &tr)
   tr.execute_coarsening_and_refinement();
 }
 
-
 template <int dim>
-void reorder(DoFHandler<dim> &dofh, FiniteElement<dim> &fe)
+void check_fe(FiniteElement<dim> &fe)
 {
+  deallog << fe.get_name() << std::endl;
+
+  parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
+                                               Triangulation<dim>::none,
+                                               parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy);
+  setup_tria(tr);
+
+  ZeroFunction<dim> zero;
+  typename FunctionMap<dim>::type fmap;
+  fmap.insert(std::make_pair(0, &zero));
+
+  DoFHandler<dim> dofh(tr);
+  dofh.distribute_dofs(fe);
+  dofh.distribute_mg_dofs(fe);
+
+  MGConstrainedDoFs                    mg_constrained_dofs_ref;
+  { // reorder
   parallel::distributed::Triangulation<dim> tr(MPI_COMM_SELF,
                                                Triangulation<dim>::none,
                                                parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy);
@@ -101,32 +117,11 @@ void reorder(DoFHandler<dim> &dofh, FiniteElement<dim> &fe)
       cell->set_mg_dof_indices(renumbered);
       cell->update_cell_dof_indices_cache();
     }
-
   
-}
-
-template <int dim>
-void check_fe(FiniteElement<dim> &fe)
-{
-  deallog << fe.get_name() << std::endl;
-
-    parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
-                                               Triangulation<dim>::none,
-                                               parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy);
-  setup_tria(tr);
-
-  ZeroFunction<dim> zero;
-  typename FunctionMap<dim>::type fmap;
-  fmap.insert(std::make_pair(0, &zero));
-
-  DoFHandler<dim> dofh(tr);
-  dofh.distribute_dofs(fe);
-  dofh.distribute_mg_dofs(fe);
-
-  { // reorder
-    unsigned int numprocs = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
-    if (numprocs > 1)
-      reorder(dofh, fe);
+  typename FunctionMap<dim>::type      dirichlet_boundary;
+  ZeroFunction<dim>                    homogeneous_dirichlet_bc (1);
+  dirichlet_boundary[0] = &homogeneous_dirichlet_bc;
+  mg_constrained_dofs_ref.initialize(dofhref, dirichlet_boundary);
   }
   
   
@@ -156,6 +151,16 @@ void check_fe(FiniteElement<dim> &fe)
                 relevant, level);
       deallog << "relevant:" << std::endl;
       relevant.print(deallog);
+
+      // the indexsets should be the same when run in parallel (on the
+      // relevant subset):
+      deallog << ((rei == (relevant & mg_constrained_dofs_ref.get_refinement_edge_indices(level)))
+                 ?"ok ":"FAIL ")
+             << ((bi == (relevant & mg_constrained_dofs_ref.get_boundary_indices(level)))
+                 ?"ok ":"FAIL ")
+             << std::endl;
+      
+
     }
 }
 
index 57a5d2ccb0d2ce09a0f28b787f2a42fc94d54da2..c22d3d278e11a9bccb16f281e8651a505a652614 100644 (file)
@@ -7,6 +7,7 @@ DEAL:0::get_boundary_indices:
 DEAL:0::{[0,3]}
 DEAL:0::relevant:
 DEAL:0::{[0,3]}
+DEAL:0::ok ok 
 DEAL:0::Level 1:
 DEAL:0::get_refinement_edge_indices:
 DEAL:0::{}
@@ -14,6 +15,7 @@ DEAL:0::get_boundary_indices:
 DEAL:0::{[0,2], [4,8]}
 DEAL:0::relevant:
 DEAL:0::{[0,8]}
+DEAL:0::ok ok 
 DEAL:0::Level 2:
 DEAL:0::get_refinement_edge_indices:
 DEAL:0::{}
@@ -21,6 +23,7 @@ DEAL:0::get_boundary_indices:
 DEAL:0::{[0,2], 4, 6, 9, [11,12], [14,15], [18,20], [22,24]}
 DEAL:0::relevant:
 DEAL:0::{[0,24]}
+DEAL:0::ok ok 
 DEAL:0::Level 3:
 DEAL:0::get_refinement_edge_indices:
 DEAL:0::{0, 2, [6,8]}
@@ -28,3 +31,4 @@ DEAL:0::get_boundary_indices:
 DEAL:0::{[0,1], [4,5], 8}
 DEAL:0::relevant:
 DEAL:0::{[0,8]}
+DEAL:0::ok ok 
index bd7ed88b8a9619e2d6fc13ec651f8cf2e108fa55..e3d6d45af0f64c5971a71facd55965ac36d5a640 100644 (file)
@@ -7,6 +7,7 @@ DEAL:0::get_boundary_indices:
 DEAL:0::{[0,3]}
 DEAL:0::relevant:
 DEAL:0::{[0,3]}
+DEAL:0::ok ok 
 DEAL:0::Level 1:
 DEAL:0::get_refinement_edge_indices:
 DEAL:0::{}
@@ -14,6 +15,7 @@ DEAL:0::get_boundary_indices:
 DEAL:0::{[0,2], [4,8]}
 DEAL:0::relevant:
 DEAL:0::{[0,8]}
+DEAL:0::ok ok 
 DEAL:0::Level 2:
 DEAL:0::get_refinement_edge_indices:
 DEAL:0::{}
@@ -21,6 +23,7 @@ DEAL:0::get_boundary_indices:
 DEAL:0::{[0,2], 4, 6, 9, [11,12], [14,15]}
 DEAL:0::relevant:
 DEAL:0::{[0,17], 21}
+DEAL:0::ok ok 
 DEAL:0::Level 3:
 DEAL:0::get_refinement_edge_indices:
 DEAL:0::{}
@@ -28,6 +31,7 @@ DEAL:0::get_boundary_indices:
 DEAL:0::{}
 DEAL:0::relevant:
 DEAL:0::{}
+DEAL:0::ok ok 
 
 DEAL:1::FE_Q<2>(1)
 DEAL:1::Level 0:
@@ -37,6 +41,7 @@ DEAL:1::get_boundary_indices:
 DEAL:1::{}
 DEAL:1::relevant:
 DEAL:1::{}
+DEAL:1::ok ok 
 DEAL:1::Level 1:
 DEAL:1::get_refinement_edge_indices:
 DEAL:1::{}
@@ -44,6 +49,7 @@ DEAL:1::get_boundary_indices:
 DEAL:1::{1, [4,5]}
 DEAL:1::relevant:
 DEAL:1::{1, [3,5]}
+DEAL:1::ok ok 
 DEAL:1::Level 2:
 DEAL:1::get_refinement_edge_indices:
 DEAL:1::{}
@@ -51,6 +57,7 @@ DEAL:1::get_boundary_indices:
 DEAL:1::{1, 4, 9, [11,12], 14, 22}
 DEAL:1::relevant:
 DEAL:1::{1, [3,5], [7,14], [16,17], [21,22]}
+DEAL:1::ok ok 
 DEAL:1::Level 3:
 DEAL:1::get_refinement_edge_indices:
 DEAL:1::{0, 2, [6,8]}
@@ -58,6 +65,7 @@ DEAL:1::get_boundary_indices:
 DEAL:1::{[0,1], [4,5], 8}
 DEAL:1::relevant:
 DEAL:1::{[0,8]}
+DEAL:1::ok ok 
 
 
 DEAL:2::FE_Q<2>(1)
@@ -68,6 +76,7 @@ DEAL:2::get_boundary_indices:
 DEAL:2::{[0,3]}
 DEAL:2::relevant:
 DEAL:2::{[0,3]}
+DEAL:2::ok ok 
 DEAL:2::Level 1:
 DEAL:2::get_refinement_edge_indices:
 DEAL:2::{}
@@ -75,6 +84,7 @@ DEAL:2::get_boundary_indices:
 DEAL:2::{[0,2], [4,8]}
 DEAL:2::relevant:
 DEAL:2::{[0,8]}
+DEAL:2::ok ok 
 DEAL:2::Level 2:
 DEAL:2::get_refinement_edge_indices:
 DEAL:2::{}
@@ -82,6 +92,7 @@ DEAL:2::get_boundary_indices:
 DEAL:2::{2, 6, 12, [14,15], [18,20], [22,24]}
 DEAL:2::relevant:
 DEAL:2::{[2,3], [5,8], 10, [12,24]}
+DEAL:2::ok ok 
 DEAL:2::Level 3:
 DEAL:2::get_refinement_edge_indices:
 DEAL:2::{}
@@ -89,4 +100,5 @@ DEAL:2::get_boundary_indices:
 DEAL:2::{}
 DEAL:2::relevant:
 DEAL:2::{}
+DEAL:2::ok ok 
 

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.