]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make sure that the FEValues object had actually been initialized.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 8 Feb 2006 16:18:09 +0000 (16:18 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 8 Feb 2006 16:18:09 +0000 (16:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@12267 0785d39b-7218-0410-832d-ea1e28bc413d

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

index e70cea625d66e1a69ea3547beb2ba888b4f8ea38..476ca7b90d3c539bf6738ecaab3833083b842f7a 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -373,8 +373,11 @@ void FEValuesBase<dim>::get_function_values (
          ExcDimensionMismatch(fe->n_components(), 1));
   Assert (values.size() == n_quadrature_points,
          ExcDimensionMismatch(values.size(), n_quadrature_points));
+  Assert (present_cell.get() != 0,
+         ExcMessage ("FEValues object is not reinit'ed to any cell"));
   Assert (fe_function.size() == present_cell->n_dofs_for_dof_handler(),
-         ExcDimensionMismatch(fe_function.size(), present_cell->n_dofs_for_dof_handler()));
+         ExcDimensionMismatch(fe_function.size(),
+                              present_cell->n_dofs_for_dof_handler()));
 
                                   // get function values of dofs
                                   // on this cell
@@ -448,6 +451,8 @@ void FEValuesBase<dim>::get_function_values (
 //       ExcDimensionMismatch(fe_function.size(),
 //                          present_cell->get_dof_handler().n_dofs()));
                                   // One entry per quadrature point
+  Assert (present_cell.get() != 0,
+         ExcMessage ("FEValues object is not reinit'ed to any cell"));
   Assert (values.size() == n_quadrature_points,
          ExcDimensionMismatch(values.size(), n_quadrature_points));
 
@@ -663,8 +668,11 @@ get_function_grads (const InputVector           &fe_function,
          ExcDimensionMismatch(fe->n_components(), 1));
   Assert (gradients.size() == n_quadrature_points,
          ExcDimensionMismatch(gradients.size(), n_quadrature_points));
+  Assert (present_cell.get() != 0,
+         ExcMessage ("FEValues object is not reinit'ed to any cell"));
   Assert (fe_function.size() == present_cell->n_dofs_for_dof_handler(),
-         ExcDimensionMismatch(fe_function.size(), present_cell->n_dofs_for_dof_handler()));
+         ExcDimensionMismatch(fe_function.size(),
+                              present_cell->n_dofs_for_dof_handler()));
 
                                   // get function values of dofs
                                   // on this cell
@@ -690,6 +698,7 @@ get_function_grads (const InputVector           &fe_function,
 }
 
 
+
 template <int dim>
 template <class InputVector>
 void FEValuesBase<dim>::get_function_grads (
@@ -744,8 +753,11 @@ get_function_grads (const InputVector                         &fe_function,
            ExcDimensionMismatch(gradients[i].size(), n_components));
 
   Assert (this->update_flags & update_gradients, ExcAccessToUninitializedField());
+  Assert (present_cell.get() != 0,
+         ExcMessage ("FEValues object is not reinit'ed to any cell"));
   Assert (fe_function.size() == present_cell->n_dofs_for_dof_handler(),
-         ExcDimensionMismatch(fe_function.size(), present_cell->n_dofs_for_dof_handler()));
+         ExcDimensionMismatch(fe_function.size(),
+                              present_cell->n_dofs_for_dof_handler()));
 
                                   // get function values of dofs
                                   // on this cell
@@ -885,8 +897,11 @@ get_function_2nd_derivatives (const InputVector           &fe_function,
   Assert (second_derivatives.size() == n_quadrature_points,
          ExcDimensionMismatch(second_derivatives.size(), n_quadrature_points));
   Assert (this->update_flags & update_second_derivatives, ExcAccessToUninitializedField());
+  Assert (present_cell.get() != 0,
+         ExcMessage ("FEValues object is not reinit'ed to any cell"));
   Assert (fe_function.size() == present_cell->n_dofs_for_dof_handler(),
-         ExcDimensionMismatch(fe_function.size(), present_cell->n_dofs_for_dof_handler()));
+         ExcDimensionMismatch(fe_function.size(),
+                              present_cell->n_dofs_for_dof_handler()));
 
                                   // get function values of dofs
                                   // on this cell
@@ -930,8 +945,11 @@ get_function_2nd_derivatives (const InputVector                         &fe_func
            ExcDimensionMismatch(second_derivs[i].size(), n_components));
 
   Assert (this->update_flags & update_second_derivatives, ExcAccessToUninitializedField());
+  Assert (present_cell.get() != 0,
+         ExcMessage ("FEValues object is not reinit'ed to any cell"));
   Assert (fe_function.size() == present_cell->n_dofs_for_dof_handler(),
-         ExcDimensionMismatch(fe_function.size(), present_cell->n_dofs_for_dof_handler()));
+         ExcDimensionMismatch(fe_function.size(),
+                              present_cell->n_dofs_for_dof_handler()));
 
                                   // get function values of dofs
                                   // on this cell

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.