]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Further simplify the interface, by removing the single_quadrature hack in QCollection...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 23 Feb 2006 21:18:34 +0000 (21:18 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 23 Feb 2006 21:18:34 +0000 (21:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@12483 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 6b3ea115c584bd2c02d01134531719f169fa92e0..7f53a4c7de7ad7995a62435f593e2f479398aa8f 100644 (file)
@@ -155,6 +155,18 @@ namespace hp
   {
     return mappings.size();
   }
+
+
+
+  template <int dim>
+  inline
+  const Mapping<dim> &
+  MappingCollection<dim>::operator[] (const unsigned int index) const
+  {
+    Assert (index < mappings.size (),
+            ExcIndexRange (index, 0, mappings.size ()));
+    return *mappings[index];
+  }
   
 } // namespace hp
 
index c16a7479f18b01d50ec31369d435183bd84a0da1..b438427ccd82f4821bbf4a69dfb997a8dab336ec 100644 (file)
@@ -129,21 +129,6 @@ namespace hp
       DeclException0 (ExcNoQuadrature);
     
     private:
-                                       /**
-                                        * Upon construction of a
-                                        * <tt>QCollection</tt> the later
-                                        * functionality of the class is
-                                        * specified.  Either it is a real
-                                        * collection, which provides different
-                                        * quadrature rules for each
-                                        * active_fe_index or its a "unreal"
-                                        * collection, which returns a the same
-                                        * quadrature rule for all
-                                        * active_fe_indices.  This boolean
-                                        * remembers which type this object is.
-                                        */
-      const bool single_quadrature;
-
                                        /**
                                         * The real container, which stores
                                         * pointers to the different quadrature
@@ -163,6 +148,18 @@ namespace hp
   {
     return quadratures.size();
   }
+
+
+
+  template <int dim>
+  inline
+  const Quadrature<dim> &
+  QCollection<dim>::operator[] (const unsigned int index) const
+  {
+    Assert (index < quadratures.size (),
+           ExcIndexRange (index, 0, quadratures.size ()));
+    return *quadratures[index];
+  }
   
 } // namespace hp
 
index a19695dc8cde34f6b5a0a7449f3ea83d18fb7329..93f54861d00a50fa8094def55bef32bb899c19ed 100644 (file)
@@ -55,17 +55,6 @@ namespace hp
   
   
 
-  template <int dim>
-  inline
-  const Mapping<dim> &
-  MappingCollection<dim>::operator[] (const unsigned int index) const
-  {
-    Assert (index < mappings.size (),
-            ExcIndexRange (index, 0, mappings.size ()));
-    return *mappings[index];
-  }
-
-
   template <int dim>
   unsigned int
   MappingCollection<dim>::memory_consumption () const
@@ -74,6 +63,7 @@ namespace hp
            MemoryConsumption::memory_consumption (mappings));
   }
 
+  
 
   template <int dim>
   void
index 29332fbd66abd3cd4b71355530b572e25f7d2ca6..a8066cc9e5ea536dc18ea2ac7e04d1a3512bb68c 100644 (file)
@@ -21,16 +21,11 @@ namespace hp
   
   template <int dim>
   QCollection<dim>::QCollection ()
-                  :
-                  single_quadrature (false)
-  {
-  }
+  {}
 
 
   template <int dim>
   QCollection<dim>::QCollection (const Quadrature<dim> &quadrature)
-                  :
-                  single_quadrature (true)
   {
     quadratures
       .push_back (boost::shared_ptr<const Quadrature<dim> >(new Quadrature<dim>(quadrature)));
@@ -54,31 +49,11 @@ namespace hp
                                                    // last one to die
                                                    // will delete the
                                                    // mappings
-                  quadratures (q_collection.quadratures),
-                 single_quadrature (true)
+                  quadratures (q_collection.quadratures)
   {}
 
 
 
-  template <int dim>
-  const Quadrature<dim> &
-  QCollection<dim>::operator[] (const unsigned int index) const
-  {
-                                     // if we have only a single quadrature
-                                     // that was given during construction,
-                                     // return this one. otherwise pick out
-                                     // the correct one
-    if (single_quadrature)
-      return *quadratures[0];
-    else
-      {
-       Assert (index < quadratures.size (),
-               ExcIndexRange (index, 0, quadratures.size ()));
-       return *quadratures[index];
-      }
-  }
-
-
   template <int dim>
   unsigned int
   QCollection<dim>::memory_consumption () const
@@ -92,11 +67,6 @@ namespace hp
   void
   QCollection<dim>::push_back (const Quadrature<dim> &new_quadrature)
   {
-                                     // A QCollection, which was initialized
-                                     // as single QCollection cannot
-                                     // administrate other Quadratures.
-    Assert (!single_quadrature, ExcNotInitialized ());
-
     quadratures
       .push_back (boost::shared_ptr<const Quadrature<dim> >(new Quadrature<dim>(new_quadrature)));
   }

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.