From 82a1cb45946cddb4dea5f5f720d6b826145ac533 Mon Sep 17 00:00:00 2001 From: guido Date: Thu, 19 May 2005 07:00:00 +0000 Subject: [PATCH] clean up and document BDM polynomials git-svn-id: https://svn.dealii.org/trunk@10690 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/include/base/polynomials_bdm.h | 142 +++++--------------- deal.II/base/source/polynomials_bdm.cc | 14 +- 2 files changed, 43 insertions(+), 113 deletions(-) diff --git a/deal.II/base/include/base/polynomials_bdm.h b/deal.II/base/include/base/polynomials_bdm.h index d4b832ca4d..2dff0f9e6d 100644 --- a/deal.II/base/include/base/polynomials_bdm.h +++ b/deal.II/base/include/base/polynomials_bdm.h @@ -28,15 +28,30 @@ /** * @brief The set of BDM polynomials on tensor product cells * - * This class implements the Hdiv-conforming, + * This class implements the Hdiv-conforming, * vector-valued Brezzi-Douglas-Marini polynomials as described in the * book by Brezzi and Fortin. * - * Right now, they are implemented in two dimensions only. There, they - * consist of the complete polynomial space of degree $p$ plus two - * additional vectors. + * These polynomial spaces are based on the space + * Pk, realized by a PolynomialSpace constructed + * with Legendre polynomials. Since these shape functions are not + * sufficient, additional functions are added. These are the following + * vector valued polynomials: * - * @author Guido Kanschat, 2003 + *
+ *
In 2D: + *
The 2D-curl of the functions xk+1y + * and xyk+1. + *
In 3D: + *
For any i=0,...,k the curls of + * (0,0,xyi+1zk-i), + * (0,xk-iyzi+1,0) and + * (xi+1yk-iz,0,0) + *
+ * + * Right now, they are implemented in two dimensions only. + * + * @author Guido Kanschat, 2003, 2005 */ template class PolynomialsBDM @@ -47,15 +62,14 @@ class PolynomialsBDM * functions for BDM polynomials * of given degree. * - * Remark that the degree of a - * BDM space is the degree of the - * largest complete polynomial - * space embedded. - * - * @arg p: the degree of the - * BDM-space + * @arg k: the degree of the + * BDM-space, which is the degree + * of the largest complete + * polynomial space + * Pk contained + * in the BDM-space. */ - PolynomialsBDM (const unsigned int p); + PolynomialsBDM (const unsigned int k); /** * Computes the value and the @@ -84,103 +98,7 @@ class PolynomialsBDM void compute (const Point &unit_point, std::vector > &values, std::vector > &grads, - std::vector > &grad_grads) const; - - /** - * Computes the value of the - * ith BDM - * polynomial at - * unit_point. - * - * Note, that using this function - * within a loop over all tensor - * product polynomials is not - * efficient, because then each - * point value of the underlying - * (one-dimensional) polynomials - * is (unnecessarily) computed - * several times. Instead use - * the compute function, see - * above, with - * values.size()==n_tensor_pols - * to get the point values of all - * tensor polynomials all at once - * and in a much more efficient - * way. - */ - Tensor<1,dim> compute_value (const unsigned int i, - const Point &p) const; - - /** - * Computes the grad of the - * ith tensor product - * polynomial at - * unit_point. Here i is - * given in tensor product - * numbering. - * - * Note, that using this function - * within a loop over all tensor - * product polynomials is not - * efficient, because then each - * derivative value of the - * underlying (one-dimensional) - * polynomials is (unnecessarily) - * computed several times. - * Instead use the compute - * function, see above, with - * grads.size()==n_tensor_pols - * to get the point value of all - * tensor polynomials all at once - * and in a much more efficient - * way. - */ - Tensor<2,dim> compute_grad (const unsigned int i, - const Point &p) const; - - /** - * Computes the second - * derivative (grad_grad) of the - * ith tensor product - * polynomial at - * unit_point. Here i is - * given in tensor product - * numbering. - * - * Note, that using this function - * within a loop over all tensor - * product polynomials is not - * efficient, because then each - * derivative value of the - * underlying (one-dimensional) - * polynomials is (unnecessarily) - * computed several times. - * Instead use the compute - * function, see above, with - * grad_grads.size()==n_tensor_pols - * to get the point value of all - * tensor polynomials all at once - * and in a much more efficient - * way. - */ - Tensor<3,dim> compute_grad_grad (const unsigned int i, - const Point &p) const; - - /** - * Compute the matrix that has as - * its entry - * aij the node - * functional i evaluated - * for basis function - * j. The node functionals - * are the standard BDM - * interpolation operators. - * - * The inverse of this matrix can - * be used to interpolate node - * values to BDM polynomials. - */ - void compute_node_matrix (Table<2,double>&) const; + std::vector > &grad_grads) const; /** * Returns the number of BDM polynomials. @@ -229,10 +147,12 @@ class PolynomialsBDM * Auxiliary memory. */ mutable std::vector p_values; + /** * Auxiliary memory. */ mutable std::vector > p_grads; + /** * Auxiliary memory. */ @@ -252,7 +172,7 @@ template inline unsigned int PolynomialsBDM::degree() const { - return polynomial_space.degree() - 1; + return polynomial_space.degree(); } #endif diff --git a/deal.II/base/source/polynomials_bdm.cc b/deal.II/base/source/polynomials_bdm.cc index 7e5e76c7d3..4213d9ffea 100644 --- a/deal.II/base/source/polynomials_bdm.cc +++ b/deal.II/base/source/polynomials_bdm.cc @@ -124,6 +124,7 @@ PolynomialsBDM::compute (const Point &unit_point, } +/* template void PolynomialsBDM::compute_node_matrix (Table<2,double>& A) const @@ -189,15 +190,24 @@ PolynomialsBDM::compute_node_matrix (Table<2,double>& A) const Assert (polynomial_space.degree() <= 2, ExcNotImplemented()); } - +*/ template unsigned int PolynomialsBDM::compute_n_pols(unsigned int k) { - return dim*PolynomialSpace::compute_n_pols(k)+2; + if (dim == 1) + return PolynomialSpace::compute_n_pols(k)+1; + if (dim == 2) + return 2*PolynomialSpace::compute_n_pols(k)+2; + if (dim == 3) + return 3*PolynomialSpace::compute_n_pols(k)+3*(k+1); + Assert(false, ExcNotImplemented()); + return 0; } +template class PolynomialsBDM<1>; template class PolynomialsBDM<2>; +template class PolynomialsBDM<3>; -- 2.39.5