PTEMS  0.1.0-dev+git.81fd0e4
PolyTopic Element Method Solver
ptems::HierarchicalPolynomials< OneDPolynomials, DIM > Struct Template Reference

Base type for a set of hierarchical polynomials on space of dimension >= 2. More...

#include <ptems/spaces/hierarchicalpolynomials.hpp>

Inheritance diagram for ptems::HierarchicalPolynomials< OneDPolynomials, DIM >:
Collaboration diagram for ptems::HierarchicalPolynomials< OneDPolynomials, DIM >:

Static Public Member Functions

template<typename T >
static T * Polynomials (const ReferenceElement< DIM > &refElement, const Vector< DIM > &pt, T *result, std::size_t polydeg)
 Computes the value of the first N hierarchical polynomials on the reference element, where N is the result of NumberDoFs(refElement, polydeg). More...
 
template<typename T >
static FuncAndGradData< DIM, T > * Gradient (const ReferenceElement< DIM > &refElement, const Vector< DIM > &pt, FuncAndGradData< DIM, T > *result, std::size_t polydeg)
 Computes the value of the first N hierarchical polynomials, and their first order derivatives, on the reference element, where N is the result of NumberDoFs(refElement, polydeg). More...
 
template<typename T >
static FuncGradAndHessianData< DIM, T > * Hessian (const ReferenceElement< DIM > &refElement, const Vector< DIM > &pt, FuncGradAndHessianData< DIM, T > *result, std::size_t polydeg)
 Computes the value of the first N hierarchical polynomials, and their first and second order derivatives, on the reference element, where N is the result of NumberDoFs(refElement, polydeg). More...
 
static std::vector< std::size_tIndices (const ReferenceElement< DIM > &refElement, std::size_t originalPolydeg, std::size_t newPolydeg)
 Gets the indices of the subset of the basis for polynomial degree originalPolydeg which form the basis for polynomial degree newPolydeg. More...
 

Detailed Description

template<typename OneDPolynomials, std::size_t DIM>
struct ptems::HierarchicalPolynomials< OneDPolynomials, DIM >

Base type for a set of hierarchical polynomials on space of dimension >= 2.

Most hierarchical polynomials are defined identically on higher dimensions based purely on their one dimensional definition. This class extracts this commonality.

Template Parameters
OneDPolynomialsThe type for the one dimensional polynomials
DIMThe dimension of the polynomials

Member Function Documentation

◆ Gradient()

template<typename OneDPolynomials , std::size_t DIM>
template<typename T >
static FuncAndGradData<DIM,T>* ptems::HierarchicalPolynomials< OneDPolynomials, DIM >::Gradient ( const ReferenceElement< DIM > &  refElement,
const Vector< DIM > &  pt,
FuncAndGradData< DIM, T > *  result,
std::size_t  polydeg 
)
inlinestatic

Computes the value of the first N hierarchical polynomials, and their first order derivatives, on the reference element, where N is the result of NumberDoFs(refElement, polydeg).

Template Parameters
TThe type of the result
Parameters
refElementReference element - either the reference square or triangle
ptThe point to compute the values of the hierarchical polynomial at
resultArray of at least NumberDoFs(refElement, polydeg) entries, to store the result into
polydegThe polynomial degree of the hierarchical basis functions
Returns
Pointer to the entry AFTER the last basis filled (=result+N where N is the number of basis functions depending on the reference element)

◆ Hessian()

template<typename OneDPolynomials , std::size_t DIM>
template<typename T >
static FuncGradAndHessianData<DIM,T>* ptems::HierarchicalPolynomials< OneDPolynomials, DIM >::Hessian ( const ReferenceElement< DIM > &  refElement,
const Vector< DIM > &  pt,
FuncGradAndHessianData< DIM, T > *  result,
std::size_t  polydeg 
)
inlinestatic

Computes the value of the first N hierarchical polynomials, and their first and second order derivatives, on the reference element, where N is the result of NumberDoFs(refElement, polydeg).

Template Parameters
TThe type of the result
Parameters
refElementReference element - either the reference square or triangle
ptThe point to compute the values of the hierarchical polynomial at
resultArray of at least NumberDoFs(refElement, polydeg) entries, to store the result into
polydegThe polynomial degree of the hierarchical basis functions
Returns
Pointer to the entry AFTER the last basis filled (=result+N where N is the number of basis functions depending on the reference element)

◆ Indices()

template<typename OneDPolynomials , std::size_t DIM>
static std::vector<std::size_t> ptems::HierarchicalPolynomials< OneDPolynomials, DIM >::Indices ( const ReferenceElement< DIM > &  refElement,
std::size_t  originalPolydeg,
std::size_t  newPolydeg 
)
inlinestatic

Gets the indices of the subset of the basis for polynomial degree originalPolydeg which form the basis for polynomial degree newPolydeg.

Note
For hierarchical polynomials the polynomials of order newPolydeg are contained within the set of polynomials of order originalPolydeg
Exceptions
std::invalid_argumentIf newPolydeg > originalPolydeg
Parameters
refElementThe reference element the bases are defined on
originalPolydegThe polynomial degree of the original basis
newPolydegThe polynomial degree of the smaller basis to get the indices of
Returns
Map of indices for the smaller basis to the original larger basis index

◆ Polynomials()

template<typename OneDPolynomials , std::size_t DIM>
template<typename T >
static T* ptems::HierarchicalPolynomials< OneDPolynomials, DIM >::Polynomials ( const ReferenceElement< DIM > &  refElement,
const Vector< DIM > &  pt,
T *  result,
std::size_t  polydeg 
)
inlinestatic

Computes the value of the first N hierarchical polynomials on the reference element, where N is the result of NumberDoFs(refElement, polydeg).

Template Parameters
TThe type of the result
Parameters
refElementReference element
ptThe point to compute the values of the hierarchical polynomial at
resultArray of at least NumberDoFs(refElement, polydeg) entries, to store the result into
polydegThe polynomial degree of the hierarchical basis functions
Returns
Pointer to the entry AFTER the last basis filled (=result+N where N is the number of basis functions depending on the reference element)

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