From: hartmann Date: Mon, 27 Aug 2001 11:55:28 +0000 (+0000) Subject: Replace global MappingQ1 object by the static function FEValuesBase::get_default... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a33e78397e30ef2f699cceae6026e2a57cbe67b4;p=dealii-svn.git Replace global MappingQ1 object by the static function FEValuesBase::get_default_mapping that returns reference to the default MappingQ1 object. git-svn-id: https://svn.dealii.org/trunk@4918 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe_values.h b/deal.II/deal.II/include/fe/fe_values.h index 713505d481..56102a5eb0 100644 --- a/deal.II/deal.II/include/fe/fe_values.h +++ b/deal.II/deal.II/include/fe/fe_values.h @@ -634,6 +634,15 @@ class FEValuesBase : protected FEValuesData * argument. */ UpdateFlags compute_update_flags (const UpdateFlags update_flags) const; + + /** + * Returns reference to default + * @p{MappingQ1} object. Needed + * by constructors of derived + * classes that uses + * @p{MappingQ1} implicitely. + */ + static const Mapping &get_default_mapping(); }; @@ -1032,7 +1041,7 @@ FEValuesBase::get_mapping () const } -/*------------------------ Inline functions: FEFaceValuesBase --------------------*/ +/*------------------------ Inline functions: FEValues ----------------------------*/ template @@ -1043,7 +1052,6 @@ FEValues::get_quadrature () const }; - /*------------------------ Inline functions: FEFaceValuesBase --------------------*/ diff --git a/deal.II/deal.II/source/fe/fe_values.cc b/deal.II/deal.II/source/fe/fe_values.cc index c293fc008f..2a199b945a 100644 --- a/deal.II/deal.II/source/fe/fe_values.cc +++ b/deal.II/deal.II/source/fe/fe_values.cc @@ -32,9 +32,6 @@ using namespace std; #endif -// TODO:[RH,GK] replace this by non-global object -static const MappingQ1 mapping_q1; - template void FEValuesData::initialize (const unsigned int n_quadrature_points, @@ -472,6 +469,15 @@ FEValuesBase::compute_update_flags (const UpdateFlags update_flags) const +template +const Mapping & +FEValuesBase::get_default_mapping () +{ + static const MappingQ1 mapping_q1; + return mapping_q1; +} + + /*------------------------------- FEValues -------------------------------*/ @@ -504,7 +510,7 @@ FEValues::FEValues (const FiniteElement &fe, fe.dofs_per_cell, 1, update_default, - mapping_q1, + get_default_mapping(), fe), quadrature (q) { @@ -663,7 +669,7 @@ FEFaceValues::FEFaceValues (const FiniteElement &fe, fe.dofs_per_cell, GeometryInfo::faces_per_cell, update_flags, - mapping_q1, + get_default_mapping(), fe, quadrature) { Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping")); @@ -757,7 +763,7 @@ FESubfaceValues::FESubfaceValues (const FiniteElement &fe, GeometryInfo::faces_per_cell * GeometryInfo::subfaces_per_face, update_flags, - mapping_q1, + get_default_mapping(), fe, quadrature) { Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));