From a63dd08c2be4227681bbb154cb5fc81bb61abe87 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Mon, 7 Feb 2005 15:56:38 +0000 Subject: [PATCH] public compute_n_pols function git-svn-id: https://svn.dealii.org/trunk@9900 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/polynomial_space.h | 18 +++++++++--------- deal.II/base/include/base/polynomials_bdm.h | 13 ++++++++++++- deal.II/base/source/polynomials_bdm.cc | 12 ++++++++++-- 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/deal.II/base/include/base/polynomial_space.h b/deal.II/base/include/base/polynomial_space.h index 522d8ffda2..ceb2fc5e85 100644 --- a/deal.II/base/include/base/polynomial_space.h +++ b/deal.II/base/include/base/polynomial_space.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2000, 2001, 2002, 2003, 2004 by the deal.II authors +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -166,8 +166,15 @@ class PolynomialSpace * never checked and therefore * left to the application. */ - unsigned int degree () const; + unsigned int degree () const; + /** + * Static function used in the + * constructor to compute the + * number of polynomials. + */ + static unsigned int compute_n_pols (const unsigned int n); + protected: /** @@ -208,13 +215,6 @@ class PolynomialSpace * polynomials. */ std::vector index_map_inverse; - - /** - * Static function used in the - * constructor to compute the - * number of polynomials. - */ - static unsigned int compute_n_pols (const unsigned int n); }; /// @if NoDoc diff --git a/deal.II/base/include/base/polynomials_bdm.h b/deal.II/base/include/base/polynomials_bdm.h index fec9a05198..058c7a74bf 100644 --- a/deal.II/base/include/base/polynomials_bdm.h +++ b/deal.II/base/include/base/polynomials_bdm.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2004 by the deal.II authors +// Copyright (C) 2004, 2005 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -194,6 +194,17 @@ class PolynomialsBDM */ unsigned int degree () const; + /** + * Return the number of + * polynomials in the space + * BDM(degree) without + * requiring to build an object + * of PolynomialsBDM. This is + * required by the FiniteElement + * classes. + */ + static unsigned int compute_n_pols(unsigned int degree); + private: /** * An object representing the diff --git a/deal.II/base/source/polynomials_bdm.cc b/deal.II/base/source/polynomials_bdm.cc index 2dc82866fb..fc249addfc 100644 --- a/deal.II/base/source/polynomials_bdm.cc +++ b/deal.II/base/source/polynomials_bdm.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2004 by the deal.II authors +// Copyright (C) 2004, 2005 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -24,7 +24,7 @@ PolynomialsBDM::PolynomialsBDM (const unsigned int k) : polynomial_space (Polynomials::Legendre::generate_complete_basis(k)), monomials(1), - n_pols(dim * polynomial_space.n()+2), + n_pols(compute_n_pols(k)), p_values(polynomial_space.n()), p_grads(polynomial_space.n()), p_grad_grads(polynomial_space.n()) @@ -191,5 +191,13 @@ PolynomialsBDM::compute_node_matrix (Table<2,double>& A) const } +template +unsigned int +PolynomialsBDM::compute_n_pols(unsigned int k) +{ + return dim*PolynomialSpace::compute_n_pols(k)+2; +} + + template class PolynomialsBDM<2>; -- 2.39.5