From: bangerth Date: Fri, 24 Jan 2014 15:33:11 +0000 (+0000) Subject: Adjust a few tests to not call set_active_fe_index() on non-active cells. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17f06104c0b86c0525fdde45f643300db274c92c;p=dealii-svn.git Adjust a few tests to not call set_active_fe_index() on non-active cells. git-svn-id: https://svn.dealii.org/trunk@32296 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/hp/get_interpolated_dof_values_01.cc b/tests/hp/get_interpolated_dof_values_01.cc index 743e8a75ea..4eb4a8673a 100644 --- a/tests/hp/get_interpolated_dof_values_01.cc +++ b/tests/hp/get_interpolated_dof_values_01.cc @@ -44,7 +44,7 @@ template void test () { // create a hp::DoFHandler with different finite elements on the - // cells. note that we assign active_fe_indices also to inactive + // cells. note that we skip setting active_fe_indices on inactive // elements Triangulation tr; GridGenerator::hyper_cube(tr, 0., 1.); @@ -57,7 +57,8 @@ void test () hp::DoFHandler dof_handler(tr); for (typename hp::DoFHandler::cell_iterator cell=dof_handler.begin(); cell!=dof_handler.end(); ++cell) - cell->set_active_fe_index (cell->index() % fe.size()); + if (cell->has_children() == false) + cell->set_active_fe_index (cell->index() % fe.size()); dof_handler.distribute_dofs (fe); diff --git a/tests/hp/get_interpolated_dof_values_02.cc b/tests/hp/get_interpolated_dof_values_02.cc index c97e8aafce..e6f64c218e 100644 --- a/tests/hp/get_interpolated_dof_values_02.cc +++ b/tests/hp/get_interpolated_dof_values_02.cc @@ -49,7 +49,7 @@ template void test () { // create a hp::DoFHandler with different finite elements on the - // cells. note that we assign active_fe_indices also to inactive + // cells. note that we skip setting active_fe_indices on inactive // elements Triangulation tr; GridGenerator::hyper_cube(tr, 0., 1.); @@ -62,7 +62,8 @@ void test () hp::DoFHandler dof_handler(tr); for (typename hp::DoFHandler::cell_iterator cell=dof_handler.begin(); cell!=dof_handler.end(); ++cell) - cell->set_active_fe_index (cell->index() % fe.size()); + if (cell->has_children() == false) + cell->set_active_fe_index (cell->index() % fe.size()); dof_handler.distribute_dofs (fe); diff --git a/tests/hp/get_interpolated_dof_values_03.cc b/tests/hp/get_interpolated_dof_values_03.cc index 0a4e142cbd..e47f005e0c 100644 --- a/tests/hp/get_interpolated_dof_values_03.cc +++ b/tests/hp/get_interpolated_dof_values_03.cc @@ -44,9 +44,9 @@ template void test () { deallog << dim << "D" << std::endl; - + // create a hp::DoFHandler with different finite elements on the - // cells. note that we assign active_fe_indices also to inactive + // cells. note that we skip setting active_fe_indices on inactive // elements Triangulation tr; GridGenerator::hyper_cube(tr, 0., 1.); @@ -59,7 +59,8 @@ void test () hp::DoFHandler dof_handler(tr); for (typename hp::DoFHandler::cell_iterator cell=dof_handler.begin(); cell!=dof_handler.end(); ++cell) - cell->set_active_fe_index (cell->index() % fe.size()); + if (cell->has_children() == false) + cell->set_active_fe_index (cell->index() % fe.size()); dof_handler.distribute_dofs (fe); diff --git a/tests/hp/set_dof_values_by_interpolation_01.cc b/tests/hp/set_dof_values_by_interpolation_01.cc index 323033ad07..676afac53f 100644 --- a/tests/hp/set_dof_values_by_interpolation_01.cc +++ b/tests/hp/set_dof_values_by_interpolation_01.cc @@ -44,7 +44,7 @@ template void test () { // create a hp::DoFHandler with different finite elements on the - // cells. note that we assign active_fe_indices also to inactive + // cells. note that we skip setting active_fe_indices on inactive // elements Triangulation tr; GridGenerator::hyper_cube(tr, 0., 1.); @@ -57,7 +57,8 @@ void test () hp::DoFHandler dof_handler(tr); for (typename hp::DoFHandler::cell_iterator cell=dof_handler.begin(); cell!=dof_handler.end(); ++cell) - cell->set_active_fe_index (cell->index() % fe.size()); + if (cell->has_children() == false) + cell->set_active_fe_index (cell->index() % fe.size()); dof_handler.distribute_dofs (fe); diff --git a/tests/hp/set_dof_values_by_interpolation_02.cc b/tests/hp/set_dof_values_by_interpolation_02.cc index ed7d5d8ed1..172fb5956a 100644 --- a/tests/hp/set_dof_values_by_interpolation_02.cc +++ b/tests/hp/set_dof_values_by_interpolation_02.cc @@ -50,7 +50,7 @@ template void test () { // create a hp::DoFHandler with different finite elements on the - // cells. note that we assign active_fe_indices also to inactive + // cells. note that we skip setting active_fe_indices on inactive // elements Triangulation tr; GridGenerator::hyper_cube(tr, 0., 1.); @@ -63,7 +63,8 @@ void test () hp::DoFHandler dof_handler(tr); for (typename hp::DoFHandler::cell_iterator cell=dof_handler.begin(); cell!=dof_handler.end(); ++cell) - cell->set_active_fe_index (cell->index() % fe.size()); + if (cell->has_children() == false) + cell->set_active_fe_index (cell->index() % fe.size()); dof_handler.distribute_dofs (fe); @@ -77,12 +78,12 @@ void test () { solution1 = 0; solution2 = 0; - + // set values without specifying an explicit fe_index Vector local (cell->get_fe().dofs_per_cell); for (unsigned int i=0; iset_dof_values_by_interpolation (local, solution1); // then do the same with the "correct", local fe_index diff --git a/tests/hp/set_dof_values_by_interpolation_03.cc b/tests/hp/set_dof_values_by_interpolation_03.cc index fbcdb04ca7..cb3d0dce2c 100644 --- a/tests/hp/set_dof_values_by_interpolation_03.cc +++ b/tests/hp/set_dof_values_by_interpolation_03.cc @@ -44,9 +44,9 @@ template void test () { deallog << dim << "D" << std::endl; - + // create a hp::DoFHandler with different finite elements on the - // cells. note that we assign active_fe_indices also to inactive + // cells. note that we skip setting active_fe_indices on inactive // elements Triangulation tr; GridGenerator::hyper_cube(tr, 0., 1.); @@ -59,7 +59,8 @@ void test () hp::DoFHandler dof_handler(tr); for (typename hp::DoFHandler::cell_iterator cell=dof_handler.begin(); cell!=dof_handler.end(); ++cell) - cell->set_active_fe_index (cell->index() % fe.size()); + if (cell->has_children() == false) + cell->set_active_fe_index (cell->index() % fe.size()); dof_handler.distribute_dofs (fe);