Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
Polynomials::Hierarchical Class Reference

#include <polynomial.h>

Inheritance diagram for Polynomials::Hierarchical:
[legend]

Public Member Functions

 Hierarchical (const unsigned int p)
 
- Public Member Functions inherited from Polynomials::Polynomial< double >
 Polynomial (const std::vector< double > &coefficients)
 
 Polynomial (const unsigned int n)
 
 Polynomial (const std::vector< Point< 1 > > &lagrange_support_points, const unsigned int evaluation_point)
 
 Polynomial ()
 
double value (const doublex) const
 
void value (const doublex, std::vector< double > &values) const
 
unsigned int degree () const
 
void scale (const doublefactor)
 
void shift (const number2 offset)
 
Polynomial< doublederivative () const
 
Polynomial< doubleprimitive () const
 
Polynomial< double > & operator*= (const double s)
 
Polynomial< double > & operator*= (const Polynomial< double > &p)
 
Polynomial< double > & operator+= (const Polynomial< double > &p)
 
Polynomial< double > & operator-= (const Polynomial< double > &p)
 
bool operator== (const Polynomial< double > &p) const
 
void print (std::ostream &out) const
 
void serialize (Archive &ar, const unsigned int version)
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
void subscribe (const char *identifier=0) const
 
void unsubscribe (const char *identifier=0) const
 
unsigned int n_subscriptions () const
 
void list_subscribers () const
 
 DeclException3 (ExcInUse, int, char *, std::string &,<< "Object of class "<< arg2<< " is still used by "<< arg1<< " other objects.\n"<< "(Additional information: "<< arg3<< ")\n"<< "Note the entry in the Frequently Asked Questions of "<< "deal.II (linked to from http://www.dealii.org/) for "<< "more information on what this error means.")
 
 DeclException2 (ExcNoSubscriber, char *, char *,<< "No subscriber with identifier \""<< arg2<< "\" did subscribe to this object of class "<< arg1)
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Static Public Member Functions

static std::vector< Polynomial
< double > > 
generate_complete_basis (const unsigned int degree)
 

Static Private Member Functions

static void compute_coefficients (const unsigned int p)
 
static const std::vector
< double > & 
get_coefficients (const unsigned int p)
 

Static Private Attributes

static std::vector
< std_cxx1x::shared_ptr< const
std::vector< double > > > 
recursive_coefficients
 

Additional Inherited Members

- Protected Member Functions inherited from Polynomials::Polynomial< double >
void transform_into_standard_form ()
 
- Static Protected Member Functions inherited from Polynomials::Polynomial< double >
static void scale (std::vector< double > &coefficients, const doublefactor)
 
static void shift (std::vector< double > &coefficients, const number2 shift)
 
static void multiply (std::vector< double > &coefficients, const doublefactor)
 
- Protected Attributes inherited from Polynomials::Polynomial< double >
std::vector< doublecoefficients
 
bool in_lagrange_product_form
 
std::vector< doublelagrange_support_points
 
double lagrange_weight
 

Detailed Description

Hierarchical polynomials of arbitrary degree on [0,1].

When Constructing a Hierarchical polynomial of degree p, the coefficients will be computed by a recursion formula. The coefficients are stored in a static data vector to be available when needed next time.

These hierarchical polynomials are based on those of Demkowicz, Oden, Rachowicz, and Hardy (CMAME 77 (1989) 79-112, Sec. 4). The first two polynomials are the standard linear shape functions given by $\phi_{0}(x) = 1 - x$ and $\phi_{1}(x) = x$. For $l \geq 2$ we use the definitions $\phi_{l}(x) = (2x-1)^l - 1, l = 2,4,6,...$ and $\phi_{l}(x) = (2x-1)^l - (2x-1), l = 3,5,7,...$. These satisfy the recursion relations $\phi_{l}(x) = (2x-1)\phi_{l-1}, l=3,5,7,...$ and $\phi_{l}(x) = (2x-1)\phi_{l-1} + \phi_{2}, l=4,6,8,...$.

The degrees of freedom are the values at the vertices and the derivatives at the midpoint. Currently, we do not scale the polynomials in any way, although better conditioning of the element stiffness matrix could possibly be achieved with scaling.

Calling the constructor with a given index p will generate the following: if p==0, then the resulting polynomial is the linear function associated with the left vertex, if p==1 the one associated with the right vertex. For higher values of p, you get the polynomial of degree p that is orthogonal to all previous ones. Note that for p==0 you therefore do not get a polynomial of degree zero, but one of degree one. This is to allow generating a complete basis for polynomial spaces, by just iterating over the indices given to the constructor.

On the other hand, the function generate_complete_basis() creates a complete basis of given degree. In order to be consistent with the concept of a polynomial degree, if the given argument is zero, it does not return the linear polynomial described above, but rather a constant polynomial.

Author
Brian Carnes, 2002

Definition at line 534 of file polynomial.h.

Constructor & Destructor Documentation

Polynomials::Hierarchical::Hierarchical ( const unsigned int  p)

Constructor for polynomial of degree p. There is an exception for p==0, see the general documentation.

Member Function Documentation

static std::vector<Polynomial<double> > Polynomials::Hierarchical::generate_complete_basis ( const unsigned int  degree)
static

Return a vector of Hierarchical polynomial objects of degrees zero through degree, which then spans the full space of polynomials up to the given degree. Note that there is an exception if the given degree equals zero, see the general documentation of this class.

This function may be used to initialize the TensorProductPolynomials, AnisotropicPolynomials, and PolynomialSpace classes.

static void Polynomials::Hierarchical::compute_coefficients ( const unsigned int  p)
staticprivate

Compute coefficients recursively.

static const std::vector<double>& Polynomials::Hierarchical::get_coefficients ( const unsigned int  p)
staticprivate

Get coefficients for constructor. This way, it can use the non-standard constructor of Polynomial.

Member Data Documentation

std::vector<std_cxx1x::shared_ptr<const std::vector<double> > > Polynomials::Hierarchical::recursive_coefficients
staticprivate

Vector with already computed coefficients. For each degree of the polynomial, we keep one pointer to the list of coefficients; we do so rather than keeping a vector of vectors in order to simplify programming multithread-safe. In order to avoid memory leak, we use a shared_ptr in order to correctly free the memory of the vectors when the global destructor is called.

Definition at line 597 of file polynomial.h.


The documentation for this class was generated from the following file: