From 7657aca238c450764c812b88bc1db8a7bb984ce3 Mon Sep 17 00:00:00 2001 From: marcfehling Date: Mon, 26 Aug 2019 15:55:51 +0200 Subject: [PATCH] Fixed: tests/mpi/hp_constraints_consistent* --- tests/mpi/hp_constraints_consistent_01.cc | 28 +++++++++++------------ tests/mpi/hp_constraints_consistent_02.cc | 28 +++++++++++------------ tests/mpi/hp_constraints_consistent_03.cc | 4 ++-- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/tests/mpi/hp_constraints_consistent_01.cc b/tests/mpi/hp_constraints_consistent_01.cc index 068f45d1a3..5770e1b1e4 100644 --- a/tests/mpi/hp_constraints_consistent_01.cc +++ b/tests/mpi/hp_constraints_consistent_01.cc @@ -81,23 +81,23 @@ test(const unsigned int degree_center, // prepare DoFHandler hp::DoFHandler dh(tria); - const auto ¢er = dh.begin_active(); - if (center->is_locally_owned() && - center->id().to_string() == "0_0:") // center cell has ID 0 - { - center->set_active_fe_index(1); + for (const auto &cell : dh.active_cell_iterators()) + if (cell->is_locally_owned() && cell->id().to_string() == "1_0:") + { + // set different fe on center cell + cell->set_active_fe_index(1); #ifdef DEBUG - // verify that our scenario is initialized correctly - // by checking the number of neighbors of the center cell - unsigned int n_neighbors = 0; - for (unsigned int i = 0; i < GeometryInfo::faces_per_cell; ++i) - if (static_cast(center->neighbor_index(i)) != - numbers::invalid_unsigned_int) - ++n_neighbors; - Assert(n_neighbors == 3, ExcInternalError()); + // verify that our scenario is initialized correctly + // by checking the number of neighbors of the center cell + unsigned int n_neighbors = 0; + for (unsigned int i = 0; i < GeometryInfo::faces_per_cell; ++i) + if (static_cast(cell->neighbor_index(i)) != + numbers::invalid_unsigned_int) + ++n_neighbors; + Assert(n_neighbors == 3, ExcInternalError()); #endif - } + } dh.distribute_dofs(fe_collection); diff --git a/tests/mpi/hp_constraints_consistent_02.cc b/tests/mpi/hp_constraints_consistent_02.cc index 6c29c129a9..908ccf52e8 100644 --- a/tests/mpi/hp_constraints_consistent_02.cc +++ b/tests/mpi/hp_constraints_consistent_02.cc @@ -81,23 +81,23 @@ test(const unsigned int degree_center, // prepare DoFHandler hp::DoFHandler dh(tria); - const auto ¢er = dh.begin_active(); - if (center->is_locally_owned() && - center->id().to_string() == "0_0:") // center cell has ID 0 - { - center->set_active_fe_index(1); + for (const auto &cell : dh.active_cell_iterators()) + if (cell->is_locally_owned() && cell->id().to_string() == "1_0:") + { + // set different fe on center cell + cell->set_active_fe_index(1); #ifdef DEBUG - // verify that our scenario is initialized correctly - // by checking the number of neighbors of the center cell - unsigned int n_neighbors = 0; - for (unsigned int i = 0; i < GeometryInfo::faces_per_cell; ++i) - if (static_cast(center->neighbor_index(i)) != - numbers::invalid_unsigned_int) - ++n_neighbors; - Assert(n_neighbors == 3, ExcInternalError()); + // verify that our scenario is initialized correctly + // by checking the number of neighbors of the center cell + unsigned int n_neighbors = 0; + for (unsigned int i = 0; i < GeometryInfo::faces_per_cell; ++i) + if (static_cast(cell->neighbor_index(i)) != + numbers::invalid_unsigned_int) + ++n_neighbors; + Assert(n_neighbors == 3, ExcInternalError()); #endif - } + } dh.distribute_dofs(fe_collection); diff --git a/tests/mpi/hp_constraints_consistent_03.cc b/tests/mpi/hp_constraints_consistent_03.cc index c067f032e8..a8057367e2 100644 --- a/tests/mpi/hp_constraints_consistent_03.cc +++ b/tests/mpi/hp_constraints_consistent_03.cc @@ -84,7 +84,7 @@ test(const unsigned int degree_center, for (const auto &cell : dh.active_cell_iterators()) if (cell->is_locally_owned()) { - if (cell->id().to_string() == "0_0:") // center cell has ID 0 + if (cell->id().to_string() == "1_0:") { // set different fe on center cell cell->set_active_fe_index(1); @@ -100,7 +100,7 @@ test(const unsigned int degree_center, Assert(n_neighbors == 3, ExcInternalError()); #endif } - else if (cell->id().to_string() == "1_0:") + else if (cell->id().to_string() == "0_0:") { // set different boundary id on leftmost cell for (unsigned int f = 0; f < GeometryInfo::faces_per_cell; ++f) -- 2.39.5