Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr > Class Template Reference

Single-block bilinear expression \( c(x) \, u_l \, v_k \), where \( k \) = TestComp and \( l \) = TrialComp. More...

#include <fe_expr_vector.hpp>

Inheritance diagram for vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >:
[legend]
Collaboration diagram for vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >:
[legend]

Public Types

using FeSpaceType = FeSpace
using PolynomialType = std::decay_t<decltype(FeSpace{0}.getBasis()[0])>

Public Member Functions

 FeExpressionInnerBlock (const CoeffExpr &coeff, const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, false > &u, const VExpr &v)
 Construct from a scalar coefficient expression, vector trial, and vector test.
constexpr const auto & feSpace () const
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 the (J, I) block contribution at quadrature point q.
constexpr UpdateFlagsType computeUpdateFlags () const
constexpr std::size_t computeOrder () const
decltype(auto) evaluatePoly (const FeValues< Dim > &, std::size_t, std::size_t, std::size_t, std::size_t) const
 Not implemented: simplexify integrator only. Returns void().
decltype(auto) evaluatePolyCoef (const auto &, const auto &, std::size_t, std::size_t) const
 Not implemented: simplexify integrator only. Returns void().
constexpr bool precompute (const FeValues< Dim > &fe_values, const CellsType< Dim > &cells) const
 Forward precompute to all sub-expressions (coeff, u, v).
constexpr FeExpressionUnaryMinus< Dim, FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr > > operator- () const
 Unary minus operator for the FE expression.

Static Public Attributes

static constexpr bool is_leaf = false
static constexpr uint8_t is_bilinear = IsBilinear
static constexpr std::size_t k_index_begin = IndexBegin
static constexpr std::size_t k_index_end = IndexEnd

Protected Member Functions

const FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr > & self () const

Protected Attributes

std::conditional_t< CoeffExpr::is_leaf, const CoeffExpr &, const CoeffExpr > m_coeff
const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, false > & m_u
std::conditional_t< VExpr::is_leaf, const VExpr &, const VExpr > m_v

Static Private Member Functions

static constexpr double scalarFromBasis (double x)
 Extract the scalar shape value from the result of a basis expression's evaluate.
template<Eigen::Index Idx, typename Scalar, Eigen::Index Size>
static constexpr double scalarFromBasis (const EigenVulpes::OneComponentVector< Idx, Scalar, Size > &v)

Detailed Description

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
class vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >

Single-block bilinear expression \( c(x) \, u_l \, v_k \), where \( k \) = TestComp and \( l \) = TrialComp.

Face-side analogue of FeExpressionGradContrBlock for matrix-valued couplings between two components of a vector FE function. Selects exactly one (TestComp, TrialComp) entry of a coefficient matrix at integration time; every other (I,J) block returns void() and is skipped by the integrator.

The test argument v may be either an own-cell FeExpressionFunc or a neighbour-cell FeExpressionNeighborFunc (obtained via fe::neigh). When the latter is supplied the basis values are read from fe_values.neighValues() automatically — the implementation delegates to the sub-expression's evaluate, reusing the same routing that FeExpressionInner already relies on for face neighbour terms.

Typical use case — a numerical flux split for a hyperbolic system with flux Jacobian \( A(n) \):

// Diagonal and neighbour parts of entry (k, l) of A(n) on a face.
auto coeff_kl = (0.5 * c) * n_x * n_x;
auto wf_diag_kl = -fe::inner_block<k, l>(coeff_kl, U, V);
auto wf_neigh_kl = fe::inner_block<k, l>(coeff_kl, U, fe::neigh(V));
FeExpressionNeighborFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > neigh(const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > &w)
Definition fe_expr_basis.hpp:686
auto inner_block(const FeExpressionBase< Dim, CoeffExpr > &coeff, const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, false > &u, const FeExpressionBase< Dim, VExpr > &v)
Factory function for FeExpressionInnerBlock.
Definition fe_expr_vector.hpp:831

Sum 9 such block expressions to obtain the full \( A^{\pm}(n) \) flux, or 4 + 5 to obtain a central + dissipation form.

Note
evaluatePoly / evaluatePolyCoef return void(); this expression supports the simplexify (quadrature-based) integrator only. Same restriction as FeExpressionGradContrBlock.
Template Parameters
TestCompTest component index \( k \) (absolute, within [IndexBegin, IndexEnd)).
TrialCompTrial component index \( l \) (absolute, within [IndexBegin, IndexEnd)).
IndexBeginFirst component index of the function-space range.
IndexEndOne past the last component index.
DimSpatial dimension.
FeSpaceFE space type.
CoeffExprExpression type for the scalar coefficient \( c(x) \).
VExprExpression type for the test side; typically either a FeExpressionFunc<...,true> (own test) or a FeExpressionNeighborFunc<...,true> (neighbour test).

Member Typedef Documentation

