]> https://gitweb.dealii.org/ - dealii.git/commitdiff
New StaticMappingQ1::mapping_collection object.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Tue, 21 Feb 2006 15:22:10 +0000 (15:22 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Tue, 21 Feb 2006 15:22:10 +0000 (15:22 +0000)
git-svn-id: https://svn.dealii.org/trunk@12440 0785d39b-7218-0410-832d-ea1e28bc413d

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

index aad3e64755395112a21dbfafe132642e32d05805..80f972f37dfcdc4096cc23ecab6c1795c9753382 100644 (file)
@@ -15,7 +15,7 @@
 
 #include <base/config.h>
 #include <base/subscriptor.h>
-#include <fe/mapping.h>
+#include <fe/mapping_q1.h>
 #include <fe/fe.h>
 
 #include <vector>
@@ -132,6 +132,18 @@ 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.
+ */
+  template <int dim>
+  struct StaticMappingQ1
+  {
+      static MappingCollection<dim> mapping_collection;
+  };
+
 
 /* --------------- inline functions ------------------- */
 
index e728e81ad1bc091408568f1a32ef632a19e4c81b..055c746d00852adda02f05971aabb7f5bb23363c 100644 (file)
@@ -74,9 +74,14 @@ namespace hp
       .push_back (boost::shared_ptr<const Mapping<dim> >(new_mapping.clone()));
   }
 
+//---------------------------------------------------------------------------
+
+
+  template <int dim> MappingCollection<dim>
+  StaticMappingQ1<dim>::mapping_collection(::StaticMappingQ1<dim>::mapping);
 
 // explicit instantiations
   template class MappingCollection<deal_II_dimension>;
-
+  template struct StaticMappingQ1<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.