]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Resolve a TODO by adding assertions
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 26 Jun 2007 05:06:52 +0000 (05:06 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 26 Jun 2007 05:06:52 +0000 (05:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@14813 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_handler.h

index b2115f03bd489a54b8797ab91bec277866e775e5..d8480ceb1c550990128e54e5f6f04a6f3c5999cf 100644 (file)
@@ -1426,10 +1426,15 @@ template <int dim>
 template <int structdim>
 inline
 unsigned int
-DoFHandler<dim>::n_active_fe_indices (const unsigned int,
-                                     const unsigned int) const
+DoFHandler<dim>::n_active_fe_indices (const unsigned int obj_level,
+                                     const unsigned int obj_index) const
 {
-//TODO[WB]: this isn't true -- the function should return zero if the object is inactive  
+  Assert (raw_cell_iterator (tria,
+                            obj_level,
+                            obj_index,
+                            this)->used() == true,
+         ExcMessage ("This cell is not active and therefore can't be "
+                     "queried for the number of active FE indices"));
   return 1;
 }
 
@@ -1439,11 +1444,16 @@ template <int dim>
 template <int structdim>
 inline
 unsigned int
-DoFHandler<dim>::nth_active_fe_index (const unsigned int,
-                                     const unsigned int,
+DoFHandler<dim>::nth_active_fe_index (const unsigned int obj_level,
+                                     const unsigned int obj_index,
                                      const unsigned int n) const
 {
-//TODO[WB]: this isn't true -- we should error out unconditionally if the object is inactive  
+  Assert (raw_cell_iterator (tria,
+                            obj_level,
+                            obj_index,
+                            this)->used() == true,
+         ExcMessage ("This cell is not active and therefore can't be "
+                     "queried for its active FE indices"));
   Assert (n == 0, ExcIndexRange (n, 0, 1));
   
   return default_fe_index;

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.