]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Adjust a few tests to not call set_active_fe_index() on non-active cells.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 24 Jan 2014 15:33:11 +0000 (15:33 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 24 Jan 2014 15:33:11 +0000 (15:33 +0000)
git-svn-id: https://svn.dealii.org/trunk@32296 0785d39b-7218-0410-832d-ea1e28bc413d

tests/hp/get_interpolated_dof_values_01.cc
tests/hp/get_interpolated_dof_values_02.cc
tests/hp/get_interpolated_dof_values_03.cc
tests/hp/set_dof_values_by_interpolation_01.cc
tests/hp/set_dof_values_by_interpolation_02.cc
tests/hp/set_dof_values_by_interpolation_03.cc

index 743e8a75ea03d655c7f840c310ed02f05f1ddfaa..4eb4a8673a50353dfe3e129280f2d3f2cfd7ec77 100644 (file)
@@ -44,7 +44,7 @@ template <int dim>
 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<dim> tr;
   GridGenerator::hyper_cube(tr, 0., 1.);
@@ -57,7 +57,8 @@ void test ()
   hp::DoFHandler<dim> dof_handler(tr);
   for (typename hp::DoFHandler<dim>::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);
 
index c97e8aafce5659a6304f03e8ce6532d9d2e0dc6a..e6f64c218e730f8fefbc0c294cd7814b6425ed20 100644 (file)
@@ -49,7 +49,7 @@ template <int dim>
 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<dim> tr;
   GridGenerator::hyper_cube(tr, 0., 1.);
@@ -62,7 +62,8 @@ void test ()
   hp::DoFHandler<dim> dof_handler(tr);
   for (typename hp::DoFHandler<dim>::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);
 
index 0a4e142cbdeced7c591ed8f73fd3737ec78c1ec4..e47f005e0c5c3c67df5a3951394626dc6ea390d4 100644 (file)
@@ -44,9 +44,9 @@ template <int dim>
 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<dim> tr;
   GridGenerator::hyper_cube(tr, 0., 1.);
@@ -59,7 +59,8 @@ void test ()
   hp::DoFHandler<dim> dof_handler(tr);
   for (typename hp::DoFHandler<dim>::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);
 
index 323033ad07c6fc802bcee7cc6d21e545d76719bb..676afac53f227345260d3f5ed9f1dd03e32a22b0 100644 (file)
@@ -44,7 +44,7 @@ template <int dim>
 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<dim> tr;
   GridGenerator::hyper_cube(tr, 0., 1.);
@@ -57,7 +57,8 @@ void test ()
   hp::DoFHandler<dim> dof_handler(tr);
   for (typename hp::DoFHandler<dim>::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);
 
index ed7d5d8ed10948f30ce70716d1ce6e4269bdd536..172fb5956a9e1a656dcd7ca127e6cd696a5dba71 100644 (file)
@@ -50,7 +50,7 @@ template <int dim>
 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<dim> tr;
   GridGenerator::hyper_cube(tr, 0., 1.);
@@ -63,7 +63,8 @@ void test ()
   hp::DoFHandler<dim> dof_handler(tr);
   for (typename hp::DoFHandler<dim>::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<double> local (cell->get_fe().dofs_per_cell);
       for (unsigned int i=0; i<local.size(); ++i)
        local(i) = i;
-      
+
       cell->set_dof_values_by_interpolation (local, solution1);
 
       // then do the same with the "correct", local fe_index
index fbcdb04ca75b0b45216514e22d2037fc7860c57f..cb3d0dce2cff84d1e7faac4877406810ae29d2dc 100644 (file)
@@ -44,9 +44,9 @@ template <int dim>
 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<dim> tr;
   GridGenerator::hyper_cube(tr, 0., 1.);
@@ -59,7 +59,8 @@ void test ()
   hp::DoFHandler<dim> dof_handler(tr);
   for (typename hp::DoFHandler<dim>::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);
 

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.