From: Ralf Hartmann Date: Tue, 21 Feb 2006 15:22:10 +0000 (+0000) Subject: New StaticMappingQ1::mapping_collection object. X-Git-Tag: v8.0.0~12242 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1971a36cf7739b65b642554ada55fd15da6650e;p=dealii.git New StaticMappingQ1::mapping_collection object. git-svn-id: https://svn.dealii.org/trunk@12440 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/mapping_collection.h b/deal.II/deal.II/include/fe/mapping_collection.h index aad3e64755..80f972f37d 100644 --- a/deal.II/deal.II/include/fe/mapping_collection.h +++ b/deal.II/deal.II/include/fe/mapping_collection.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include @@ -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 + struct StaticMappingQ1 + { + static MappingCollection mapping_collection; + }; + /* --------------- inline functions ------------------- */ diff --git a/deal.II/deal.II/source/fe/mapping_collection.cc b/deal.II/deal.II/source/fe/mapping_collection.cc index e728e81ad1..055c746d00 100644 --- a/deal.II/deal.II/source/fe/mapping_collection.cc +++ b/deal.II/deal.II/source/fe/mapping_collection.cc @@ -74,9 +74,14 @@ namespace hp .push_back (boost::shared_ptr >(new_mapping.clone())); } +//--------------------------------------------------------------------------- + + + template MappingCollection + StaticMappingQ1::mapping_collection(::StaticMappingQ1::mapping); // explicit instantiations template class MappingCollection; - + template struct StaticMappingQ1; }