General bilinear expression: diagonal sum over component blocks (I == J only). Two forms selected by GradOnTest:
More...
|
| | 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.
|
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
-
| 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<J, I>(). |
| GradOnTest | true = gradient on test function (default); false = gradient on trial function (adjoint form). |
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
-
| J | Trial component index (compile-time constant). |
| I | Test component index (compile-time constant). |