]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Work around a possible problem with the ordering of constructor calls to
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 7 Mar 2006 05:41:07 +0000 (05:41 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 7 Mar 2006 05:41:07 +0000 (05:41 +0000)
::StaticMappingQ1 and hp::StaticMappingQ1.

git-svn-id: https://svn.dealii.org/trunk@12546 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 2a3da26b744e6d9ba10683b5e13fa5831834ed2f..e1bc9eda17427a17a327935f3a65e6d5bc66adae 100644 (file)
@@ -134,12 +134,32 @@ namespace hp
 /**
  * In order to avoid creation of static MappingQ1 objects at several
  * places in the library (in particular in backward compatibility
- * functions), we define a static MappingQ1 objects once and for all
- * places where it is needed.
+ * functions), we define a static collection of mappings with a single
+ * MappingQ1 mapping object once and for all places where it is
+ * needed.
  */
   template <int dim>
   struct StaticMappingQ1
   {
+    private:
+                                       /**
+                                        * A static MappingQ1
+                                        * object. We can't use the one
+                                        * in ::StaticMappingQ1 since
+                                        * we can't make sure that the
+                                        * constructor for that object
+                                        * is run before the
+                                        * constructor for the present
+                                        * static object.
+                                        */
+      static MappingQ1<dim> mapping_q1;
+      
+    public:
+                                       /**
+                                        * The publicly available
+                                        * static Q1 mapping collection
+                                        * object.
+                                        */
       static MappingCollection<dim> mapping_collection;
   };
 
index f001b536dd4c44e071ee68b2e5481165086a8167..8f0a99dc274f72f8f232f734362c25f3279afa99 100644 (file)
@@ -76,10 +76,16 @@ namespace hp
 //---------------------------------------------------------------------------
 
 
+
+  template <int dim>
+  MappingQ1<dim>
+  StaticMappingQ1<dim>::mapping_q1;
+  
+
   template <int dim>
   MappingCollection<dim>
   StaticMappingQ1<dim>::mapping_collection
-  = MappingCollection<dim>(::StaticMappingQ1<dim>::mapping);
+  = MappingCollection<dim>(mapping_q1);
 
 // explicit instantiations
   template class MappingCollection<deal_II_dimension>;

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.