]> https://gitweb.dealii.org/ - dealii.git/commitdiff
QCollection::max_n_quadrature_points
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 5 May 2006 17:11:21 +0000 (17:11 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 5 May 2006 17:11:21 +0000 (17:11 +0000)
git-svn-id: https://svn.dealii.org/trunk@13070 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/q_collection.h

index 0716b270a332b18acc0d4b8002ce4a8ca27d7849..0be7a119b564a0b94a455e5b00f0b56275b19f59 100644 (file)
@@ -111,6 +111,21 @@ namespace hp
                                         */
       unsigned int size () const;
     
+                                       /**
+                                        * Return the maximum number of
+                                        * quadrature points over all
+                                        * the elements of the
+                                        * collection. This is mostly
+                                        * useful to initialize arrays
+                                        * to allocate the maxmimum
+                                        * amount of memory that may be
+                                        * used when re-sizing later on
+                                        * to a articular quadrature
+                                        * formula from within this
+                                        * collection.
+                                        */
+      unsigned int max_n_quadrature_points () const;
+      
                                        /**
                                         * Determine an estimate for the
                                         * memory consumption (in bytes)
@@ -146,6 +161,24 @@ namespace hp
 
 
 
+  template <int dim>
+  inline
+  unsigned int
+  QCollection<dim>::max_n_quadrature_points () const 
+  {
+    Assert (quadratures.size() > 0,
+            ExcMessage ("You can't call this function for an empty collection"));
+    
+    unsigned int m = 0;
+    for (unsigned int i=0; i<quadratures.size(); ++i)
+      if (quadratures[i]->n_quadrature_points > m)
+        m = quadratures[i]->n_quadrature_points;
+    
+    return m;
+  }
+
+
+
   template <int dim>
   inline
   const Quadrature<dim> &

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.