From: bangerth Date: Sun, 1 Dec 2013 18:20:50 +0000 (+0000) Subject: Significantly improve the error message one gets when you ask for something from... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d095071714ead602fff7a139abf7455dfe27d3b;p=dealii-svn.git Significantly improve the error message one gets when you ask for something from an FEValues object for which the corresponding flag was not specified. git-svn-id: https://svn.dealii.org/trunk@31840 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 26b054bb08..4101eeb4bc 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -230,6 +230,18 @@ inconvenience this causes.

Specific improvements

    +
  1. Improved: When attempting operations such as FEValues::get_function_values() + or FEValues::shape_value(), the FEValues object needs to know that what these + functions return has been computed previously. What is computed is specified + by the update flags that are passed to the constructor of all FEValues, FEFaceValues + and FESubfaceValues objects. If a user attempts an operation for which the + corresponding flag was not specified, an exception is generated. This exception + did say previously what the cause was, but it was not overly explicit. + The exception now generates a message that says exactly what is going wrong. +
    + (Wolfgang Bangerth, 2013/12/01) +
  2. +
  3. Fixed: GridGenerator::truncated_cone() failed if half_length < 0.5*radius in 3d.
    (Timo Heister, 2013/11/25) diff --git a/deal.II/include/deal.II/fe/fe_values.h b/deal.II/include/deal.II/fe/fe_values.h index 994f7885f2..153c1b5721 100644 --- a/deal.II/include/deal.II/fe/fe_values.h +++ b/deal.II/include/deal.II/fe/fe_values.h @@ -2218,7 +2218,15 @@ public: * * @ingroup Exceptions */ - DeclException0 (ExcAccessToUninitializedField); + DeclException1 (ExcAccessToUninitializedField, + char *, + << ("You are requesting information from an FEValues/FEFaceValues/FESubfaceValues " + "object for which this kind of information has not been computed. What " + "information these objects compute is determined by the update_* flags you " + "pass to the constructor. Here, the operation you are attempting requires " + "the <") + << arg1 + << "> flag to be set, but it was apparently not specified upon construction."); /** * @todo Document this * @@ -2843,7 +2851,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); // an adaptation of the FEValuesBase::shape_value_component function // except that here we know the component as fixed and we have @@ -2869,7 +2877,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); // an adaptation of the // FEValuesBase::shape_grad_component @@ -2896,7 +2904,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_hessians, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_hessians")); // an adaptation of the // FEValuesBase::shape_grad_component @@ -2922,7 +2930,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); // same as for the scalar case except // that we have one more index @@ -2960,7 +2968,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); // same as for the scalar case except // that we have one more index @@ -3000,7 +3008,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); // same as for the scalar case except // that we have one more index @@ -3035,7 +3043,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); // same as for the scalar case except that we have one more index const int snc = shape_function_data[shape_function].single_nonzero_component; @@ -3173,7 +3181,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_hessians, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_hessians")); // same as for the scalar case except // that we have one more index @@ -3289,7 +3297,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); // same as for the scalar case except // that we have one more index @@ -3323,7 +3331,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); // similar to the vector case where we // have more then one index and we need @@ -3370,7 +3378,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); const int snc = shape_function_data[shape_function].single_nonzero_component; @@ -3460,7 +3468,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); // similar to the vector case where we // have more then one index and we need @@ -3510,7 +3518,7 @@ namespace FEValuesViews Assert (shape_function < fe_values.fe->dofs_per_cell, ExcIndexRange (shape_function, 0, fe_values.fe->dofs_per_cell)); Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); const int snc = shape_function_data[shape_function].single_nonzero_component; @@ -3636,7 +3644,7 @@ FEValuesBase::shape_value (const unsigned int i, Assert (i < fe->dofs_per_cell, ExcIndexRange (i, 0, fe->dofs_per_cell)); Assert (this->update_flags & update_values, - ExcAccessToUninitializedField()); + ExcAccessToUninitializedField("update_values")); Assert (fe->is_primitive (i), ExcShapeFunctionNotPrimitive(i)); @@ -3672,7 +3680,7 @@ FEValuesBase::shape_value_component (const unsigned int i, Assert (i < fe->dofs_per_cell, ExcIndexRange (i, 0, fe->dofs_per_cell)); Assert (this->update_flags & update_values, - ExcAccessToUninitializedField()); + ExcAccessToUninitializedField("update_values")); Assert (component < fe->n_components(), ExcIndexRange(component, 0, fe->n_components())); @@ -3701,7 +3709,7 @@ FEValuesBase::shape_grad (const unsigned int i, Assert (i < fe->dofs_per_cell, ExcIndexRange (i, 0, fe->dofs_per_cell)); Assert (this->update_flags & update_gradients, - ExcAccessToUninitializedField()); + ExcAccessToUninitializedField("update_gradients")); Assert (fe->is_primitive (i), ExcShapeFunctionNotPrimitive(i)); Assert (ishape_gradients.size(), @@ -3741,7 +3749,7 @@ FEValuesBase::shape_grad_component (const unsigned int i, Assert (i < fe->dofs_per_cell, ExcIndexRange (i, 0, fe->dofs_per_cell)); Assert (this->update_flags & update_gradients, - ExcAccessToUninitializedField()); + ExcAccessToUninitializedField("update_gradients")); Assert (component < fe->n_components(), ExcIndexRange(component, 0, fe->n_components())); @@ -3770,7 +3778,7 @@ FEValuesBase::shape_hessian (const unsigned int i, Assert (i < fe->dofs_per_cell, ExcIndexRange (i, 0, fe->dofs_per_cell)); Assert (this->update_flags & update_hessians, - ExcAccessToUninitializedField()); + ExcAccessToUninitializedField("update_hessians")); Assert (fe->is_primitive (i), ExcShapeFunctionNotPrimitive(i)); Assert (ishape_hessians.size(), @@ -3821,7 +3829,7 @@ FEValuesBase::shape_hessian_component (const unsigned int i, Assert (i < fe->dofs_per_cell, ExcIndexRange (i, 0, fe->dofs_per_cell)); Assert (this->update_flags & update_hessians, - ExcAccessToUninitializedField()); + ExcAccessToUninitializedField("update_hessians")); Assert (component < fe->n_components(), ExcIndexRange(component, 0, fe->n_components())); @@ -3887,7 +3895,8 @@ inline const std::vector > & FEValuesBase::get_quadrature_points () const { - Assert (this->update_flags & update_quadrature_points, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_quadrature_points, + ExcAccessToUninitializedField("update_quadrature_points")); return this->quadrature_points; } @@ -3898,7 +3907,8 @@ inline const std::vector & FEValuesBase::get_JxW_values () const { - Assert (this->update_flags & update_JxW_values, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_JxW_values, + ExcAccessToUninitializedField("update_JxW_values")); return this->JxW_values; } @@ -3909,7 +3919,8 @@ inline const std::vector > & FEValuesBase::get_jacobians () const { - Assert (this->update_flags & update_jacobians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_jacobians, + ExcAccessToUninitializedField("update_jacobians")); return this->jacobians; } @@ -3920,7 +3931,8 @@ inline const std::vector > & FEValuesBase::get_jacobian_grads () const { - Assert (this->update_flags & update_jacobian_grads, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_jacobian_grads, + ExcAccessToUninitializedField("update_jacobians_grads")); return this->jacobian_grads; } @@ -3931,7 +3943,8 @@ inline const std::vector > & FEValuesBase::get_inverse_jacobians () const { - Assert (this->update_flags & update_inverse_jacobians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_inverse_jacobians, + ExcAccessToUninitializedField("update_inverse_jacobians")); return this->inverse_jacobians; } @@ -3942,7 +3955,8 @@ inline const Point & FEValuesBase::quadrature_point (const unsigned int i) const { - Assert (this->update_flags & update_quadrature_points, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_quadrature_points, + ExcAccessToUninitializedField("update_quadrature_points")); Assert (iquadrature_points.size(), ExcIndexRange(i, 0, this->quadrature_points.size())); return this->quadrature_points[i]; @@ -3956,7 +3970,8 @@ inline double FEValuesBase::JxW (const unsigned int i) const { - Assert (this->update_flags & update_JxW_values, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_JxW_values, + ExcAccessToUninitializedField("update_JxW_values")); Assert (iJxW_values.size(), ExcIndexRange(i, 0, this->JxW_values.size())); return this->JxW_values[i]; @@ -3969,7 +3984,8 @@ inline const DerivativeForm<1,dim,spacedim> & FEValuesBase::jacobian (const unsigned int i) const { - Assert (this->update_flags & update_jacobians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_jacobians, + ExcAccessToUninitializedField("update_jacobians")); Assert (ijacobians.size(), ExcIndexRange(i, 0, this->jacobians.size())); return this->jacobians[i]; @@ -3982,7 +3998,8 @@ inline const DerivativeForm<2,dim,spacedim> & FEValuesBase::jacobian_grad (const unsigned int i) const { - Assert (this->update_flags & update_jacobian_grads, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_jacobian_grads, + ExcAccessToUninitializedField("update_jacobians_grads")); Assert (ijacobian_grads.size(), ExcIndexRange(i, 0, this->jacobian_grads.size())); return this->jacobian_grads[i]; @@ -3995,7 +4012,8 @@ inline const DerivativeForm<1,spacedim,dim> & FEValuesBase::inverse_jacobian (const unsigned int i) const { - Assert (this->update_flags & update_inverse_jacobians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_inverse_jacobians, + ExcAccessToUninitializedField("update_inverse_jacobians")); Assert (iinverse_jacobians.size(), ExcIndexRange(i, 0, this->inverse_jacobians.size())); return this->inverse_jacobians[i]; @@ -4090,7 +4108,7 @@ FEValuesBase::normal_vector (const unsigned int i) const { typedef FEValuesBase FVB; Assert (this->update_flags & update_normal_vectors, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_normal_vectors")); Assert (inormal_vectors.size(), ExcIndexRange(i, 0, this->normal_vectors.size())); @@ -4185,7 +4203,7 @@ FEFaceValuesBase::boundary_form (const unsigned int i) const Assert (iboundary_forms.size(), ExcIndexRange(i, 0, this->boundary_forms.size())); Assert (this->update_flags & update_boundary_forms, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_boundary_forms")); return this->boundary_forms[i]; } diff --git a/deal.II/source/fe/fe_values.cc b/deal.II/source/fe/fe_values.cc index a497fce3cb..23534addf4 100644 --- a/deal.II/source/fe/fe_values.cc +++ b/deal.II/source/fe/fe_values.cc @@ -1265,7 +1265,7 @@ namespace FEValuesViews { typedef FEValuesBase FVB; Assert (fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1289,7 +1289,7 @@ namespace FEValuesViews { typedef FEValuesBase FVB; Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1313,7 +1313,7 @@ namespace FEValuesViews { typedef FEValuesBase FVB; Assert (fe_values.update_flags & update_hessians, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_hessians")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1337,7 +1337,7 @@ namespace FEValuesViews { typedef FEValuesBase FVB; Assert (fe_values.update_flags & update_hessians, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_hessians")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1361,7 +1361,7 @@ namespace FEValuesViews { typedef FEValuesBase FVB; Assert (fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1386,7 +1386,7 @@ namespace FEValuesViews { typedef FEValuesBase FVB; Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1410,7 +1410,7 @@ namespace FEValuesViews { typedef FEValuesBase FVB; Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1435,7 +1435,7 @@ namespace FEValuesViews { typedef FEValuesBase FVB; Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1459,7 +1459,7 @@ namespace FEValuesViews typedef FEValuesBase FVB; Assert (fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); Assert (fe_values.present_cell.get () != 0, ExcMessage ("FEValues object is not reinited to any cell")); AssertDimension (fe_function.size (), @@ -1482,7 +1482,7 @@ namespace FEValuesViews { typedef FEValuesBase FVB; Assert (fe_values.update_flags & update_hessians, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_hessians")); Assert (fe_values.present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), @@ -1506,7 +1506,7 @@ namespace FEValuesViews { typedef FEValuesBase FVB; Assert (fe_values.update_flags & update_hessians, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_hessians")); Assert (laplacians.size() == fe_values.n_quadrature_points, ExcDimensionMismatch(laplacians.size(), fe_values.n_quadrature_points)); Assert (fe_values.present_cell.get() != 0, @@ -1533,7 +1533,7 @@ namespace FEValuesViews { typedef FEValuesBase FVB; Assert(fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); Assert(fe_values.present_cell.get() != 0, ExcMessage("FEValues object is not reinit'ed to any cell")); AssertDimension(fe_function.size(), @@ -1557,7 +1557,7 @@ namespace FEValuesViews { typedef FEValuesBase FVB; Assert(fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); Assert(fe_values.present_cell.get() != 0, ExcMessage("FEValues object is not reinit'ed to any cell")); AssertDimension(fe_function.size(), @@ -1580,7 +1580,7 @@ namespace FEValuesViews { typedef FEValuesBase FVB; Assert(fe_values.update_flags & update_values, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_values")); Assert(fe_values.present_cell.get() != 0, ExcMessage("FEValues object is not reinit'ed to any cell")); AssertDimension(fe_function.size(), @@ -1604,7 +1604,7 @@ namespace FEValuesViews { typedef FEValuesBase FVB; Assert(fe_values.update_flags & update_gradients, - typename FVB::ExcAccessToUninitializedField()); + typename FVB::ExcAccessToUninitializedField("update_gradients")); Assert(fe_values.present_cell.get() != 0, ExcMessage("FEValues object is not reinit'ed to any cell")); AssertDimension(fe_function.size(), @@ -2575,7 +2575,8 @@ void FEValuesBase::get_function_values ( const InputVector &fe_function, std::vector &values) const { - Assert (this->update_flags & update_values, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_values, + ExcAccessToUninitializedField("update_values")); AssertDimension (fe->n_components(), 1); Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); @@ -2598,7 +2599,8 @@ void FEValuesBase::get_function_values ( const VectorSlice > &indices, std::vector &values) const { - Assert (this->update_flags & update_values, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_values, + ExcAccessToUninitializedField("update_values")); AssertDimension (fe->n_components(), 1); AssertDimension (indices.size(), dofs_per_cell); @@ -2631,7 +2633,8 @@ void FEValuesBase::get_function_values ( Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); - Assert (this->update_flags & update_values, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_values, + ExcAccessToUninitializedField("update_values")); AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler()); // get function values of dofs on this cell @@ -2655,7 +2658,8 @@ void FEValuesBase::get_function_values ( // number of function values is generated in each point. Assert (indices.size() % dofs_per_cell == 0, ExcNotMultiple(indices.size(), dofs_per_cell)); - Assert (this->update_flags & update_values, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_values, + ExcAccessToUninitializedField("update_values")); VectorSlice > > val(values); if (indices.size() <= 100) @@ -2688,7 +2692,8 @@ void FEValuesBase::get_function_values ( VectorSlice > > values, bool quadrature_points_fastest) const { - Assert (this->update_flags & update_values, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_values, + ExcAccessToUninitializedField("update_values")); // Size of indices must be a multiple of dofs_per_cell such that an integer // number of function values is generated in each point. @@ -2726,7 +2731,8 @@ FEValuesBase::get_function_gradients ( const InputVector &fe_function, std::vector > &gradients) const { - Assert (this->update_flags & update_gradients, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_gradients, + ExcAccessToUninitializedField("update_gradients")); AssertDimension (fe->n_components(), 1); Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); @@ -2748,7 +2754,8 @@ void FEValuesBase::get_function_gradients ( const VectorSlice > &indices, std::vector > &gradients) const { - Assert (this->update_flags & update_gradients, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_gradients, + ExcAccessToUninitializedField("update_gradients")); AssertDimension (fe->n_components(), 1); AssertDimension (indices.size(), dofs_per_cell); if (dofs_per_cell <= 100) @@ -2779,7 +2786,8 @@ FEValuesBase::get_function_gradients ( const InputVector &fe_function, std::vector > > &gradients) const { - Assert (this->update_flags & update_gradients, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_gradients, + ExcAccessToUninitializedField("update_gradients")); Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler()); @@ -2807,7 +2815,9 @@ void FEValuesBase::get_function_gradients ( // number of function values is generated in each point. Assert (indices.size() % dofs_per_cell == 0, ExcNotMultiple(indices.size(), dofs_per_cell)); - Assert (this->update_flags & update_gradients, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_gradients, + ExcAccessToUninitializedField("update_gradients")); + if (indices.size() <= 100) { double dof_values[100]; @@ -2840,7 +2850,8 @@ get_function_hessians (const InputVector &fe_function, std::vector > &hessians) const { AssertDimension (fe->n_components(), 1); - Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler()); @@ -2861,8 +2872,8 @@ void FEValuesBase::get_function_hessians ( const VectorSlice > &indices, std::vector > &hessians) const { - Assert (this->update_flags & update_second_derivatives, - ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler()); AssertDimension (indices.size(), dofs_per_cell); if (dofs_per_cell <= 100) @@ -2894,7 +2905,8 @@ get_function_hessians (const InputVector &fe_function, std::vector > > &hessians, bool quadrature_points_fastest) const { - Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler()); @@ -2918,8 +2930,8 @@ void FEValuesBase::get_function_hessians ( VectorSlice > > > hessians, bool quadrature_points_fastest) const { - Assert (this->update_flags & update_second_derivatives, - ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); Assert (indices.size() % dofs_per_cell == 0, ExcNotMultiple(indices.size(), dofs_per_cell)); if (indices.size() <= 100) @@ -2952,7 +2964,8 @@ void FEValuesBase::get_function_laplacians ( const InputVector &fe_function, std::vector &laplacians) const { - Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); AssertDimension (fe->n_components(), 1); Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); @@ -2974,7 +2987,8 @@ void FEValuesBase::get_function_laplacians ( const VectorSlice > &indices, std::vector &laplacians) const { - Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); AssertDimension (fe->n_components(), 1); AssertDimension (indices.size(), dofs_per_cell); if (dofs_per_cell <= 100) @@ -3005,7 +3019,8 @@ void FEValuesBase::get_function_laplacians ( { Assert (present_cell.get() != 0, ExcMessage ("FEValues object is not reinit'ed to any cell")); - Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); AssertDimension (fe_function.size(), present_cell->n_dofs_for_dof_handler()); // get function values of dofs on this cell @@ -3029,7 +3044,8 @@ void FEValuesBase::get_function_laplacians ( // number of function values is generated in each point. Assert (indices.size() % dofs_per_cell == 0, ExcNotMultiple(indices.size(), dofs_per_cell)); - Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); if (indices.size() <= 100) { double dof_values[100]; @@ -3064,7 +3080,8 @@ void FEValuesBase::get_function_laplacians ( { Assert (indices.size() % dofs_per_cell == 0, ExcNotMultiple(indices.size(), dofs_per_cell)); - Assert (this->update_flags & update_hessians, ExcAccessToUninitializedField()); + Assert (this->update_flags & update_hessians, + ExcAccessToUninitializedField("update_hessians")); if (indices.size() <= 100) { double dof_values[100]; @@ -3104,7 +3121,7 @@ FEValuesBase::get_normal_vectors () const { typedef FEValuesBase FEVB; Assert (this->update_flags & update_normal_vectors, - typename FEVB::ExcAccessToUninitializedField()); + typename FEVB::ExcAccessToUninitializedField("update_normal_vectors")); return this->normal_vectors; } @@ -3513,7 +3530,7 @@ FEFaceValuesBase::get_boundary_forms () const { typedef FEValuesBase FEVB; Assert (this->update_flags & update_boundary_forms, - typename FEVB::ExcAccessToUninitializedField()); + typename FEVB::ExcAccessToUninitializedField("update_boundary_forms")); return this->boundary_forms; } diff --git a/deal.II/source/fe/mapping_cartesian.cc b/deal.II/source/fe/mapping_cartesian.cc index 814b0385df..6bf62d9315 100644 --- a/deal.II/source/fe/mapping_cartesian.cc +++ b/deal.II/source/fe/mapping_cartesian.cc @@ -604,7 +604,7 @@ MappingCartesian::transform ( case mapping_covariant: { Assert (data.update_flags & update_covariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_covariant_transformation")); for (unsigned int i=0; i::transform ( case mapping_contravariant: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); for (unsigned int i=0; i::transform ( case mapping_piola: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); Assert (data.update_flags & update_volume_elements, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_volume_elements")); for (unsigned int i=0; i::transform ( case mapping_covariant: { Assert (data.update_flags & update_covariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_covariant_transformation")); for (unsigned int i=0; i::transform ( case mapping_contravariant: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); for (unsigned int i=0; i::transform ( case mapping_covariant_gradient: { Assert (data.update_flags & update_covariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_covariant_transformation")); for (unsigned int i=0; i::transform ( case mapping_contravariant_gradient: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); for (unsigned int i=0; i::transform ( case mapping_piola: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); Assert (data.update_flags & update_volume_elements, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_volume_elements")); for (unsigned int i=0; i::transform ( case mapping_piola_gradient: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); Assert (data.update_flags & update_volume_elements, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_volume_elements")); for (unsigned int i=0; i::transform_fields( case mapping_contravariant: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); for (unsigned int i=0; i::transform_fields( case mapping_piola: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); Assert (data.update_flags & update_volume_elements, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_volume_elements")); Assert (rank==1, ExcMessage("Only for rank 1")); if (rank!=1) return; @@ -1258,7 +1258,7 @@ void MappingQ1::transform_fields( case mapping_covariant: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); for (unsigned int i=0; i::transform_gradients( case mapping_contravariant_gradient: { Assert (data.update_flags & update_covariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_covariant_transformation")); Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); Assert (rank==2, ExcMessage("Only for rank 2")); for (unsigned int i=0; i::transform_gradients( case mapping_covariant_gradient: { Assert (data.update_flags & update_covariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_covariant_transformation")); Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); Assert (rank==2, ExcMessage("Only for rank 2")); for (unsigned int i=0; i::transform_gradients( case mapping_piola_gradient: { Assert (data.update_flags & update_covariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_covariant_transformation")); Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); Assert (data.update_flags & update_volume_elements, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_volume_elements")); Assert (rank==2, ExcMessage("Only for rank 2")); for (unsigned int i=0; i::transform_differential_forms( case mapping_covariant: { Assert (data.update_flags & update_contravariant_transformation, - typename FEValuesBase::ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField("update_contravariant_transformation")); for (unsigned int i=0; i