]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Replace global MappingQ1 object by the static function FEValuesBase<dim>::get_default...
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 27 Aug 2001 11:55:28 +0000 (11:55 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 27 Aug 2001 11:55:28 +0000 (11:55 +0000)
git-svn-id: https://svn.dealii.org/trunk@4918 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 713505d48121e0e6799fe1f542976c26c94c24ce..56102a5eb0e1b23ac62a578ea36e458eb87f6ece 100644 (file)
@@ -634,6 +634,15 @@ class FEValuesBase : protected FEValuesData<dim>
                                      * 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<dim> &get_default_mapping();
 };
 
 
@@ -1032,7 +1041,7 @@ FEValuesBase<dim>::get_mapping () const
 }
 
 
-/*------------------------ Inline functions: FEFaceValuesBase --------------------*/
+/*------------------------ Inline functions: FEValues ----------------------------*/
 
 
 template <int dim>
@@ -1043,7 +1052,6 @@ FEValues<dim>::get_quadrature () const
 };
 
 
-
 /*------------------------ Inline functions: FEFaceValuesBase --------------------*/
 
 
index c293fc008f3c508f77c42e38ed1c1488ee3aa8fe..2a199b945a02fa3eaeba33983d72ad4e2d6f85fc 100644 (file)
@@ -32,9 +32,6 @@ using namespace std;
 #endif
 
 
-// TODO:[RH,GK] replace this by non-global object
-static const MappingQ1<deal_II_dimension> mapping_q1;
-
 template <int dim>
 void
 FEValuesData<dim>::initialize (const unsigned int n_quadrature_points,
@@ -472,6 +469,15 @@ FEValuesBase<dim>::compute_update_flags (const UpdateFlags update_flags) const
 
 
 
+template <int dim>
+const Mapping<dim> &
+FEValuesBase<dim>::get_default_mapping ()
+{
+  static const MappingQ1<dim> mapping_q1;
+  return mapping_q1;
+}
+
+
 /*------------------------------- FEValues -------------------------------*/
 
 
@@ -504,7 +510,7 @@ FEValues<dim>::FEValues (const FiniteElement<dim> &fe,
                                   fe.dofs_per_cell,
                                   1,
                                   update_default,
-                                  mapping_q1,
+                                  get_default_mapping(),
                                   fe),
                 quadrature (q)
 {
@@ -663,7 +669,7 @@ FEFaceValues<dim>::FEFaceValues (const FiniteElement<dim> &fe,
                                       fe.dofs_per_cell,
                                       GeometryInfo<dim>::faces_per_cell,
                                       update_flags,
-                                      mapping_q1,
+                                      get_default_mapping(),
                                       fe, quadrature)
 {
   Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));
@@ -757,7 +763,7 @@ FESubfaceValues<dim>::FESubfaceValues (const FiniteElement<dim> &fe,
                                       GeometryInfo<dim>::faces_per_cell *
                                       GeometryInfo<dim>::subfaces_per_face,
                                       update_flags,
-                                      mapping_q1,
+                                      get_default_mapping(),
                                       fe, quadrature)
 {
   Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping"));

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.