]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Don't check the argument passed to set_active_fe_index since at that time no finite...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 2 May 2006 21:49:32 +0000 (21:49 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 2 May 2006 21:49:32 +0000 (21:49 +0000)
git-svn-id: https://svn.dealii.org/trunk@12982 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_accessor.templates.h
deal.II/deal.II/include/dofs/hp_dof_handler.h
deal.II/deal.II/source/dofs/hp_dof_handler.cc

index d55facc66b9a963d473cdff47c96b95b2c9103b2..3c131acb23d4129f8bbe29bdbffc5a651ece74b2 100644 (file)
@@ -795,8 +795,6 @@ DoFCellAccessor<hp::DoFHandler<1> >::set_active_fe_index (const unsigned int i)
          this->dof_handler->levels[this->present_level]->active_fe_indices.size (),
          ExcIndexRange (this->present_index, 0,
                         this->dof_handler->levels[this->present_level]->active_fe_indices.size ()));
-  Assert (i < this->dof_handler->get_fe().size (),
-          ExcIndexRange(i, 0, this->dof_handler->get_fe().size ()));
   this->dof_handler->levels[this->present_level]
     ->active_fe_indices[this->present_index] = i;
 }
@@ -817,8 +815,6 @@ DoFCellAccessor<hp::DoFHandler<2> >::set_active_fe_index (const unsigned int i)
          this->dof_handler->levels[this->present_level]->active_fe_indices.size (),
          ExcIndexRange (this->present_index, 0,
                         this->dof_handler->levels[this->present_level]->active_fe_indices.size ()));
-  Assert (i < this->dof_handler->get_fe().size (),
-          ExcIndexRange(i, 0, this->dof_handler->get_fe().size ()));
   this->dof_handler->levels[this->present_level]
     ->active_fe_indices[this->present_index] = i;
 }
@@ -839,8 +835,6 @@ DoFCellAccessor<hp::DoFHandler<3> >::set_active_fe_index (const unsigned int i)
          this->dof_handler->levels[this->present_level]->active_fe_indices.size (),
          ExcIndexRange (this->present_index, 0,
                         this->dof_handler->levels[this->present_level]->active_fe_indices.size ()));
-  Assert (i < this->dof_handler->get_fe().size (),
-          ExcIndexRange(i, 0, this->dof_handler->get_fe().size ()));
   this->dof_handler->levels[this->present_level]
     ->active_fe_indices[this->present_index] = i;
 }
index 74b1c5d533b10dafa45284338c712b4a635f7904..1967901f84000332726facade79245f39d8998c9 100644 (file)
@@ -892,7 +892,15 @@ namespace hp
                       int,
                       << "The given list of new dof indices is not consecutive: "
                       << "the index " << arg1 << " does not exist.");
-
+                                      /**
+                                       * Exception
+                                       */
+      DeclException2 (ExcInvalidFEIndex,
+                     int, int,
+                     << "The mesh contains a cell with an active_fe_index of "
+                     << arg1 << ", but the finite element collection only has "
+                     << arg2 << " elements");
+      
     protected:
     
                                        /**
index a33cb6a3c6e45d294bd16f6151bb7c5dba43c735..437bbfc07b6f7c7ebc56c66a25956796aa92382f 100644 (file)
@@ -1523,7 +1523,17 @@ namespace hp
     Assert (tria->n_levels() > 0, ExcInvalidTriangulation());
 
     finite_elements = &ff;
-  
+
+                                    // up front make sure that the fe
+                                    // collection is large enough to
+                                    // cover all fe indices presently
+                                    // in use on the mesh
+    for (active_cell_iterator cell = begin_active(); cell != end(); ++cell) 
+      Assert (cell->active_fe_index() < finite_elements->size(),
+             ExcInvalidFEIndex (cell->active_fe_index(),
+                                finite_elements->size()));
+
+    
                                      // This call ensures that the
                                      // active_fe_indices vectors are
                                      // initialized correctly.

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.