]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Check that the fe used by a fevalues object is the same as the one used to reinit...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 22 May 2000 08:29:50 +0000 (08:29 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 22 May 2000 08:29:50 +0000 (08:29 +0000)
git-svn-id: https://svn.dealii.org/trunk@2916 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/fe_values.h
deal.II/deal.II/source/fe/fe_values.cc

index 0a63bc791c81cab63b66adec17e511f174fad20d..164d08023e6c4cbd6487238aeb62af34af5406d3 100644 (file)
@@ -582,6 +582,10 @@ class FEValuesBase
                                      * Exception
                                      */
     DeclException0 (ExcInvalidUpdateFlag);
+                                    /**
+                                     * Exception
+                                     */
+    DeclException0 (ExcFEDontMatch);
     
   protected:
                                     /**
index 8b8c79a55809cf5e8d66045d53b2cdaca64fb99d..98dd3caa462a278f3a21823a8e1ff61283bfca62 100644 (file)
@@ -368,6 +368,16 @@ template <int dim>
 void FEValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator &cell)
 {
   present_cell = cell;
+
+                                  // assert that the finite elements
+                                  // passed to the constructor and
+                                  // used by the DoFHandler used by
+                                  // this cell, are the same
+  Assert (static_cast<const FiniteElementData<dim>&>(*fe)
+         ==
+         static_cast<const FiniteElementData<dim>&>(cell->get_dof_handler().get_fe()),
+         ExcFEDontMatch());
+  
                                   // fill jacobi matrices and real
                                   // quadrature points
   if ((update_flags & update_jacobians)          ||
@@ -550,6 +560,18 @@ void FEFaceValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator &c
 {
   present_cell  = cell;
   selected_dataset = face_no;
+
+                                  // assert that the finite elements
+                                  // passed to the constructor and
+                                  // used by the DoFHandler used by
+                                  // this cell, are the same
+  Assert (static_cast<const FiniteElementData<dim>&>(*fe)
+         ==
+         static_cast<const FiniteElementData<dim>&>(cell->get_dof_handler().get_fe()),
+         ExcFEDontMatch());
+  Assert (face_no < GeometryInfo<dim>::faces_per_cell,
+         ExcIndexRange (face_no, 0, GeometryInfo<dim>::faces_per_cell));
+  
                                   // fill jacobi matrices and real
                                   // quadrature points
   if ((update_flags & update_jacobians)          ||
@@ -722,6 +744,20 @@ void FESubfaceValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator
   
   present_cell  = cell;
   selected_dataset = face_no*(1<<(dim-1)) + subface_no;
+
+                                  // assert that the finite elements
+                                  // passed to the constructor and
+                                  // used by the DoFHandler used by
+                                  // this cell, are the same
+  Assert (static_cast<const FiniteElementData<dim>&>(*fe)
+         ==
+         static_cast<const FiniteElementData<dim>&>(cell->get_dof_handler().get_fe()),
+         ExcFEDontMatch());
+  Assert (face_no < GeometryInfo<dim>::faces_per_cell,
+         ExcIndexRange (face_no, 0, GeometryInfo<dim>::faces_per_cell));
+  Assert (subface_no < GeometryInfo<dim>::subfaces_per_face,
+         ExcIndexRange (subface_no, 0, GeometryInfo<dim>::subfaces_per_face));
+    
                                   // fill jacobi matrices and real
                                   // quadrature points
   if ((update_flags & update_jacobians)          ||

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.