◆ FeSpaceType

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
using vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::FeSpaceType = FeSpace

◆ PolynomialType

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
using vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::PolynomialType = std::decay_t<decltype(FeSpace{0}.getBasis()[0])>

Constructor & Destructor Documentation

◆ FeExpressionInnerBlock()

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::FeExpressionInnerBlock ( const CoeffExpr & coeff,
const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, false > & u,
const VExpr & v )
inline

Construct from a scalar coefficient expression, vector trial, and vector test.

Parameters
coeffScalar coefficient expression \( c(x) \).
uVector trial function (own cell).
vVector test function. May be own (FeExpressionFunc) or neighbour (FeExpressionNeighborFunc).

Member Function Documentation

◆ computeOrder()

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
std::size_t vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::computeOrder ( ) const
inlineconstexpr

◆ computeUpdateFlags()

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
UpdateFlagsType vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::computeUpdateFlags ( ) const
inlineconstexpr

◆ evaluate()

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
template<std::size_t J = 0, std::size_t I = 0>
decltype(auto) vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::evaluate ( const FeValues< Dim > & fe_values,
std::size_t j,
std::size_t i,
std::size_t q ) const
inline

Evaluate the (J, I) block contribution at quadrature point q.

J is the trial component (col block) and I is the test component (row block) selected by the integrator's outer loop. The integrator accumulates

row = i_basis * nblocks + I
col = j_basis * nblocks + J

This expression fires only when (J, I) == (TrialComp, TestComp). All other pairs return void().

Returns \( c(x_q) \cdot \phi_i(q) \cdot \phi_j(q) \) for the active pair, where \( \phi_i \) is taken from v (own or neighbour cell depending on VExpr) and \( \phi_j \) from u (own cell). Basis values are obtained by delegating to the sub-expressions' own evaluate so that neighbour routing is preserved.

Template Parameters
JTrial component index (compile-time constant).
ITest component index (compile-time constant).

◆ evaluatePoly()

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
decltype(auto) vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::evaluatePoly ( const FeValues< Dim > & ,
std::size_t ,
std::size_t ,
std::size_t ,
std::size_t  ) const
inline

Not implemented: simplexify integrator only. Returns void().

◆ evaluatePolyCoef()

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
decltype(auto) vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::evaluatePolyCoef ( const auto & ,
const auto & ,
std::size_t ,
std::size_t  ) const
inline

Not implemented: simplexify integrator only. Returns void().

◆ feSpace()

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
const auto & vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::feSpace ( ) const
inlineconstexpr

◆ operator-()

FeExpressionUnaryMinus< Dim, FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr > > vulpes::fe::FeExpressionBase< Dim, FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr > >::operator- ( ) const
inlineconstexprinherited

Unary minus operator for the FE expression.

Returns
New FE expression representing the negation of the current one

◆ precompute()

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
bool vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::precompute ( const FeValues< Dim > & fe_values,
const CellsType< Dim > & cells ) const
inlineconstexpr

Forward precompute to all sub-expressions (coeff, u, v).

◆ scalarFromBasis() [1/2]

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
template<Eigen::Index Idx, typename Scalar, Eigen::Index Size>
constexpr double vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::scalarFromBasis ( const EigenVulpes::OneComponentVector< Idx, Scalar, Size > & v)
inlinestaticconstexprprivate

◆ scalarFromBasis() [2/2]

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
constexpr double vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::scalarFromBasis ( double x)
inlinestaticconstexprprivate

Extract the scalar shape value from the result of a basis expression's evaluate.

For scalar FE spaces ( k_n_comp == 1 ) the result is already a double. For vector FE spaces evaluate returns EigenVulpes::OneComponentVector<D> whose value() carries the underlying \( \phi(q) \).

◆ self()

const FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr > & vulpes::fe::FeExpressionBase< Dim, FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr > >::self ( ) const
inlineprotectedinherited

Member Data Documentation

◆ is_bilinear

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
uint8_t vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::is_bilinear = IsBilinear
staticconstexpr

◆ is_leaf

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
bool vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::is_leaf = false
staticconstexpr

◆ k_index_begin

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
std::size_t vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::k_index_begin = IndexBegin
staticconstexpr

◆ k_index_end

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
std::size_t vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::k_index_end = IndexEnd
staticconstexpr

◆ m_coeff

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
std:: conditional_t<CoeffExpr::is_leaf, const CoeffExpr&, const CoeffExpr> vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::m_coeff
protected

◆ m_u

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
const FeExpressionFunc<IndexBegin, IndexEnd, Dim, FeSpace, false>& vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::m_u
protected

◆ m_v

template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename CoeffExpr, typename VExpr>
std::conditional_t<VExpr::is_leaf, const VExpr&, const VExpr> vulpes::fe::FeExpressionInnerBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, CoeffExpr, VExpr >::m_v
protected

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