From: Guido Kanschat Date: Wed, 14 Nov 2007 00:18:29 +0000 (+0000) Subject: add support point fields and functions to Mapping and remove some exception classes X-Git-Tag: v8.0.0~9604 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2c181de95471b2c98d580edf7646bfc4837003e;p=dealii.git add support point fields and functions to Mapping and remove some exception classes git-svn-id: https://svn.dealii.org/trunk@15495 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/mapping.h b/deal.II/deal.II/include/fe/mapping.h index 462ea11b14..5dd92c7553 100644 --- a/deal.II/deal.II/include/fe/mapping.h +++ b/deal.II/deal.II/include/fe/mapping.h @@ -15,6 +15,7 @@ #include +#include #include #include #include @@ -217,7 +218,32 @@ class Mapping : public Subscriptor * object. */ virtual unsigned int memory_consumption () const; - + + /** + * The positions of the + * mapped (generalized) + * support points. + */ + std::vector > support_point_values; + + /* + * The Jacobian of the + * transformation in the + * (generalized) support + * points. + */ + std::vector > support_point_gradients; + + /* + * The inverse of the + * Jacobian of the + * transformation in the + * (generalized) support + * points. + */ + std::vector > support_point_inverse_gradients; + + private: /** * The value returned by @@ -336,7 +362,9 @@ class Mapping : public Subscriptor * The transformed (generalized) * support point. */ - const Point& support_point_value(const unsigned int index) const; + const Point& support_point_value( + const unsigned int index, + const typename Mapping::InternalDataBase &internal) const; /** * The Jacobian @@ -344,7 +372,9 @@ class Mapping : public Subscriptor * in the (generalized) support * point. */ - const Tensor<2,dim>& support_point_gradient(const unsigned int index) const; + const Tensor<2,dim>& support_point_gradient( + const unsigned int index, + const typename Mapping::InternalDataBase &internal) const; /** * The inverse Jacobian @@ -352,7 +382,9 @@ class Mapping : public Subscriptor * in the (generalized) support * point. */ - const Tensor<2,dim>& support_point_inverse_gradients(const unsigned int index) const; + const Tensor<2,dim>& support_point_inverse_gradient( + const unsigned int index, + const typename Mapping::InternalDataBase &internal) const; /** * Return a pointer to a copy of the @@ -564,6 +596,43 @@ Mapping::InternalDataBase::clear_first_cell () } + +template +inline +const Point& +Mapping::support_point_value( + const unsigned int index, + const typename Mapping::InternalDataBase& internal) const +{ + AssertIndexRange(index, internal.support_point_values.size()); + return internal.support_point_values[index]; +} + + +template +inline +const Tensor<2,dim>& +Mapping::support_point_gradient( + const unsigned int index, + const typename Mapping::InternalDataBase& internal) const +{ + AssertIndexRange(index, internal.support_point_gradients.size()); + return internal.support_point_gradients[index]; +} + + +template +inline +const Tensor<2,dim>& +Mapping::support_point_inverse_gradient( + const unsigned int index, + const typename Mapping::InternalDataBase& internal) const +{ + AssertIndexRange(index, internal.support_point_inverse_gradients.size()); + return internal.support_point_inverse_gradients[index]; +} + + DEAL_II_NAMESPACE_CLOSE #endif diff --git a/deal.II/deal.II/include/fe/mapping_cartesian.h b/deal.II/deal.II/include/fe/mapping_cartesian.h index 67657e8a18..826b7ee88c 100644 --- a/deal.II/deal.II/include/fe/mapping_cartesian.h +++ b/deal.II/deal.II/include/fe/mapping_cartesian.h @@ -135,16 +135,7 @@ class MappingCartesian : public Mapping */ virtual Mapping * clone () const; - - /** - * Exception - */ - DeclException0 (ExcInvalidData); - /** - * Exception - */ - DeclException0 (ExcAccessToUninitializedField); - + protected: /** * Storage for internal data of diff --git a/deal.II/deal.II/include/fe/mapping_q1.h b/deal.II/deal.II/include/fe/mapping_q1.h index 503b05db91..eba2576ae8 100644 --- a/deal.II/deal.II/include/fe/mapping_q1.h +++ b/deal.II/deal.II/include/fe/mapping_q1.h @@ -258,11 +258,6 @@ class MappingQ1 : public Mapping */ unsigned int n_shape_functions; }; - - /** - * Exception - */ - DeclException0 (ExcAccessToUninitializedField); protected: diff --git a/deal.II/deal.II/source/fe/mapping_cartesian.cc b/deal.II/deal.II/source/fe/mapping_cartesian.cc index be00a08b44..2a0d0010c9 100644 --- a/deal.II/deal.II/source/fe/mapping_cartesian.cc +++ b/deal.II/deal.II/source/fe/mapping_cartesian.cc @@ -455,7 +455,7 @@ MappingCartesian::transform_covariant ( const InternalData &data = dynamic_cast (mapping_data); Assert (data.update_flags & update_covariant_transformation, - ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField()); Assert (output.size() + offset <= input.size(), ExcInternalError()); @@ -479,7 +479,7 @@ MappingCartesian::transform_covariant ( const InternalData &data = dynamic_cast (mapping_data); Assert (data.update_flags & update_covariant_transformation, - ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField()); Assert (output.size() + offset <= input.size(), ExcInternalError()); @@ -508,7 +508,7 @@ MappingCartesian::transform_contravariant ( const InternalData &data = dynamic_cast (mapping_data); Assert (data.update_flags & update_contravariant_transformation, - ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField()); Assert (output.size() + offset <= input.size(), ExcInternalError()); @@ -536,7 +536,7 @@ MappingCartesian::transform_contravariant ( const InternalData &data = dynamic_cast (mapping_data); Assert (data.update_flags & update_contravariant_transformation, - ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField()); Assert (output.size() + offset <= input.size(), ExcInternalError()); diff --git a/deal.II/deal.II/source/fe/mapping_q1.cc b/deal.II/deal.II/source/fe/mapping_q1.cc index 180a2847d0..49d1c05311 100644 --- a/deal.II/deal.II/source/fe/mapping_q1.cc +++ b/deal.II/deal.II/source/fe/mapping_q1.cc @@ -841,7 +841,7 @@ MappingQ1::transform_covariant ( const InternalData &data=*data_ptr; Assert (data.update_flags & update_covariant_transformation, - ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField()); Assert (output.size() + offset <= input.size(), ExcInternalError()); @@ -864,7 +864,7 @@ MappingQ1::transform_covariant ( const InternalData &data=*data_ptr; Assert (data.update_flags & update_covariant_transformation, - ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField()); Assert (output.size() + offset <= input.size(), ExcInternalError()); @@ -888,7 +888,7 @@ transform_contravariant ( const InternalData &data=*data_ptr; Assert (data.update_flags & update_contravariant_transformation, - ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField()); Assert (output.size() + offset <= input.size(), ExcInternalError()); @@ -911,7 +911,7 @@ MappingQ1::transform_contravariant ( const InternalData &data=*data_ptr; Assert (data.update_flags & update_contravariant_transformation, - ExcAccessToUninitializedField()); + typename FEValuesBase::ExcAccessToUninitializedField()); Assert (output.size() + offset <= input.size(), ExcInternalError());