Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim > Class Template Reference

Class that wraps a user-provided function. More...

#include <fe_expr_func.hpp>

Inheritance diagram for vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >:
[legend]
Collaboration diagram for vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >:
[legend]

Public Types

using OutputType
using FuncT = std::function<OutputType(const Eigen::Vector<double, Dim>&)>
using FeSpaceType
 Type of the associated Finite Element Space.

Public Member Functions

constexpr FeExpressionFunctionWrapper (const FuncT &func, std::size_t order)
 FeExpressionFunctionWrapper (const FeExpressionFunctionWrapper &)=delete
FeExpressionFunctionWrapper & operator= (const FeExpressionFunctionWrapper &)=delete
 FeExpressionFunctionWrapper (FeExpressionFunctionWrapper &&)=delete
FeExpressionFunctionWrapper & operator= (FeExpressionFunctionWrapper &&)=delete
template<std::size_t J = 0, std::size_t I = 0>
decltype(auto) evaluate (const FeValues< Dim > &, std::size_t, std::size_t, std::size_t q) const
constexpr UpdateFlagsType computeUpdateFlags () const
constexpr std::size_t computeOrder () const
constexpr bool precompute (const FeValues< Dim > &fe_values, const CellsType< Dim > &) const
constexpr const auto & feSpace () const
 Get the associated Finite Element Space.
decltype(auto) evaluatePoly (const FeValues< Dim > &fe_values, std::size_t j, std::size_t i, std::size_t bi, std::size_t bj) const
 Compute the polynomial associated to the expression for basis i and j and block bi and bj.
decltype(auto) evaluatePolyCoef (const auto &mapping, const auto &fe_values, std::size_t bi, std::size_t bj) const
 Compute the coefficients of the polynomial associated to the expression for basis i and j and block bi and bj.
constexpr FeExpressionUnaryMinus< Dim, FeExpressionFunctionWrapper< Dim, 1 > > operator- () const
 Unary minus operator for the FE expression.

Static Public Attributes

static constexpr bool is_leaf = true
static constexpr uint8_t is_bilinear = IsNothing
static constexpr std::size_t k_index_begin
 Index the block of the expression starts from (for vectorial problems).
static constexpr std::size_t k_index_end
 Index the block of the expression ends to (for vectorial problems).

Protected Member Functions

const FeExpressionFunctionWrapper< Dim, 1 > & self () const

Protected Attributes

const FuncT m_func
std::vector< OutputType > m_evals
const std::size_t m_order

Detailed Description

template<std::size_t Dim, std::size_t OutputDim = 1>
class vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >

Class that wraps a user-provided function.

order is the polynomial degree assumed for the function when quadrature rules are chosen; it has no default. For a non-polynomial function use at least p + 1, typically p + 3, where p is the degree of the FE space it is integrated against.

Member Typedef Documentation

◆ FeSpaceType

using vulpes::fe::FeExpressionBase< Dim, FeExpressionFunctionWrapper< Dim, 1 > >::FeSpaceType
inherited

Type of the associated Finite Element Space.

◆ FuncT

template<std::size_t Dim, std::size_t OutputDim = 1>
using vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::FuncT = std::function<OutputType(const Eigen::Vector<double, Dim>&)>

◆ OutputType

template<std::size_t Dim, std::size_t OutputDim = 1>
using vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::OutputType
Initial value:
std::
conditional_t<OutputDim == 1, double, Eigen::Vector<double, OutputDim>>

Constructor & Destructor Documentation

◆ FeExpressionFunctionWrapper() [1/3]

template<std::size_t Dim, std::size_t OutputDim = 1>
vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::FeExpressionFunctionWrapper ( const FuncT & func,
std::size_t order )
inlineexplicitconstexpr

◆ FeExpressionFunctionWrapper() [2/3]

template<std::size_t Dim, std::size_t OutputDim = 1>
vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::FeExpressionFunctionWrapper ( const FeExpressionFunctionWrapper< Dim, OutputDim > & )
delete

◆ FeExpressionFunctionWrapper() [3/3]

template<std::size_t Dim, std::size_t OutputDim = 1>
vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::FeExpressionFunctionWrapper ( FeExpressionFunctionWrapper< Dim, OutputDim > && )
delete

Member Function Documentation

◆ computeOrder()

template<std::size_t Dim, std::size_t OutputDim = 1>
std::size_t vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::computeOrder ( ) const
inlineconstexpr

◆ computeUpdateFlags()

template<std::size_t Dim, std::size_t OutputDim = 1>
UpdateFlagsType vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::computeUpdateFlags ( ) const
inlineconstexpr

◆ evaluate()

