]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Make sure assertions trigger in a reasonable order. Also check for the
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 26 Jun 2002 17:04:18 +0000 (17:04 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 26 Jun 2002 17:04:18 +0000 (17:04 +0000)
correct fields!

git-svn-id: https://svn.dealii.org/trunk@6193 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 593347154a15a066e7cb90eb29ff81e5042ef209..68a592188935bcd5846e5f7513f91e67aed6c8aa 100644 (file)
@@ -1272,14 +1272,14 @@ const Tensor<1,dim> &
 FEValuesBase<dim>::shape_grad (const unsigned int i,
                               const unsigned int j) const
 {
-  Assert (i<this->shape_gradients.size(),
-         ExcIndexRange (i, 0, shape_gradients.size()));
-  Assert (j<shape_gradients[i].size(),
-         ExcIndexRange (j, 0, shape_gradients[i].size()));
   Assert (this->update_flags & update_gradients,
          ExcAccessToUninitializedField());
   Assert (fe->is_primitive (i),
          ExcShapeFunctionNotPrimitive(i));
+  Assert (i<this->shape_gradients.size(),
+         ExcIndexRange (i, 0, shape_gradients.size()));
+  Assert (j<shape_gradients[i].size(),
+         ExcIndexRange (j, 0, shape_gradients[i].size()));
 
                                   // if the entire FE is primitive,
                                   // then we can take a short-cut:
@@ -1307,7 +1307,7 @@ FEValuesBase<dim>::shape_grad_component (const unsigned int i,
                                         const unsigned int j,
                                         const unsigned int component) const
 {
-  Assert (this->update_flags & update_values,
+  Assert (this->update_flags & update_gradients,
          ExcAccessToUninitializedField());
   Assert (component < fe->n_components(),
          ExcIndexRange(component, 0, fe->n_components()));
@@ -1369,14 +1369,14 @@ const Tensor<2,dim> &
 FEValuesBase<dim>::shape_2nd_derivative (const unsigned int i,
                                         const unsigned int j) const
 {
-  Assert (i<this->shape_2nd_derivatives.size(),
-         ExcIndexRange (i, 0, shape_2nd_derivatives.size()));
-  Assert (j<this->shape_2nd_derivatives[i].size(),
-         ExcIndexRange (j, 0, shape_2nd_derivatives[i].size()));
   Assert (this->update_flags & update_second_derivatives,
          ExcAccessToUninitializedField());
   Assert (fe->is_primitive (i),
          ExcShapeFunctionNotPrimitive(i));
+  Assert (i<this->shape_2nd_derivatives.size(),
+         ExcIndexRange (i, 0, shape_2nd_derivatives.size()));
+  Assert (j<this->shape_2nd_derivatives[i].size(),
+         ExcIndexRange (j, 0, shape_2nd_derivatives[i].size()));
 
                                   // if the entire FE is primitive,
                                   // then we can take a short-cut:
@@ -1404,7 +1404,7 @@ FEValuesBase<dim>::shape_2nd_derivative_component (const unsigned int i,
                                                   const unsigned int j,
                                                   const unsigned int component) const
 {
-  Assert (this->update_flags & update_values,
+  Assert (this->update_flags & update_second_derivatives,
          ExcAccessToUninitializedField());
   Assert (component < fe->n_components(),
          ExcIndexRange(component, 0, fe->n_components()));

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.