Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Feel::PolynomialSet< Poly, PolySetType > Class Template Reference

#include <polynomialset.hpp>

Detailed Description

template<typename Poly, template< uint16_type > class PolySetType>
class Feel::PolynomialSet< Poly, PolySetType >

a Set of polynomials

This class represents a set of polynomials $ {p_i}_{i=1...N} $ defined in a certain basis given by the template argument. The coefficients of the polynomials in the basis are represented by a matrix whose line represents the polynomials and columns the basis index $ C_{i,j} = \mathcal{R}( p_i)_j $ where $\mathcal{R}$ is the mapping between the polynomial and its coefficients. We have that the polynomial set is represented as follows:

\[p_i = \sum_j=1^N \mathcal{R}( p_i )_j \phi_j\]

Author
Christophe Prud'homme
See Also

Public Types

typedef std::vector< std::map
< typename
convex_type::permutation_type,
precompute_ptrtype > > 
faces_precompute_type
 
typedef boost::shared_ptr
< precompute_type
precompute_ptrtype
 
typedef PreCompute precompute_type
 

Public Member Functions

template<size_type context_v, size_type context_g, typename BasisType , typename GeoType , typename ElementType >
boost::shared_ptr< Context
< context_v, BasisType,
GeoType, ElementType > > 
context (boost::shared_ptr< BasisType > b, boost::shared_ptr< GeoType > gm, precompute_ptrtype &pc)
 
template<int contextv, int contextg, typename BasisType , typename GeoType , typename ElementType >
boost::shared_ptr< Context
< contextv, BasisType, GeoType,
ElementType > > 
ctx (boost::shared_ptr< BasisType > const &b, boost::shared_ptr< typename GeoType::template Context< contextg, ElementType > > const &gm, precompute_ptrtype pc, ElementType &e)
 
template<int contextv, typename BasisType , typename GeoType , typename ElementType >
boost::shared_ptr< Context
< contextv, BasisType, GeoType,
ElementType > > 
ctx (boost::shared_ptr< BasisType > const &b, boost::shared_ptr< typename GeoType::template Context< contextv, ElementType > > const &gm, precompute_ptrtype pc, ElementType &e)
 
precompute_ptrtype preCompute (self_ptrtype p, points_type const &P)
 
std::vector< std::map
< typename
convex_type::permutation_type,
precompute_ptrtype > > 
preComputeOnFaces (self_ptrtype p, points_type const &P)
 
Constructors, destructor
 PolynomialSet ()
 
 PolynomialSet (Poly const &p)
 
 PolynomialSet (Poly const &p, matrix_type const &c, bool __as_is=false)
 
 PolynomialSet (matrix_type const &c, bool __as_is=false)
 
 PolynomialSet (PolynomialSet const &p)
 
virtual ~PolynomialSet ()
 
Operator overloads
self_typeoperator= (self_type const &pset)
 
component_type operator[] (uint16_type i) const
 extract the i-th component of a vectorial polynomial set More...
 
Mutators
void setCoefficient (matrix_type const &__c, bool __as_is=false)
 
Methods
PolynomialSet< Poly, PolySetType > polynomials (std::vector< uint16_type > const &list_p) const
 
PolynomialSet< Poly, PolySetType > polynomialsUpToDimension (int dim_p) const
 
PolynomialSet< Poly, PolySetType > polynomialsRange (uint16_type dim_bot, uint16_type dim_top) const
 
Polynomial< Poly, PolySetType > polynomial (uint16_type i) const
 
template<typename AE >
ublas::vector< value_type > evaluate (uint16_type i, ublas::vector_expression< AE > const &__pt) const
 
template<typename AE >
ublas::matrix< value_type > evaluate (ublas::vector_expression< AE > const &__pt) const
 
template<typename AE >
matrix_type evaluate (ublas::matrix_expression< AE > const &__pts) const
 
matrix_type const & d (uint16_type i) const
 derivatives of Dubiner polynomials the derivatives are computed at the nodes of the lattice More...
 
matrix_type d (uint16_type i, uint16_type j) const
 
self_type derivate (uint16_type l) const
 Derivate with respect to the l-th direction. More...
 
template<typename AE >
ublas::vector< matrix_type > derivate (ublas::matrix_expression< AE > const &pts) const
 
template<typename AE >
matrix_type derivate (uint16_type i, ublas::matrix_expression< AE > const &pts) const
 
template<typename AE >
matrix_type derivate (uint16_type i, uint16_type j, ublas::matrix_expression< AE > const &pts) const
 
gradient_polynomialset_type gradient () const
 
gradient_polynomialset_type gradient (mpl::int_< 0 >) const
 
gradient_polynomialset_type gradient (mpl::int_< 1 >) const
 
uint16_type nbDof () const
 
void insert (PolynomialSet< Poly, PolySetType > const &p, bool erase=false)
 

Static Public Attributes

Constants
static const uint16_type nDim = Poly::nDim
 
