From: Wolfgang Bangerth Date: Fri, 5 May 2006 17:11:21 +0000 (+0000) Subject: QCollection::max_n_quadrature_points X-Git-Tag: v8.0.0~11755 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b70477aca020db82240511c2bb6b5e17e8c8112d;p=dealii.git QCollection::max_n_quadrature_points git-svn-id: https://svn.dealii.org/trunk@13070 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/q_collection.h b/deal.II/deal.II/include/fe/q_collection.h index 0716b270a3..0be7a119b5 100644 --- a/deal.II/deal.II/include/fe/q_collection.h +++ b/deal.II/deal.II/include/fe/q_collection.h @@ -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 + inline + unsigned int + QCollection::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; in_quadrature_points > m) + m = quadratures[i]->n_quadrature_points; + + return m; + } + + + template inline const Quadrature &