From da1ed741655e7958209c5115ba83955e7c5687c7 Mon Sep 17 00:00:00 2001 From: guido Date: Thu, 19 May 2005 17:20:46 +0000 Subject: [PATCH] copied from bdm and first changes git-svn-id: https://svn.dealii.org/trunk@10692 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/base/polynomials_raviart_thomas.h | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 deal.II/base/include/base/polynomials_raviart_thomas.h diff --git a/deal.II/base/include/base/polynomials_raviart_thomas.h b/deal.II/base/include/base/polynomials_raviart_thomas.h new file mode 100644 index 0000000000..95025e45c0 --- /dev/null +++ b/deal.II/base/include/base/polynomials_raviart_thomas.h @@ -0,0 +1,148 @@ +//--------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// 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 +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//--------------------------------------------------------------------------- +#ifndef __deal2__polynomials_raviart_thomas_h +#define __deal2__polynomials_raviart_thomas_h + + +#include +#include +#include +#include +#include +#include +#include + +#include + + +/** + * This class implements the Hdiv-conforming, + * vector-valued Raviart-Thomas polynomials as described in the + * book by Brezzi and Fortin. + * + * The Raviart-Thomas polynomials are constructed such that the + * divergence is in the tensor product polynomial space + * Qk. Therefore, the polynomial order of each + * component must be one order higher in the corresponding direction, + * yielding the polynomial spaces (Qk+1,k, + * Qk,k+1) and (Qk+1,k,k, + * Qk,k+1,k, Qk,k,k+1) in 2D and 3D, resp. + * + * @author Guido Kanschat, 2005 + */ +template +class PolynomialsRaviartThomas +{ + public: + /** + * Constructor. Creates all basis + * functions for Raviart-Thomas polynomials + * of given degree. + * + * @arg k: the degree of the + * Raviart-Thomas-space, which is the degree + * of the largest tensor product + * polynomial space + * Qk contained. + */ + PolynomialsRaviartThomas (const unsigned int k); + + /** + * Computes the value and the + * first and second derivatives + * of each Raviart-Thomas + * polynomial at @p unit_point. + * + * The size of the vectors must + * either be zero or equal + * n(). In the + * first case, the function will + * not compute these values. + * + * If you need values or + * derivatives of all tensor + * product polynomials then use + * this function, rather than + * using any of the + * compute_value, + * compute_grad or + * compute_grad_grad + * functions, see below, in a + * loop over all tensor product + * polynomials. + */ + void compute (const Point &unit_point, + std::vector > &values, + std::vector > &grads, + std::vector > &grad_grads) const; + + /** + * Returns the number of Raviart-Thomas polynomials. + */ + unsigned int n () const; + + /** + * Returns the degree of the Raviart-Thomas + * space, which is one less than + * the highest polynomial degree. + */ + unsigned int degree () const; + + /** + * Return the number of + * polynomials in the space + * RT(degree) without + * requiring to build an object + * of PolynomialsRaviartThomas. This is + * required by the FiniteElement + * classes. + */ + static unsigned int compute_n_pols(unsigned int degree); + + private: + /** + * An object representing the + * onedimensional polynomial + * space used here. + */ + const PolynomialSpace<1> polynomial_space; + + /** + * Number of Raviart-Thomas + * polynomials. + */ + unsigned int n_pols; + + /** + * Auxiliary memory. + */ + mutable std::vector p_values; +}; + + + +template +inline unsigned int +PolynomialsRaviartThomas::n() const +{ + return n_pols; +} + +template +inline unsigned int +PolynomialsRaviartThomas::degree() const +{ + return polynomial_space.degree() - 1; +} + +#endif -- 2.39.5