static const uint16_type nRealDim = Poly::nRealDim
 
static const uint16_type nOrder = Poly::nOrder
 

Typedefs

typedef PolynomialSet< Poly,
PolySetType > 
self_type
 
typedef boost::shared_ptr
< self_type
self_ptrtype
 
typedef Poly::value_type value_type
 
typedef Poly::basis_type basis_type
 
typedef PolySetType< nRealDim > polyset_type
 
typedef PolynomialSet< Poly,
Scalar
component_type
 
typedef Polynomial< Poly,
PolySetType > 
polynomial_type
 
typedef polynomial_type polynomial_view_type
 
typedef Poly::convex_type convex_type
 
typedef basis_type::matrix_type matrix_type
 
typedef basis_type::points_type points_type
 
typedef PolynomialSet< Poly,
Vectorial
gradient_polynomialset_type
 
static const bool is_product = Poly::is_product
 
static const bool is_tensor2 = polyset_type::is_tensor2
 
static const bool is_vectorial = polyset_type::is_vectorial
 
static const bool is_scalar = polyset_type::is_scalar
 
static const uint16_type nComponents = polyset_type::nComponents
 
static const uint16_type nComponents1 = polyset_type::nComponents1
 
static const uint16_type nComponents2 = polyset_type::nComponents2
 
static const uint16_type rank = polyset_type::rank
 
 BOOST_STATIC_ASSERT ((boost::is_same< typename matrix_type::value_type, value_type >::value))
 
 BOOST_STATIC_ASSERT ((boost::is_same< typename matrix_type::value_type, typename points_type::value_type >::value))
 

Accessors

uint16_type degree () const
 
matrix_type const & coeff () const
 
basis_type const & basis () const
 
size_type polynomialDimension () const
 
size_type polynomialDimensionPerComponent () const
 
bool isZero () const
 
virtual std::string familyName () const
 
std::string name (std::string sep=".") const
 
static bool isScalar ()
 
static bool isVectorial ()
 
static uint16_type numberOfComponents ()
 

Member Typedef Documentation

template<typename Poly, template< uint16_type > class PolySetType>
typedef PreCompute Feel::PolynomialSet< Poly, PolySetType >::precompute_type

class PreCompute

Member Function Documentation

template<typename Poly, template< uint16_type > class PolySetType>
basis_type const& Feel::PolynomialSet< Poly, PolySetType >::basis ( ) const
inline
Returns
the basis associated with the polynomial set
template<typename Poly, template< uint16_type > class PolySetType>
matrix_type const& Feel::PolynomialSet< Poly, PolySetType >::coeff ( ) const
inline
Returns
coefficient of the polynomials of the polynomial set in the basis associated with Poly
template<typename Poly, template< uint16_type > class PolySetType>
matrix_type const& Feel::PolynomialSet< Poly, PolySetType >::d ( uint16_type  i) const
inline

derivatives of Dubiner polynomials the derivatives are computed at the nodes of the lattice

Derivate with respect to the $\ell$ coordinates at the nodes where the polynomials basis have been constructed.

We construct the matrix

\begin{eqnarray*} A_{i,j} &= \frac{\partial p_i(x_j)}{\partial x_\ell}\\ &= \sum_{k=1}^N \mathcal{R}(p_i)_k \frac{\partial \phi_k(x_j)}{\partial x_\ell} \end{eqnarray*}

  • l the derivation index $\ell$
  • __pts a column oriented matrix contained the node coordinates (in the columns).
Returns
the matrix $A$
  • i index of the derivative (0 : x, 1 : y, 2 : z )
template<typename Poly, template< uint16_type > class PolySetType>
uint16_type Feel::PolynomialSet< Poly, PolySetType >::degree ( ) const
inline
Returns
the degree of the polynomials in the set
template<typename Poly, template< uint16_type > class PolySetType>
self_type Feel::PolynomialSet< Poly, PolySetType >::derivate ( uint16_type  l) const
inline

Derivate with respect to the l-th direction.

Returns
the polynomial set associated with the derivation in the l-direction
template<typename Poly, template< uint16_type > class PolySetType>
template<typename AE >
ublas::vector<value_type> Feel::PolynomialSet< Poly, PolySetType >::evaluate ( uint16_type  i,
ublas::vector_expression< AE > const &  __pt 
) const
inline

evaluate the i-th polynomial at node __pt

Warning
this function is not efficient at all, the preferred method is to evaluate at a set of points
template<typename Poly, template< uint16_type > class PolySetType>
template<typename AE >
ublas::matrix<value_type> Feel::PolynomialSet< Poly, PolySetType >::evaluate ( ublas::vector_expression< AE > const &  __pt) const
inline

evaluate all polynomials at node __pt

Returns
a column matrix
template<typename Poly, template< uint16_type > class PolySetType>
template<typename AE >
matrix_type Feel::PolynomialSet< Poly, PolySetType >::evaluate ( ublas::matrix_expression< AE > const &  __pts) const
inline

