From: Denis Davydov Date: Fri, 30 Oct 2015 22:48:53 +0000 (+0100) Subject: added extra Asserts to shared::Tria tests; do not output partition results X-Git-Tag: v8.4.0-rc2~261^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1819%2Fhead;p=dealii.git added extra Asserts to shared::Tria tests; do not output partition results --- diff --git a/tests/sharedtria/dof_01.cc b/tests/sharedtria/dof_01.cc index 77a0c8078c..81968d92c6 100644 --- a/tests/sharedtria/dof_01.cc +++ b/tests/sharedtria/dof_01.cc @@ -92,19 +92,20 @@ void test() triangulation.execute_coarsening_and_refinement (); dof_handler.distribute_dofs (fe); + // avoid outputing any partitioning info until Parmetis gives reproducable results deallog - << "n_dofs: " << dof_handler.n_dofs() << std::endl - << "n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() << std::endl; - - deallog << "n_locally_owned_dofs_per_processor: "; - std::vector v = dof_handler.n_locally_owned_dofs_per_processor(); - unsigned int sum = 0; - for (unsigned int i=0; i v = dof_handler.n_locally_owned_dofs_per_processor(); +// unsigned int sum = 0; +// for (unsigned int i=0; i v = dof_handler.n_locally_owned_dofs_per_processor(); - unsigned int sum = 0; - for (unsigned int i=0; i v = dof_handler.n_locally_owned_dofs_per_processor(); +// unsigned int sum = 0; +// for (unsigned int i=0; i v = dof_handler.n_locally_owned_dofs_per_processor(); - unsigned int sum = 0; - for (unsigned int i=0; i v = dof_handler.n_locally_owned_dofs_per_processor(); +// unsigned int sum = 0; +// for (unsigned int i=0; i v = dof_handler.n_locally_owned_dofs_per_processor(); - unsigned int sum = 0; - for (unsigned int i=0; i v = dof_handler.n_locally_owned_dofs_per_processor(); +// unsigned int sum = 0; +// for (unsigned int i=0; i tr(MPI_COMM_WORLD); + AssertThrow( tr.with_artificial_cells() == false, + ExcInternalError()); + + const std::vector & + true_subdomain_ids_of_cells = tr.get_true_subdomain_ids_of_cells(); + + AssertThrow (true_subdomain_ids_of_cells.size() == tr.n_active_cells(), + ExcInternalError()); + GridGenerator::hyper_cube(tr); tr.begin_active()->set_refine_flag(); @@ -81,11 +90,15 @@ void test() deallog << v[i] << " "; deallog << std::endl;*/ - deallog << "subdomains: "; + // untill parmetis is stable, do not output partitioning + //deallog << "subdomains: "; typename parallel::shared::Triangulation::active_cell_iterator it=tr.begin_active(); - for (; it!=tr.end(); ++it) + for (unsigned int index=0; it!=tr.end(); ++it,++index) { - deallog << it->subdomain_id() << " "; + // check that true subdomain_ids are the same as those, stored in cell->subdomain_id() + AssertThrow(true_subdomain_ids_of_cells[index] == it->subdomain_id(), + ExcInternalError()); + //deallog << it->subdomain_id() << " "; } deallog << std::endl; diff --git a/tests/sharedtria/tria_01.with_metis=true.with_64bit_indices=off.mpirun=3.output b/tests/sharedtria/tria_01.with_metis=true.with_64bit_indices=off.mpirun=3.output index 4c4808a145..e470e96bf8 100644 --- a/tests/sharedtria/tria_01.with_metis=true.with_64bit_indices=off.mpirun=3.output +++ b/tests/sharedtria/tria_01.with_metis=true.with_64bit_indices=off.mpirun=3.output @@ -4,26 +4,26 @@ DEAL:0:2d:: locally_owned_subdomain(): 0 n_levels: 3 n_global_levels: 3 -DEAL:0:2d::subdomains: 0 1 0 2 2 1 1 +DEAL:0:2d:: DEAL:0:3d:: locally_owned_subdomain(): 0 n_active_cells: 15 n_levels: 3 n_global_levels: 3 -DEAL:0:3d::subdomains: 0 1 0 2 0 0 0 2 2 1 1 2 2 1 1 +DEAL:0:3d:: DEAL:1:2d:: locally_owned_subdomain(): 1 n_active_cells: 7 n_levels: 3 n_global_levels: 3 -DEAL:1:2d::subdomains: 0 1 0 2 2 1 1 +DEAL:1:2d:: DEAL:1:3d:: locally_owned_subdomain(): 1 n_active_cells: 15 n_levels: 3 n_global_levels: 3 -DEAL:1:3d::subdomains: 0 1 0 2 0 0 0 2 2 1 1 2 2 1 1 +DEAL:1:3d:: DEAL:2:2d:: locally_owned_subdomain(): 2 @@ -31,11 +31,11 @@ DEAL:2:2d:: locally_owned_subdomain(): 2 n_levels: 3 n_global_levels: 3 -DEAL:2:2d::subdomains: 0 1 0 2 2 1 1 +DEAL:2:2d:: DEAL:2:3d:: locally_owned_subdomain(): 2 n_active_cells: 15 n_levels: 3 n_global_levels: 3 -DEAL:2:3d::subdomains: 0 1 0 2 0 0 0 2 2 1 1 2 2 1 1 +DEAL:2:3d:: diff --git a/tests/sharedtria/tria_01.with_metis=true.with_64bit_indices=off.mpirun=3.output.2 b/tests/sharedtria/tria_01.with_metis=true.with_64bit_indices=off.mpirun=3.output.2 deleted file mode 100644 index c7b9a98fa0..0000000000 --- a/tests/sharedtria/tria_01.with_metis=true.with_64bit_indices=off.mpirun=3.output.2 +++ /dev/null @@ -1,41 +0,0 @@ - -DEAL:0:2d:: locally_owned_subdomain(): 0 - n_active_cells: 7 - n_levels: 3 - n_global_levels: 3 - -DEAL:0:2d::subdomains: 2 1 2 0 0 1 1 -DEAL:0:3d:: locally_owned_subdomain(): 0 - n_active_cells: 15 - n_levels: 3 - n_global_levels: 3 - -DEAL:0:3d::subdomains: 2 0 0 1 0 0 0 2 2 2 2 1 1 1 1 - -DEAL:1:2d:: locally_owned_subdomain(): 1 - n_active_cells: 7 - n_levels: 3 - n_global_levels: 3 - -DEAL:1:2d::subdomains: 2 1 2 0 0 1 1 -DEAL:1:3d:: locally_owned_subdomain(): 1 - n_active_cells: 15 - n_levels: 3 - n_global_levels: 3 - -DEAL:1:3d::subdomains: 2 0 0 1 0 0 0 2 2 2 2 1 1 1 1 - - -DEAL:2:2d:: locally_owned_subdomain(): 2 - n_active_cells: 7 - n_levels: 3 - n_global_levels: 3 - -DEAL:2:2d::subdomains: 2 1 2 0 0 1 1 -DEAL:2:3d:: locally_owned_subdomain(): 2 - n_active_cells: 15 - n_levels: 3 - n_global_levels: 3 - -DEAL:2:3d::subdomains: 2 0 0 1 0 0 0 2 2 2 2 1 1 1 1 - diff --git a/tests/sharedtria/tria_01.with_metis=true.with_64bit_indices=on.mpirun=3.output b/tests/sharedtria/tria_01.with_metis=true.with_64bit_indices=on.mpirun=3.output index 4c4808a145..e470e96bf8 100644 --- a/tests/sharedtria/tria_01.with_metis=true.with_64bit_indices=on.mpirun=3.output +++ b/tests/sharedtria/tria_01.with_metis=true.with_64bit_indices=on.mpirun=3.output @@ -4,26 +4,26 @@ DEAL:0:2d:: locally_owned_subdomain(): 0 n_levels: 3 n_global_levels: 3 -DEAL:0:2d::subdomains: 0 1 0 2 2 1 1 +DEAL:0:2d:: DEAL:0:3d:: locally_owned_subdomain(): 0 n_active_cells: 15 n_levels: 3 n_global_levels: 3 -DEAL:0:3d::subdomains: 0 1 0 2 0 0 0 2 2 1 1 2 2 1 1 +DEAL:0:3d:: DEAL:1:2d:: locally_owned_subdomain(): 1 n_active_cells: 7 n_levels: 3 n_global_levels: 3 -DEAL:1:2d::subdomains: 0 1 0 2 2 1 1 +DEAL:1:2d:: DEAL:1:3d:: locally_owned_subdomain(): 1 n_active_cells: 15 n_levels: 3 n_global_levels: 3 -DEAL:1:3d::subdomains: 0 1 0 2 0 0 0 2 2 1 1 2 2 1 1 +DEAL:1:3d:: DEAL:2:2d:: locally_owned_subdomain(): 2 @@ -31,11 +31,11 @@ DEAL:2:2d:: locally_owned_subdomain(): 2 n_levels: 3 n_global_levels: 3 -DEAL:2:2d::subdomains: 0 1 0 2 2 1 1 +DEAL:2:2d:: DEAL:2:3d:: locally_owned_subdomain(): 2 n_active_cells: 15 n_levels: 3 n_global_levels: 3 -DEAL:2:3d::subdomains: 0 1 0 2 0 0 0 2 2 1 1 2 2 1 1 +DEAL:2:3d:: diff --git a/tests/sharedtria/tria_02.cc b/tests/sharedtria/tria_02.cc index 16352122c3..ae8be13332 100644 --- a/tests/sharedtria/tria_02.cc +++ b/tests/sharedtria/tria_02.cc @@ -63,6 +63,14 @@ void test() Triangulation::none, /*artificial*/true); + AssertThrow( tr.with_artificial_cells() == true, + ExcInternalError()); + + const std::vector & + true_subdomain_ids_of_cells = tr.get_true_subdomain_ids_of_cells(); + + AssertThrow (true_subdomain_ids_of_cells.size() == tr.n_active_cells(), + ExcInternalError()); GridGenerator::hyper_cube(tr); tr.refine_global(); @@ -86,18 +94,23 @@ void test() deallog << v[i] << " "; deallog << std::endl;*/ - deallog << "subdomains: "; + // untill parmetis is stable, do not output partitioning + //deallog << "subdomains: "; typename parallel::shared::Triangulation::active_cell_iterator it=tr.begin_active(); - for (; it!=tr.end(); ++it) + for (unsigned int index=0; it!=tr.end(); ++it,++index) { - deallog << (int) it->subdomain_id() << " "; + // check that true subdomain_ids are the same as those, stored in cell->subdomain_id() + AssertThrow( (it->is_artificial() == true) || + (true_subdomain_ids_of_cells[index] == it->subdomain_id()), + ExcInternalError()); + //deallog << (int) it->subdomain_id() << " "; } deallog << std::endl; - const std::string filename = ("mesh_" + - Utilities::int_to_string(dim)+ - "D_"); - write_mesh(tr, filename.c_str()); +// const std::string filename = ("mesh_" + +// Utilities::int_to_string(dim)+ +// "D_"); +// write_mesh(tr, filename.c_str()); } diff --git a/tests/sharedtria/tria_02.with_metis=true.with_64bit_indices=off.mpirun=3.output b/tests/sharedtria/tria_02.with_metis=true.with_64bit_indices=off.mpirun=3.output index 027bf51dc5..0e97c55ec5 100644 --- a/tests/sharedtria/tria_02.with_metis=true.with_64bit_indices=off.mpirun=3.output +++ b/tests/sharedtria/tria_02.with_metis=true.with_64bit_indices=off.mpirun=3.output @@ -4,26 +4,26 @@ DEAL:0:2d:: locally_owned_subdomain(): 0 n_levels: 3 n_global_levels: 3 -DEAL:0:2d::subdomains: 1 1 0 0 0 0 2 -2 1 -2 +DEAL:0:2d:: DEAL:0:3d:: locally_owned_subdomain(): 0 n_active_cells: 22 n_levels: 3 n_global_levels: 3 -DEAL:0:3d::subdomains: 2 0 2 0 2 0 -2 1 -2 2 -2 1 -2 2 1 1 1 0 1 0 0 0 +DEAL:0:3d:: DEAL:1:2d:: locally_owned_subdomain(): 1 n_active_cells: 10 n_levels: 3 n_global_levels: 3 -DEAL:1:2d::subdomains: 1 1 -2 0 0 0 2 2 1 2 +DEAL:1:2d:: DEAL:1:3d:: locally_owned_subdomain(): 1 n_active_cells: 22 n_levels: 3 n_global_levels: 3 -DEAL:1:3d::subdomains: 2 0 2 0 -2 -2 1 1 2 2 2 1 2 2 1 1 1 0 1 0 0 0 +DEAL:1:3d:: DEAL:2:2d:: locally_owned_subdomain(): 2 @@ -31,11 +31,11 @@ DEAL:2:2d:: locally_owned_subdomain(): 2 n_levels: 3 n_global_levels: 3 -DEAL:2:2d::subdomains: -2 1 -2 0 -2 0 2 2 1 2 +DEAL:2:2d:: DEAL:2:3d:: locally_owned_subdomain(): 2 n_active_cells: 22 n_levels: 3 n_global_levels: 3 -DEAL:2:3d::subdomains: 2 0 2 0 2 0 1 1 2 2 2 1 2 2 1 -2 1 -2 1 -2 0 -2 +DEAL:2:3d::