From: Timo Heister Date: Sun, 5 Jul 2015 16:54:51 +0000 (-0400) Subject: improve test X-Git-Tag: v8.4.0-rc2~277^2~29 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=827e20f378fe10ce5a3b6e1d84f4a1a65586f511;p=dealii.git improve test --- diff --git a/tests/multigrid/constrained_dofs_01.cc b/tests/multigrid/constrained_dofs_01.cc index 96a99b9ced..b9d7be377e 100644 --- a/tests/multigrid/constrained_dofs_01.cc +++ b/tests/multigrid/constrained_dofs_01.cc @@ -64,10 +64,26 @@ void setup_tria(parallel::distributed::Triangulation &tr) tr.execute_coarsening_and_refinement(); } - template -void reorder(DoFHandler &dofh, FiniteElement &fe) +void check_fe(FiniteElement &fe) { + deallog << fe.get_name() << std::endl; + + parallel::distributed::Triangulation tr(MPI_COMM_WORLD, + Triangulation::none, + parallel::distributed::Triangulation::construct_multigrid_hierarchy); + setup_tria(tr); + + ZeroFunction zero; + typename FunctionMap::type fmap; + fmap.insert(std::make_pair(0, &zero)); + + DoFHandler dofh(tr); + dofh.distribute_dofs(fe); + dofh.distribute_mg_dofs(fe); + + MGConstrainedDoFs mg_constrained_dofs_ref; + { // reorder parallel::distributed::Triangulation tr(MPI_COMM_SELF, Triangulation::none, parallel::distributed::Triangulation::construct_multigrid_hierarchy); @@ -101,32 +117,11 @@ void reorder(DoFHandler &dofh, FiniteElement &fe) cell->set_mg_dof_indices(renumbered); cell->update_cell_dof_indices_cache(); } - -} - -template -void check_fe(FiniteElement &fe) -{ - deallog << fe.get_name() << std::endl; - - parallel::distributed::Triangulation tr(MPI_COMM_WORLD, - Triangulation::none, - parallel::distributed::Triangulation::construct_multigrid_hierarchy); - setup_tria(tr); - - ZeroFunction zero; - typename FunctionMap::type fmap; - fmap.insert(std::make_pair(0, &zero)); - - DoFHandler 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::type dirichlet_boundary; + ZeroFunction 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 &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; + + } } diff --git a/tests/multigrid/constrained_dofs_01.mpirun=1.output b/tests/multigrid/constrained_dofs_01.mpirun=1.output index 57a5d2ccb0..c22d3d278e 100644 --- a/tests/multigrid/constrained_dofs_01.mpirun=1.output +++ b/tests/multigrid/constrained_dofs_01.mpirun=1.output @@ -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 diff --git a/tests/multigrid/constrained_dofs_01.mpirun=3.output b/tests/multigrid/constrained_dofs_01.mpirun=3.output index bd7ed88b8a..e3d6d45af0 100644 --- a/tests/multigrid/constrained_dofs_01.mpirun=3.output +++ b/tests/multigrid/constrained_dofs_01.mpirun=3.output @@ -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