evaluate all polynomials of the set at a set of nodes

Constructs $A_{i,j} = p_i(x_j) = \sum_{k=1}^N \mathcal{R}(p_i)_k \phi_k(x_j)$

  • __pts a column oriented matrix contained the node coordinates (in the columns).
Returns
the matrix $A$
template<typename Poly, template< uint16_type > class PolySetType>
virtual std::string Feel::PolynomialSet< Poly, PolySetType >::familyName ( ) const
inlinevirtual

the familyName() identifies the finite element

Returns
the family name of a finite element
template<typename Poly, template< uint16_type > class PolySetType>
gradient_polynomialset_type Feel::PolynomialSet< Poly, PolySetType >::gradient ( ) const
inline

Gradient of the polynomial set

Computes the gradient of the polynomial set.

template<typename Poly, template< uint16_type > class PolySetType>
void Feel::PolynomialSet< Poly, PolySetType >::insert ( PolynomialSet< Poly, PolySetType > const &  p,
bool  erase = false 
)
inline

insert the polynomial set p at the end of the set

template<typename Poly, template< uint16_type > class PolySetType>
static bool Feel::PolynomialSet< Poly, PolySetType >::isScalar ( )
inlinestatic
Returns
true if the polynomial set is scalar, false otherwise
template<typename Poly, template< uint16_type > class PolySetType>
static bool Feel::PolynomialSet< Poly, PolySetType >::isVectorial ( )
inlinestatic
Returns
true if the polynomial set is vectorial, false otherwise
template<typename Poly, template< uint16_type > class PolySetType>
bool Feel::PolynomialSet< Poly, PolySetType >::isZero ( ) const
inline
Returns
true if the polynomial set is zero, false otherwise
template<typename Poly, template< uint16_type > class PolySetType>
std::string Feel::PolynomialSet< Poly, PolySetType >::name ( std::string  sep = ".") const
inline

the name of a finite element is a string composed by:

  1. a prefix which identifies the family (eg lagrange)
  2. the dimension
  3. the order of the finite element
Parameters
sepseparator between family name, dimension and order (by default it is '.')
Returns
the name of the finite element
template<typename Poly, template< uint16_type > class PolySetType>
uint16_type Feel::PolynomialSet< Poly, PolySetType >::nbDof ( ) const
inline
Returns
the number of degrees of freedom
template<typename Poly, template< uint16_type > class PolySetType>
component_type Feel::PolynomialSet< Poly, PolySetType >::operator[] ( uint16_type  i) const
inline

extract the i-th component of a vectorial polynomial set

Returns
the i-th component of the polynomial set
template<typename Poly, template< uint16_type > class PolySetType>
Polynomial<Poly, PolySetType> Feel::PolynomialSet< Poly, PolySetType >::polynomial ( uint16_type  i) const
inline

Extract the i -th polynomial

Parameters
iindex of the polynomial to extract
Returns
the polynomial extracted
template<typename Poly, template< uint16_type > class PolySetType>
size_type Feel::PolynomialSet< Poly, PolySetType >::polynomialDimension ( ) const
inline
Returns
the polynomial dimension
template<typename Poly, template< uint16_type > class PolySetType>
size_type Feel::PolynomialSet< Poly, PolySetType >::polynomialDimensionPerComponent ( ) const
inline
Returns
the polynomial dimension per component
template<typename Poly, template< uint16_type > class PolySetType>
PolynomialSet<Poly, PolySetType> Feel::PolynomialSet< Poly, PolySetType >::polynomials ( std::vector< uint16_type > const &  list_p) const
inline

Extract the polynomials whose indices are listed in list_p

Parameters
list_plist of indices of polynomials to extract
Returns
the polynomial set extracted
template<typename Poly, template< uint16_type > class PolySetType>
PolynomialSet<Poly, PolySetType> Feel::PolynomialSet< Poly, PolySetType >::polynomialsRange ( uint16_type  dim_bot,
uint16_type  dim_top 
) const
inline

Extract the polynomials between dimension dim_bot up to dimension dim_top

Parameters
dim_botpolynomial dimension
dim_toppolynomial dimension
Returns
the polynomial set extracted
template<typename Poly, template< uint16_type > class PolySetType>
PolynomialSet<Poly, PolySetType> Feel::PolynomialSet< Poly, PolySetType >::polynomialsUpToDimension ( int  dim_p) const
inline

Extract the polynomials up to dimension dim

Parameters
dim_ppolynomial dimension
Returns
the polynomial set extracted
template<typename Poly, template< uint16_type > class PolySetType>
void Feel::PolynomialSet< Poly, PolySetType >::setCoefficient ( matrix_type const &  __c,
bool  __as_is = false 
)
inline

set the coefficient of the polynomial set in the basis.


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

Generated on Sun Oct 20 2013 08:25:09 for Feel++ by doxygen 1.8.4