Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled > Class Template Reference

Class representing a (possibly scaled) monomial. More...

#include <monomial.hpp>

Inheritance diagram for vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >:
[legend]
Collaboration diagram for vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >:
[legend]

Public Member Functions

constexpr Monomial ()
 Constructor for the zero monomial.
constexpr Monomial (const CoefType &coeff)
 Constructor for the constant monomial.
constexpr Monomial (const std::array< IndexType, Dim > &exponent, const CoefType &coefficient)
 Constructor for a general non-scaled monomial.
constexpr Monomial (const std::array< IndexType, Dim > &exponent, const CoefType &coefficient, const CoefType &scaling, const std::array< IndexType, Dim > &translation)
 Constructor for a general scaled monomial.
constexpr CoefType evaluate (const Eigen::Vector< CoefType, Dim > &point) const
 Evaluate the monomial in a point.
constexpr CoefType evaluate (const CoefType *point) const
 Evaluate the monomial in a point passed as a raw buffer.
constexpr Monomial derivative (std::size_t component) const
 Compute the derivative.
constexpr bool empty () const
 Check if it is the zero monomial.
constexpr Eigen::Vector< Monomial, Dim > gradient () const
 Compute the gradient of the monomial.
template<typename U>
Monomial< Dim, IndexType, U, IsScaled > to () const
 Cast the monomial to a different underlying type.
template<std::size_t PreDim, std::size_t PostDim>
Monomial< Dim+PreDim+PostDim, IndexType, CoefType, IsScaled > liftDimension () const
const auto & coef () const
const auto & exp () const

Protected Attributes

std::array< IndexType, Dim > m_exponent
CoefType m_coefficient

Friends

class polynomial::SparsePolynomial< Dim, IndexType, CoefType, IsScaled >
std::ostream & operator<< (std::ostream &os, const Monomial &monomial)
 Output operator.
constexpr bool operator== (const Monomial &lhs, const Monomial &rhs)
 Equality operator.
constexpr bool operator< (const Monomial &lhs, const Monomial &rhs)
 Less operator.

Detailed Description

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
class vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >

Class representing a (possibly scaled) monomial.

This class offers the possibility to work with monomials and scaled monomials, that are monomials of the form \((\frac{x - x_0)}{h})^\alpha\).

Constructor & Destructor Documentation

◆ Monomial() [1/4]

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >::Monomial ( )
inlineconstexpr

Constructor for the zero monomial.

◆ Monomial() [2/4]

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >::Monomial ( const CoefType & coeff)
inlineexplicitconstexpr

Constructor for the constant monomial.

◆ Monomial() [3/4]

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >::Monomial ( const std::array< IndexType, Dim > & exponent,
const CoefType & coefficient )
inlineconstexpr

Constructor for a general non-scaled monomial.

◆ Monomial() [4/4]

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >::Monomial ( const std::array< IndexType, Dim > & exponent,
const CoefType & coefficient,
const CoefType & scaling,
const std::array< IndexType, Dim > & translation )
inlineconstexpr

Constructor for a general scaled monomial.

Member Function Documentation

◆ coef()

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
const auto & vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >::coef ( ) const
inline

◆ derivative()

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
Monomial vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >::derivative ( std::size_t component) const
inlineconstexpr

Compute the derivative.

If the monomial is scaled is expressed as linear combination of scaled monomials with same scaling

◆ empty()

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
bool vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >::empty ( ) const
inlineconstexpr

Check if it is the zero monomial.

◆ evaluate() [1/2]

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
CoefType vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >::evaluate ( const CoefType * point) const
inlineconstexpr

Evaluate the monomial in a point passed as a raw buffer.

◆ evaluate() [2/2]

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
CoefType vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >::evaluate ( const Eigen::Vector< CoefType, Dim > & point) const
inlineconstexpr

Evaluate the monomial in a point.

◆ exp()

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
const auto & vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >::exp ( ) const
inline

◆ gradient()

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
Eigen::Vector< Monomial, Dim > vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >::gradient ( ) const
inlineconstexpr

Compute the gradient of the monomial.

◆ liftDimension()

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
template<std::size_t PreDim, std::size_t PostDim>
Monomial< Dim+PreDim+PostDim, IndexType, CoefType, IsScaled > vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >::liftDimension ( ) const
inline

◆ to()

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
template<typename U>
Monomial< Dim, IndexType, U, IsScaled > vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >::to ( ) const
inline

Cast the monomial to a different underlying type.

◆ operator<

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
bool operator< ( const Monomial< Dim, IndexType, CoefType, IsScaled > & lhs,
const Monomial< Dim, IndexType, CoefType, IsScaled > & rhs )
friend

Less operator.

First compares exponents lexicographically, than the coefficients, than the scaling factors and finally the translation lexicographically

◆ operator<<

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
std::ostream & operator<< ( std::ostream & os,
const Monomial< Dim, IndexType, CoefType, IsScaled > & monomial )
friend

Output operator.

◆ operator==

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
bool operator== ( const Monomial< Dim, IndexType, CoefType, IsScaled > & lhs,
const Monomial< Dim, IndexType, CoefType, IsScaled > & rhs )
friend

Equality operator.

◆ polynomial::SparsePolynomial< Dim, IndexType, CoefType, IsScaled >

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
friend class polynomial::SparsePolynomial< Dim, IndexType, CoefType, IsScaled >
friend

Member Data Documentation

◆ m_coefficient

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
CoefType vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >::m_coefficient
protected

◆ m_exponent

template<std::size_t Dim, typename IndexType, typename CoefType, bool IsScaled>
std::array<IndexType, Dim> vulpes::monomial::Monomial< Dim, IndexType, CoefType, IsScaled >::m_exponent
protected

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