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

General bilinear expression: diagonal sum over component blocks (I == J only). Two forms selected by GradOnTest: More...

#include <fe_expr_vector.hpp>

Inheritance diagram for vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >:
[legend]
Collaboration diagram for vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >:
[legend]

Public Types

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

Public Member Functions

 FeExpressionGradContr (const FuncExpr &func, const FeSpace &fe_space)
 Construct from a Dim-vector flux expression and the FE space.
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
decltype(auto) evaluatePolyCoef (const auto &, const auto &, std::size_t, std::size_t) const
constexpr bool precompute (const FeValues< Dim > &fe_values, const CellsType< Dim > &cells) const
constexpr FeExpressionUnaryMinus< Dim, FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, true > > 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 FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, true > & self () const

Protected Attributes

std::conditional_t< FuncExpr::is_leaf, const FuncExpr &, const FuncExpr > m_func
const FeSpace & m_fe_space

Detailed Description

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
class vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >

General bilinear expression: diagonal sum over component blocks (I == J only). Two forms selected by GradOnTest:

GradOnTest=true (default): sum_I int_K F(x) . grad(v_I) * u_I dK GradOnTest=false (adjoint): sum_I int_K v_I * F(x) . grad(u_I) dK

where F is a Dim-vector expression, v_I / u_I are the I-th components of the vector test / trial function.

Only diagonal component blocks (trial component J == test component I) are nonzero. Off-diagonal blocks return void and are skipped by the integrator, producing a block-diagonal structure in the local matrix.

Typical use (advection volume term, gradient on test): auto wf = fe::grad_contr(c_expr, fe::grad(v), u);

Typical use (adjoint advection, gradient on trial): auto wf = fe::grad_contr(c_expr, v, fe::grad(u));

Note: evaluatePoly / evaluatePolyCoef are not implemented. This expression supports the simplexify (quadrature-based) integrator only, not the qfree (quadrature-free) integrator.

Template Parameters
IndexBeginFirst component index of the function space range.
IndexEndOne past the last component index.
DimSpatial dimension.
FeSpaceFE space type.
FuncExprExpression type for F; must return an Eigen::Vector<double, Dim> from evaluate<J, I>().
GradOnTesttrue = gradient on test function (default); false = gradient on trial function (adjoint form).

Member Typedef Documentation

◆ FeSpaceType

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
using vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::FeSpaceType = FeSpace

◆ PolynomialType

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
using vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::PolynomialType = std::decay_t<decltype(FeSpace{0}.getBasis()[0])>

Constructor & Destructor Documentation

◆ FeExpressionGradContr()

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::FeExpressionGradContr ( const FuncExpr & func,
const FeSpace & fe_space )
inline

Construct from a Dim-vector flux expression and the FE space.

The factory functions extract the FE space from the non-gradient argument (u for GradOnTest=true, v for GradOnTest=false) and pass it here. The gradient wrapper is used only for factory overload resolution and is not stored; gradient values are read directly from fe_values at integration time.

Parameters
funcDim-vector expression F(x).
fe_spaceFE space (same for both test and trial in DG).

Member Function Documentation

◆ computeOrder()

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
std::size_t vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::computeOrder ( ) const
inlineconstexpr

◆ computeUpdateFlags()

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
UpdateFlagsType vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::computeUpdateFlags ( ) const
inlineconstexpr

◆ evaluate()

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
template<std::size_t J = 0, std::size_t I = 0>
decltype(auto) vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::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 = D % nblocks is the trial component (col block index). I = D / nblocks is the test component (row block index). The integrator accumulates: row = i_basis * nblocks + I col = j_basis * nblocks + J

Returns void for J != I (off-diagonal blocks, skipped by the integrator) and for components outside [IndexBegin, IndexEnd).

GradOnTest=true: F(x_q) . grad(phi_i) * phi_j (gradient on test i) GradOnTest=false: phi_i * F(x_q) . grad(phi_j) (gradient on trial j)

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

◆ evaluatePoly()

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
decltype(auto) vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::evaluatePoly ( const FeValues< Dim > & ,
std::size_t ,
std::size_t ,
std::size_t ,
std::size_t  ) const
inline

◆ evaluatePolyCoef()

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
decltype(auto) vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::evaluatePolyCoef ( const auto & ,
const auto & ,
std::size_t ,
std::size_t  ) const
inline

◆ feSpace()

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
const auto & vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::feSpace ( ) const
inlineconstexpr

◆ operator-()

FeExpressionUnaryMinus< Dim, FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, true > > vulpes::fe::FeExpressionBase< Dim, FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, true > >::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 IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
bool vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::precompute ( const FeValues< Dim > & fe_values,
const CellsType< Dim > & cells ) const
inlineconstexpr

◆ self()

const FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, true > & vulpes::fe::FeExpressionBase< Dim, FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, true > >::self ( ) const
inlineprotectedinherited

Member Data Documentation

◆ is_bilinear

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
uint8_t vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::is_bilinear = IsBilinear
staticconstexpr

◆ is_leaf

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
bool vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::is_leaf = false
staticconstexpr

◆ k_index_begin

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
std::size_t vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::k_index_begin = IndexBegin
staticconstexpr

◆ k_index_end

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
std::size_t vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::k_index_end = IndexEnd
staticconstexpr

◆ m_fe_space

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
const FeSpace& vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::m_fe_space
protected

◆ m_func

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
std:: conditional_t<FuncExpr::is_leaf, const FuncExpr&, const FuncExpr> vulpes::fe::FeExpressionGradContr< IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >::m_func
protected

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