From b70477aca020db82240511c2bb6b5e17e8c8112d Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 5 May 2006 17:11:21 +0000 Subject: [PATCH] QCollection::max_n_quadrature_points git-svn-id: https://svn.dealii.org/trunk@13070 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/q_collection.h | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) 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 & -- 2.39.5