template<std::size_t Dim, std::size_t OutputDim = 1>
template<std::size_t J = 0, std::size_t I = 0>
decltype(auto) vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::evaluate ( const FeValues< Dim > & ,
std::size_t ,
std::size_t ,
std::size_t q ) const
inline

◆ evaluatePoly()

decltype(auto) vulpes::fe::FeExpressionBase< Dim, FeExpressionFunctionWrapper< Dim, 1 > >::evaluatePoly ( const FeValues< Dim > & fe_values,
std::size_t j,
std::size_t i,
std::size_t bi,
std::size_t bj ) const
inlineinherited

Compute the polynomial associated to the expression for basis i and j and block bi and bj.

Parameters
fe_valuesFinite element values at quadrature points
jIndex of the trial function basis
iIndex of the test function basis
biBlock index of the trial function
bjBlock index of the test function
Returns
Matrix of polynomials associated to the expression

We use the convention that in the result, each row corresponds to a spatial direction (this extends also to tensors, by unrolling them), while each column corresponds to a addendum of the expression requiring a particular pullback/pushforward transformation. These coefficients are computed by the evaluatePolyCoef method.

◆ evaluatePolyCoef()

decltype(auto) vulpes::fe::FeExpressionBase< Dim, FeExpressionFunctionWrapper< Dim, 1 > >::evaluatePolyCoef ( const auto & mapping,
const auto & fe_values,
std::size_t bi,
std::size_t bj ) const
inlineinherited

Compute the coefficients of the polynomial associated to the expression for basis i and j and block bi and bj.

Parameters
mappingThe mapping used for the FE
fe_valuesFinite element values at quadrature points
biBlock index of the trial function
bjBlock index of the test function
Returns
Matrix of coefficients associated to the polynomial expression

The coefficients are the pullback/pushforward needed by each of the polynomial returned by evaluatePoly. Each column corresponds to an addendum of the expression requiring a particular pullback/pushforward transformation. Each row corresponds to a spatial direction (this extends also to tensors, by unrolling them).

◆ feSpace()

const auto & vulpes::fe::FeExpressionBase< Dim, FeExpressionFunctionWrapper< Dim, 1 > >::feSpace ( ) const
inlineconstexprinherited

Get the associated Finite Element Space.

◆ operator-()

FeExpressionUnaryMinus< Dim, FeExpressionFunctionWrapper< Dim, 1 > > vulpes::fe::FeExpressionBase< Dim, FeExpressionFunctionWrapper< Dim, 1 > >::operator- ( ) const
inlineconstexprinherited

Unary minus operator for the FE expression.

Returns
New FE expression representing the negation of the current one

◆ operator=() [1/2]

template<std::size_t Dim, std::size_t OutputDim = 1>
FeExpressionFunctionWrapper & vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::operator= ( const FeExpressionFunctionWrapper< Dim, OutputDim > & )
delete

◆ operator=() [2/2]

template<std::size_t Dim, std::size_t OutputDim = 1>
FeExpressionFunctionWrapper & vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::operator= ( FeExpressionFunctionWrapper< Dim, OutputDim > && )
delete

◆ precompute()

template<std::size_t Dim, std::size_t OutputDim = 1>
bool vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::precompute ( const FeValues< Dim > & fe_values,
const CellsType< Dim > &  ) const
inlineconstexpr

◆ self()

const FeExpressionFunctionWrapper< Dim, 1 > & vulpes::fe::FeExpressionBase< Dim, FeExpressionFunctionWrapper< Dim, 1 > >::self ( ) const
inlineprotectedinherited

Member Data Documentation

◆ is_bilinear

template<std::size_t Dim, std::size_t OutputDim = 1>
uint8_t vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::is_bilinear = IsNothing
staticconstexpr

◆ is_leaf

template<std::size_t Dim, std::size_t OutputDim = 1>
bool vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::is_leaf = true
staticconstexpr

◆ k_index_begin

std::size_t vulpes::fe::FeExpressionBase< Dim, FeExpressionFunctionWrapper< Dim, 1 > >::k_index_begin
inlinestaticconstexprinherited

Index the block of the expression starts from (for vectorial problems).

◆ k_index_end

std::size_t vulpes::fe::FeExpressionBase< Dim, FeExpressionFunctionWrapper< Dim, 1 > >::k_index_end
inlinestaticconstexprinherited

Index the block of the expression ends to (for vectorial problems).

◆ m_evals

template<std::size_t Dim, std::size_t OutputDim = 1>
std::vector<OutputType> vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::m_evals
mutableprotected

◆ m_func

template<std::size_t Dim, std::size_t OutputDim = 1>
const FuncT vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::m_func
protected

◆ m_order

template<std::size_t Dim, std::size_t OutputDim = 1>
const std::size_t vulpes::fe::FeExpressionFunctionWrapper< Dim, OutputDim >::m_order
protected

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