![]() |
Vulpes
0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
|
Multiply an FE expression by a scalar constant at every quadrature point. More...
#include <fe_expr_op.hpp>
Public Types | |
| using | OutputType = typename E::OutputType |
| using | FeSpaceType |
| Type of the associated Finite Element Space. | |
Public Member Functions | |
| FeExpressionScale (double c, const E &expr) | |
| Construct with a scalar factor and the expression to scale. | |
| template<std::size_t J = 0, std::size_t I = 0> | |
| decltype(auto) | evaluate (const FeValues< Dim > &fe_values, std::size_t j, std::size_t i, std::size_t q) const |
Evaluate c * expr at quadrature point q. | |
| constexpr std::size_t | computeOrder () const |
| constexpr UpdateFlagsType | computeUpdateFlags () const |
| constexpr bool | precompute (const FeValues< Dim > &fe_values, const CellsType< Dim > &cells) 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, FeExpressionScale< Dim, E > > | operator- () const |
| Unary minus operator for the FE expression. | |
Static Public Attributes | |
| static constexpr bool | is_leaf = false |
| static constexpr uint8_t | is_bilinear = E::is_bilinear |
| 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 FeExpressionScale< Dim, E > & | self () const |
Protected Attributes | |
| double | m_c |
| std::conditional_t< E::is_leaf, const E &, const E > | m_expr |
Multiply an FE expression by a scalar constant at every quadrature point.
Wraps any expression E and returns c * E.evaluate<J,I>(q) from its own evaluate. OutputType is inherited from E, so the class works for both scalar (double) and vector (Eigen::Vector<double,N>) expressions without specialisation.
All update flags, precompute logic, and polynomial order are delegated to the wrapped expression. The expression is a pure coefficient node (FeSpaceType=void inherited from the base) and carries is_bilinear = E::is_bilinear unchanged.
Typical use:
| Dim | Spatial dimension. |
| E | Wrapped expression type; must expose OutputType. |
|
inherited |
Type of the associated Finite Element Space.
| using vulpes::fe::FeExpressionScale< Dim, E >::OutputType = typename E::OutputType |
|
inline |
Construct with a scalar factor and the expression to scale.
| c | Scalar multiplier applied pointwise at every quadrature point. |
| expr | Wrapped FE expression. |
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
Evaluate c * expr at quadrature point q.
| J | Trial component index (compile-time constant). |
| I | Test component index (compile-time constant). |
|
inlineinherited |
Compute the polynomial associated to the expression for basis i and j and block bi and bj.
| fe_values | Finite element values at quadrature points |
| j | Index of the trial function basis |
| i | Index of the test function basis |
| bi | Block index of the trial function |
| bj | Block index of the test function |
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.
|
inlineinherited |
Compute the coefficients of the polynomial associated to the expression for basis i and j and block bi and bj.
| mapping | The mapping used for the FE |
| fe_values | Finite element values at quadrature points |
| bi | Block index of the trial function |
| bj | Block index of the test function |
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).
|
inlineconstexprinherited |
Get the associated Finite Element Space.
|
inlineconstexprinherited |
Unary minus operator for the FE expression.
|
inlineconstexpr |
|
inlineprotectedinherited |
|
staticconstexpr |
|
staticconstexpr |
|
inlinestaticconstexprinherited |
Index the block of the expression starts from (for vectorial problems).
|
inlinestaticconstexprinherited |
Index the block of the expression ends to (for vectorial problems).
|
protected |
|
protected |