Bilinear expression for a single (test, trial) component block. Two forms selected by GradOnTest:
More...
|
| | FeExpressionGradContrBlock (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, FeExpressionGradContrBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, true > > | operator- () const |
| | Unary minus operator for the FE expression.
|
template<std::size_t TestComp, std::size_t TrialComp, std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, typename FuncExpr, bool GradOnTest = true>
class vulpes::fe::FeExpressionGradContrBlock< TestComp, TrialComp, IndexBegin, IndexEnd, Dim, FeSpace, FuncExpr, GradOnTest >
Bilinear expression for a single (test, trial) component block. Two forms selected by GradOnTest:
GradOnTest=true (default): int_K F(x) . grad(v_k) * u_l dK GradOnTest=false (adjoint): int_K v_k * F(x) . grad(u_l) dK
Activates exactly one block of the local matrix identified by (TestComp, TrialComp). All other (J, I) pairs return void and are skipped by the integrator.
When TestComp == TrialComp this is a diagonal block (same as one component of FeExpressionGradContr). When TestComp != TrialComp this is an off-diagonal block, expressing coupling between two distinct components.
A common use case is a linearized hyperbolic system where the flux Jacobian has off-diagonal entries A_{kl}(x) coupling test component k with trial component l: wf_kl = fe::grad_contr_block<k, l>(A_kl_expr, fe::grad(v), u);
The trial-gradient form (GradOnTest=false) assembles the adjoint stiffness: T_{ij} = int_K phi_i * F . grad(phi_j) dK which equals the transpose of the test-gradient form – no IBP, no face terms. Needed when the adjoint stiffness T_{ij} = int_K phi_i * F . grad(phi_j) dK is required directly: wf_kl = fe::grad_contr_block<k, l>(F_expr, v, fe::grad(u));
Note: evaluatePoly / evaluatePolyCoef are not implemented. This expression supports the simplexify (quadrature-based) integrator only.
- Template Parameters
-
| TestComp | Test component index k (absolute, within [IndexBegin, IndexEnd)). |
| TrialComp | Trial component index l (absolute, within [IndexBegin, IndexEnd)). |
| IndexBegin | First component index of the function space range. |
| IndexEnd | One past the last component index. |
| Dim | Spatial dimension. |
| FeSpace | FE space type. |
| FuncExpr | Expression type for F; must return an Eigen::Vector<double, Dim> from evaluate(). |
| GradOnTest | true = gradient on test function (default); false = gradient on trial function (adjoint form). |
template<std::size_t TestComp, std::size_t TrialComp, 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::FeExpressionGradContrBlock< TestComp, TrialComp, 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 = j_basis * nblocks + I col = i_basis * nblocks + J This expression fires only when J == TrialComp and I == TestComp. All other (J, I) pairs return void.
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
-
| J | Trial component index (compile-time constant). |
| I | Test component index (compile-time constant). |