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::Polynomial< Poly, PolySetType, Container > Class Template Reference

#include <polynomial.hpp>

Detailed Description

template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
class Feel::Polynomial< Poly, PolySetType, Container >

polynomial class

The polynomial is expressed in the basis from Poly. The coefficients of the polynomial in this basis are represented by a matrix whose lines are the polymomial components coefficients (1 if

is_scalar == true

, nDim if

is_vectorial ==
* true

and columns are the basis

Evaluating the polynomial at a set of points(or just one point) is then simply a matrix-matrix product.

Author
Christophe Prud'homme
See Also

Public Member Functions

Constructors, destructor
 Polynomial ()
 
 Polynomial (Poly const &__poly)
 
 Polynomial (Poly const &__poly, container_type const &__coeff, bool __as_is=false)
 
 Polynomial (container_type const &__coeff, bool __as_is=false)
 
template<class AE >
 Polynomial (Poly const &__poly, ublas::matrix_expression< AE > const &__coeff, bool __as_is=false)
 
 Polynomial (Polynomial const &p)
 
 ~Polynomial ()
 
Operator overloads
self_type const & operator= (self_type const &__p)
 
self_type const & operator-= (self_type const &__p)
 
self_type const & operator() (self_type const &__p) const
 
component_type operator[] (int i) const
 extract the i-th component of a vectorial polynomial More...
 
matrix_type operator() (node_type const &__x) const
 
matrix_type operator() (points_type const &__pts) const
 
Accessors
bool isZero () const
 
matrix_type const & coeff () const
 
matrix_type const & coefficients () const
 
basis_type const & basis () const
 
Mutators
void setCoefficient (matrix_type const &__c, bool __as_is=false)
 
Methods
matrix_type evaluate (node_type const &__x) const
 
matrix_type evaluate (points_type 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
 
matrix_type const & d (uint16_type i) const
 differentiation matrix of Dubiner polynomials the derivatives are computed at the nodes of the lattice More...
 
self_type derivative (uint16_type l) const
 
PolynomialSet< Poly, PolySetType > toSet (bool asis=false) const
 

Static Public Attributes

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

Typedefs

typedef Polynomial< Poly,
PolySetType > 
self_type
 
typedef Poly::value_type value_type
 
typedef Poly::basis_type basis_type
 
typedef PolySetType< nDim > polyset_type
 
typedef Component
< polyset_type >::type 
component_type
 
typedef Polynomial< Poly, Scalarscalar_component_type
 
typedef basis_type::points_type points_type
 
typedef basis_type::matrix_type matrix_type
 
typedef Container container_type
 
typedef node< value_type >::type node_type
 
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
 
 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))
 

Constructor & Destructor Documentation

template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
Feel::Polynomial< Poly, PolySetType, Container >::Polynomial ( )
inline

default constructor

template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
Feel::Polynomial< Poly, PolySetType, Container >::Polynomial ( Poly const &  __poly)
inline

constructor giving only the underlying basis

Parameters
__polypolynomial whose we take the basis
template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
Feel::Polynomial< Poly, PolySetType, Container >::Polynomial ( Poly const &  __poly,
container_type const &  __coeff,
bool  __as_is = false 
)
inline

constructor giving the underlying basis and the coefficient of the polynomial in the basis

Parameters
__polypolynomial whose we take the basis
__coeffcoefficients of the polynomial in the basis

References Feel::Polynomial< Poly, PolySetType, Container >::setCoefficient().

template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
Feel::Polynomial< Poly, PolySetType, Container >::Polynomial ( container_type const &  __coeff,
bool  __as_is = false 
)
inline

constructor giving the underlying basis and the coefficient of the polynomial in the basis

Parameters
__coeffcoefficients of the polynomial in the basis

References Feel::Polynomial< Poly, PolySetType, Container >::setCoefficient().

template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
template<class AE >
Feel::Polynomial< Poly, PolySetType, Container >::Polynomial ( Poly const &  __poly,
ublas::matrix_expression< AE > const &  __coeff,
bool  __as_is = false 
)
inline

constructor giving the underlying basis and the coefficient of the polynomial in the basis

Parameters
__polypolynomial whose we take the basis
__coeffcoefficients of the polynomial in the basis

References Feel::Polynomial< Poly, PolySetType, Container >::setCoefficient().

Member Function Documentation

template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
basis_type const& Feel::Polynomial< Poly, PolySetType, Container >::basis ( ) const
inline
Returns
the basis in which the polynomial is expressed
template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
matrix_type const& Feel::Polynomial< Poly, PolySetType, Container >::coeff ( ) const
inline
Returns
the dof
template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
matrix_type const& Feel::Polynomial< Poly, PolySetType, Container >::coefficients ( ) const
inline
Returns
the dof
template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
matrix_type const& Feel::Polynomial< Poly, PolySetType, Container >::d ( uint16_type  i) const
inline

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

  • i index of the derivative (0 : x, 1 : y, 2 : z )
template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
self_type Feel::Polynomial< Poly, PolySetType, Container >::derivative ( uint16_type  l) const
inline

derivative of the polynomial in the l-th direction

Parameters
ldirection of derivation
Returns
the derivative of the polynomial
template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
matrix_type Feel::Polynomial< Poly, PolySetType, Container >::evaluate ( node_type const &  __x) const
inline

Evaluate polynomial at point __x

Parameters
__xthe coordinate of the point
Returns
the evaluation of the polynomial at point __x
template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
matrix_type Feel::Polynomial< Poly, PolySetType, Container >::evaluate ( points_type const &  __pts) const
inline

Evaluate polynomial at points __pts

Parameters
__ptsthe matrix of coordinates of the points
Returns
the evaluation of the polynomial at point __x
template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
bool Feel::Polynomial< Poly, PolySetType, Container >::isZero ( ) const
inline
Returns
true if the polynomial set is zero, false otherwise
template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
matrix_type Feel::Polynomial< Poly, PolySetType, Container >::operator() ( node_type const &  __x) const
inline

Evaluate polynomial at point __x

Parameters
__xthe coordinate of the point
Returns
the evaluation of the polynomial at point __x
template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
matrix_type Feel::Polynomial< Poly, PolySetType, Container >::operator() ( points_type const &  __pts) const
inline

Evaluate polynomial at points __pts

Parameters
__ptsthe matrix of coordinates of the points
Returns
the evaluation of the polynomial at point __x
template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
component_type Feel::Polynomial< Poly, PolySetType, Container >::operator[] ( int  i) const
inline

extract the i-th component of a vectorial polynomial

Returns
the i-th component of the polynomial

References Feel::project().

template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
void Feel::Polynomial< Poly, PolySetType, Container >::setCoefficient ( matrix_type const &  __c,
bool  __as_is = false 
)
inline

set the coefficient of the polynomial in the basis.

template<typename Poly, template< uint16_type > class PolySetType = Scalar, typename Container = typename Poly::basis_type::matrix_type>
PolynomialSet<Poly,PolySetType> Feel::Polynomial< Poly, PolySetType, Container >::toSet ( bool  asis = false) const
inline

transform a Polynomial into a PolynomialSet with one polynomial

Returns
a PolynomialSet

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

Generated on Sun Dec 22 2013 13:11:21 for Feel++ by doxygen 1.8.5