Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::fe Namespace Reference

Namespaces

namespace  internal

Classes

struct  DofPolicyBase
 Static class describing the template for a DoF policy. More...
struct  DofPolicyFeSpaceCQ
struct  DofPolicyFeSpaceCP
struct  DofPolicyFeSpaceDQ
struct  DofPolicyFeSpaceDP
class  FeExpressionUnaryMinus
class  FeExpressionBase
 Base class for Finite Element Expressions. More...
class  FeExpressionFunc
class  FeExpressionGradFunc
class  FeExpressionSymGradFunc
class  FeExpressionTraceSymGradFunc
class  FeExpressionNeighborFunc
class  FeExpressionSelfFunc
class  FeExpressionFaceNormal
 Class that wraps the normal vector for the faces. More...
class  FeExpressionConstant
 Class that wraps a constant function. More...
class  FeExpressionCellConstant
 Class that wraps a cell constant function. More...
class  FeExpressionCellConstantTensor
 Class that wraps a cell constant tensor. More...
class  FeExpressionCellConstantNeedNeigh
 Class that wraps a function which is cell constant and need the evaluation of neighbours (e.g. penalty coefficient). More...
class  FeExpressionFacePointsNeedNeigh
 Class that wraps a face function given by one value per quadrature point, filled by a user function that may read the neighbour's values at the same physical points (fe_values.neighValues()), e.g. a numerical trace built from both sides of the face. More...
class  FeExpressionSkipper
 Class that is used to skip the computation of the expression (first parameter) if the rule is not verified (second parameter). More...
class  FeExpressionFunctionWrapper
 Class that wraps a user-provided function. More...
class  FeExpressionFeProjection
 Class that wraps the projected of a given vector of coefficients on the FE space. More...
class  FeExactExpressionFeProjection
 Class that wraps the projected of a given vector of coefficients on the FE space. More...
class  FeGradProjectionExpr
 Physical gradient of a DG field given its DOF coefficient vector. More...
class  FeExpressionFunctionWrapperTensor
 Class that wraps a user-provided function that returns a tensor, evaluated at the quadrature points. More...
class  FeExpressionInner
class  FeExpressionOuter
class  FeExpressionProduct
class  FeExpressionSum
class  FeExpressionDifference
class  FeExpressionMakeVec
class  FeExpressionScale
 Multiply an FE expression by a scalar constant at every quadrature point. More...
class  FeExpressionShift
 Add a constant offset to an FE expression at every quadrature point. More...
class  FeExpressionFieldComponent
 Extract the field (block) component of a multi-component test/trial expression driven by the integration loop's DOF index. More...
class  FeExpressionSpatialComponent
 Extract a single scalar spatial component at compile-time index K from a vector-output FE expression. More...
class  FeExpressionDiagOnly
class  FeExpressionAbs
class  FeExpressionQptsCache
 Values of a coefficient expression (no test or trial function) stored at the quadrature points by precompute(), so that a form evaluates the coefficient once per point instead of once per (basis, point) pair. The stored values are those evaluate() of the wrapped expression returns. More...
class  FeExpressionGradContr
 General bilinear expression: diagonal sum over component blocks (I == J only). Two forms selected by GradOnTest: More...
class  FeExpressionGradContrBlock
 Bilinear expression for a single (test, trial) component block. Two forms selected by GradOnTest: More...
class  FeExpressionInnerBlock
 Single-block bilinear expression \( c(x) \, u_l \, v_k \), where \( k \) = TestComp and \( l \) = TrialComp. More...
class  FeSpaceBase
 Class describing the template for a FeSpace. More...
class  FeSpaceLagrangeP
 General finite element space on a simplex with (nodal) Lagrangian basis function, can be either continuous or discontinuous. More...
class  FeSpaceLagrangeQ
 General finite element space on a tensor product cell with (nodal) Lagrangian basis function, can be either continuous or discontinuous. More...
class  FeSpaceModalP
 Modal FE Space on simplex elements. More...
class  FeSpaceModalQ
 Modal FE Space on polytopal elements (tensor product of Legendre polynomials on the bounding box). The total degree is limited to the given order in the sum of the exponents. More...
class  FeValues
 This class works as a cache table for computing efficiently the value of the basis function and its derivatives for each cell. More...

Typedefs

template<std::size_t Dim>
using CellType = geometry::Cell<Dim, double, int32_t>
template<std::size_t Dim>
using CellsType = std::vector<std::unique_ptr<CellType<Dim>>>
template<typename FeSpace, std::size_t IndexBegin = 0, std::size_t IndexEnd = 1>
using TrialFunction
template<typename FeSpace, std::size_t IndexBegin = 0, std::size_t IndexEnd = 1>
using TestFunction
template<typename DataType, std::size_t Dim>
using Point = geometry::Point<DataType, Dim>
template<std::size_t Dim>
using FeSpaceLagrangeCP
 Continuous lagrangian finite element space with equi-spaced nodes.
template<std::size_t Dim>
using FeSpaceLagrangeDP
 Discontinuous lagrangian finite element space with equi-spaced nodes.
template<std::size_t Dim>
using FeSpaceSpectralCP
 Continuous spectral finite element space with optimal conditioning.
template<std::size_t Dim>
using FeSpaceSpectralDP
 Discontinuous spectral finite element space with optimal conditioning.
template<std::size_t Dim>
using FeSpaceLagrangeCQ
 Continuous lagrangian finite element space with equi-spaced nodes.
template<std::size_t Dim>
using FeSpaceLagrangeDQ
 Discontinuous lagrangian finite element space with equi-spaced nodes.
template<std::size_t Dim>
using FeSpaceSpectralCQ
 Continuous spectral finite element space.
template<std::size_t Dim>
using FeSpaceSpectralDQ
 Discontinuous spectral finite element space.
template<std::size_t Dim>
using FeSpaceModalLegendreDP = FeSpaceModalP<Dim, DofPolicyFeSpaceDP<Dim>>
 Modal DiscontinuousLegendre FE Space on simplex elements with optimal conditioning for simplex elements.
template<std::size_t Dim, bool EnableScaling = false>
using FeSpaceModalLegendreDQ
 Modal Discontinuous Legendre FE Space on bounding box elements.
using UpdateFlagsType = std::underlying_type_t<UpdateFlags>

Enumerations

enum  IntegrationForm : uint8_t { IsNothing = 0 , IsLinearTest = 1 , IsLinearTrial = 2 , IsBilinear = IsLinearTest | IsLinearTrial }
 Enumeration for the type of integration form (presence of test/trial functions). More...
enum  FeType : uint8_t { Simplex , Tensor , Poly }
enum  UpdateFlags : uint32_t {
  UpdateNothing = 0ULL , UpdateMapping = (1ULL << 0ULL) , UpdateValues = (1ULL << 1ULL) , UpdateGradients = (1ULL << 2ULL) ,
  UpdateHessians = (1ULL << 3ULL) , UpdateWeights = (1ULL << 4ULL) , UpdateQuadraturePts = (1ULL << 5ULL) , UpdateNormals = (1ULL << 6ULL) ,
  UpdateId = (1ULL << 7ULL) , UpdateNeighborCell = (1ULL << 8ULL) , UpdateNeighborValues = (1ULL << 9ULL) , UpdateAll = 0xFFFFFFFFUL
}
 Flags that indicate which parts of FeValues shall be updated on each cell. More...

Functions

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, bool IsTest>
FeExpressionGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > grad (const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > &w)
template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, bool IsTest>
FeExpressionSymGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > symgrad (const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > &w)
template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, bool IsTest>
FeExpressionTraceSymGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > trsymgrad (const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > &w)
template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, bool IsTest>
FeExpressionTraceSymGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > div (const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > &w)
template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, bool IsTest>
FeExpressionNeighborFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > neigh (const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > &w)
template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, bool IsTest>
FeExpressionSelfFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > self (const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > &w)
template<typename FeSpace>
const auto normal (const FeSpace &)
template<std::size_t Dim, typename E>
auto skip (const E &expr, const typename FeExpressionSkipper< Dim, E >::FuncType &func)
template<typename FeSpaceType, typename DofHandlerType>
FeGradProjectionExpr< FeSpaceType::dim, FeSpaceType, DofHandlerType > grad_proj (const la::Vector &uh, const FeSpaceType &fe_space, const DofHandlerType &dof_handler)
 Factory for FeGradProjectionExpr: gradient of a DG field.
template<std::size_t Dim, typename FeExpressionU, typename FeExpressionV>
FeExpressionInner< Dim, FeExpressionU, FeExpressionV > inner (const FeExpressionBase< Dim, FeExpressionU > &u, const FeExpressionBase< Dim, FeExpressionV > &v)
template<std::size_t Dim, typename FeExpressionU, typename FeExpressionV>
FeExpressionOuter< Dim, FeExpressionU, FeExpressionV > outer (const FeExpressionBase< Dim, FeExpressionU > &u, const FeExpressionBase< Dim, FeExpressionV > &v)
template<std::size_t Dim, typename FeExpressionU, typename FeExpressionV>
FeExpressionProduct< Dim, FeExpressionU, FeExpressionV > operator* (const FeExpressionBase< Dim, FeExpressionU > &u, const FeExpressionBase< Dim, FeExpressionV > &v)
template<std::size_t Dim, typename FeExpressionU, typename FeExpressionV>
FeExpressionSum< Dim, FeExpressionU, FeExpressionV > operator+ (const FeExpressionBase< Dim, FeExpressionU > &u, const FeExpressionBase< Dim, FeExpressionV > &v)
template<std::size_t Dim, typename FeExpressionU, typename FeExpressionV>
FeExpressionDifference< Dim, FeExpressionU, FeExpressionV > operator- (const FeExpressionBase< Dim, FeExpressionU > &u, const FeExpressionBase< Dim, FeExpressionV > &v)
template<std::size_t Dim, typename... ScalarExprs>
FeExpressionMakeVec< Dim, ScalarExprs... > make_vec (const FeExpressionBase< Dim, ScalarExprs > &... exprs)
template<std::size_t Dim, typename E>
FeExpressionScale< Dim, E > operator* (double c, const FeExpressionBase< Dim, E > &e)
 Scalar-multiply an FE expression: c * expr.
template<std::size_t Dim, typename E>
FeExpressionScale< Dim, E > operator* (const FeExpressionBase< Dim, E > &e, double c)
 Scalar-multiply an FE expression: expr * c.
template<std::size_t Dim, typename E, std::enable_if_t< std::is_same_v< typename E::OutputType, double >, int > = 0>
FeExpressionShift< Dim, E > operator+ (double c, const FeExpressionBase< Dim, E > &e)
 Shift a scalar FE expression by a constant: c + expr.
template<std::size_t Dim, typename E, std::enable_if_t< std::is_same_v< typename E::OutputType, double >, int > = 0>
FeExpressionShift< Dim, E > operator+ (const FeExpressionBase< Dim, E > &e, double c)
 Shift a scalar FE expression by a constant: expr + c.
template<std::size_t Dim, typename E, std::enable_if_t< std::is_same_v< typename E::OutputType, double >, int > = 0>
FeExpressionShift< Dim, E > operator- (const FeExpressionBase< Dim, E > &e, double c)
 Shift a scalar FE expression by a negative constant: expr - c.
template<std::size_t Dim, typename E>
FeExpressionShift< Dim, E > shift (const typename E::OutputType &c, const FeExpressionBase< Dim, E > &e)
 General shift factory: c + expr, works for any OutputType.
template<std::size_t Dim, typename E>
FeExpressionShift< Dim, E > shift (const FeExpressionBase< Dim, E > &e, const typename E::OutputType &c)
 General shift factory: expr + c, works for any OutputType.
template<typename E>
auto perp (const FeExpressionBase< 2, E > &e)
 2D perpendicular rotation of a 2-vector coefficient expression.
template<std::size_t K, std::size_t Dim, typename E>
FeExpressionSpatialComponent< K, Dim, E > spatial_component (const FeExpressionBase< Dim, E > &e)
 Extract the K-th scalar spatial component of a vector-output FE expression at every quadrature point.
template<std::size_t Dim, typename E>
FeExpressionFieldComponent< Dim, E > field_component (const FeExpressionBase< Dim, E > &e)
 Extract the block field component of a multi-component test/trial expression, driven by the integration loop's DOF index.
template<std::size_t Dim, typename E>
FeExpressionDiagOnly< Dim, E > ondiag (const E &w)
template<std::size_t Dim, typename E>
FeExpressionAbs< Dim, E > abs (const FeExpressionBase< Dim, E > &e)
template<std::size_t Dim, typename E>
FeExpressionQptsCache< Dim, E > cached (const FeExpressionBase< Dim, E > &e)
 Coefficient expression evaluated once per quadrature point (see FeExpressionQptsCache).
template<std::size_t Dim, typename FuncExpr, std::size_t IndexBegin, std::size_t IndexEnd, typename FeSpace>
auto grad_contr (const FeExpressionBase< Dim, FuncExpr > &func, const FeExpressionGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, true > &, const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, false > &u)
 Factory function for FeExpressionGradContr with gradient on TEST (default, GradOnTest=true).
template<std::size_t Dim, typename FuncExpr, std::size_t IndexBegin, std::size_t IndexEnd, typename FeSpace>
auto grad_contr (const FeExpressionBase< Dim, FuncExpr > &func, const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, true > &v, const FeExpressionGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, false > &)
 Factory function for FeExpressionGradContr with gradient on TRIAL (adjoint form, GradOnTest=false).
template<std::size_t TestComp, std::size_t TrialComp, std::size_t Dim, typename FuncExpr, std::size_t IndexBegin, std::size_t IndexEnd, typename FeSpace>
auto grad_contr_block (const FeExpressionBase< Dim, FuncExpr > &func, const FeExpressionGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, true > &, const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, false > &u)
 Factory function for FeExpressionGradContrBlock with gradient on TEST (default, GradOnTest=true).
template<std::size_t TestComp, std::size_t TrialComp, std::size_t Dim, typename FuncExpr, std::size_t IndexBegin, std::size_t IndexEnd, typename FeSpace>
auto grad_contr_block (const FeExpressionBase< Dim, FuncExpr > &func, const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, true > &v, const FeExpressionGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, false > &)
 Factory function for FeExpressionGradContrBlock with gradient on TRIAL (adjoint form, GradOnTest=false).
template<std::size_t TestComp, std::size_t TrialComp, std::size_t Dim, typename CoeffExpr, std::size_t IndexBegin, std::size_t IndexEnd, typename FeSpace, typename VExpr>
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.

Typedef Documentation

◆ CellsType

template<std::size_t Dim>
using vulpes::fe::CellsType = std::vector<std::unique_ptr<CellType<Dim>>>

◆ CellType

template<std::size_t Dim>
using vulpes::fe::CellType = geometry::Cell<Dim, double, int32_t>

◆ FeSpaceLagrangeCP

template<std::size_t Dim>
using vulpes::fe::FeSpaceLagrangeCP
Initial value:
Dim,
General finite element space on a simplex with (nodal) Lagrangian basis function, can be either conti...
Definition fe_lagrange_simplex.hpp:165
Definition dof_policy.hpp:429
Compute the equi-spaced nodes on a simplex in Dim dimensions.
Definition fe_lagrange_simplex.hpp:46

Continuous lagrangian finite element space with equi-spaced nodes.

◆ FeSpaceLagrangeCQ

template<std::size_t Dim>
using vulpes::fe::FeSpaceLagrangeCQ
Initial value:
Dim,
General finite element space on a tensor product cell with (nodal) Lagrangian basis function,...
Definition fe_lagrange_tensor.hpp:43
Definition dof_policy.hpp:100

Continuous lagrangian finite element space with equi-spaced nodes.

◆ FeSpaceLagrangeDP

template<std::size_t Dim>
using vulpes::fe::FeSpaceLagrangeDP
Initial value:

Discontinuous lagrangian finite element space with equi-spaced nodes.

◆ FeSpaceLagrangeDQ

template<std::size_t Dim>
using vulpes::fe::FeSpaceLagrangeDQ
Initial value:

Discontinuous lagrangian finite element space with equi-spaced nodes.

◆ FeSpaceModalLegendreDP

template<std::size_t Dim>
using vulpes::fe::FeSpaceModalLegendreDP = FeSpaceModalP<Dim, DofPolicyFeSpaceDP<Dim>>

Modal DiscontinuousLegendre FE Space on simplex elements with optimal conditioning for simplex elements.

◆ FeSpaceModalLegendreDQ

template<std::size_t Dim, bool EnableScaling = false>
using vulpes::fe::FeSpaceModalLegendreDQ
Initial value:
Modal FE Space on polytopal elements (tensor product of Legendre polynomials on the bounding box)....
Definition fe_modal_tensor.hpp:46

Modal Discontinuous Legendre FE Space on bounding box elements.

◆ FeSpaceSpectralCP

template<std::size_t Dim>
using vulpes::fe::FeSpaceSpectralCP
Initial value:
Dim,
Compute the warp&blend nodes on a simplex in Dim dimensions See: Warburton, Tim. "An explicit constru...
Definition fe_lagrange_simplex.hpp:96

Continuous spectral finite element space with optimal conditioning.

◆ FeSpaceSpectralCQ

template<std::size_t Dim>
using vulpes::fe::FeSpaceSpectralCQ
Initial value:

Continuous spectral finite element space.

◆ FeSpaceSpectralDP

template<std::size_t Dim>
using vulpes::fe::FeSpaceSpectralDP
Initial value:

Discontinuous spectral finite element space with optimal conditioning.

◆ FeSpaceSpectralDQ

template<std::size_t Dim>
using vulpes::fe::FeSpaceSpectralDQ
Initial value:

Discontinuous spectral finite element space.

◆ Point

template<typename DataType, std::size_t Dim>
using vulpes::fe::Point = geometry::Point<DataType, Dim>

◆ TestFunction

template<typename FeSpace, std::size_t IndexBegin = 0, std::size_t IndexEnd = 1>
using vulpes::fe::TestFunction

◆ TrialFunction

template<typename FeSpace, std::size_t IndexBegin = 0, std::size_t IndexEnd = 1>
using vulpes::fe::TrialFunction

◆ UpdateFlagsType

using vulpes::fe::UpdateFlagsType = std::underlying_type_t<UpdateFlags>

Enumeration Type Documentation

◆ FeType

enum vulpes::fe::FeType : uint8_t

Definition of the types of cells FE types

Enumerator
Simplex 
Tensor 
Poly 

◆ IntegrationForm

Enumeration for the type of integration form (presence of test/trial functions).

Enumerator
IsNothing 
IsLinearTest 
IsLinearTrial 
IsBilinear 

◆ UpdateFlags

enum vulpes::fe::UpdateFlags : uint32_t

Flags that indicate which parts of FeValues shall be updated on each cell.

Enumerator
UpdateNothing 
UpdateMapping 
UpdateValues 
UpdateGradients 
UpdateHessians 
UpdateWeights 
UpdateQuadraturePts 
UpdateNormals 
UpdateId 
UpdateNeighborCell 
UpdateNeighborValues 
UpdateAll 

Function Documentation

◆ abs()

template<std::size_t Dim, typename E>
FeExpressionAbs< Dim, E > vulpes::fe::abs ( const FeExpressionBase< Dim, E > & e)

◆ cached()

template<std::size_t Dim, typename E>
FeExpressionQptsCache< Dim, E > vulpes::fe::cached ( const FeExpressionBase< Dim, E > & e)

Coefficient expression evaluated once per quadrature point (see FeExpressionQptsCache).

◆ div()

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, bool IsTest>
FeExpressionTraceSymGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > vulpes::fe::div ( const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > & w)

◆ field_component()

template<std::size_t Dim, typename E>
FeExpressionFieldComponent< Dim, E > vulpes::fe::field_component ( const FeExpressionBase< Dim, E > & e)

Extract the block field component of a multi-component test/trial expression, driven by the integration loop's DOF index.

The extracted index is the test DOF block index I (for IsLinearTest), trial index J (for IsLinearTrial), or (J,I) pair (for IsBilinear). The result is block-diagonal across fields.

Template Parameters
DimSpatial dimension.
EExpression type (IsLinearTest, IsLinearTrial, or IsBilinear).
Parameters
eMulti-component test/trial FE expression.
Returns
FeExpressionFieldComponent wrapping e.

◆ grad()

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, bool IsTest>
FeExpressionGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > vulpes::fe::grad ( const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > & w)

◆ grad_contr() [1/2]

template<std::size_t Dim, typename FuncExpr, std::size_t IndexBegin, std::size_t IndexEnd, typename FeSpace>
auto vulpes::fe::grad_contr ( const FeExpressionBase< Dim, FuncExpr > & func,
const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, true > & v,
const FeExpressionGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, false > &  )

Factory function for FeExpressionGradContr with gradient on TRIAL (adjoint form, GradOnTest=false).

Builds: sum_I int_K v_I * F . grad(u_I) dK

Assembles the adjoint stiffness T_{ij} = int_K phi_i * F . grad(phi_j) dK directly – no integration-by-parts, no face terms.

Typical use: auto wf = fe::grad_contr(c_expr, v, fe::grad(u));

Parameters
funcDim-vector expression for F(x).
vVector test function. Must match grad_u's component range.
Note
The unnamed gradient argument (grad_u, gradient of the vector trial function) only selects the overload and is not stored.
Returns
FeExpressionGradContr instance ready for integration.

◆ grad_contr() [2/2]

template<std::size_t Dim, typename FuncExpr, std::size_t IndexBegin, std::size_t IndexEnd, typename FeSpace>
auto vulpes::fe::grad_contr ( const FeExpressionBase< Dim, FuncExpr > & func,
const FeExpressionGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, true > & ,
const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, false > & u )

Factory function for FeExpressionGradContr with gradient on TEST (default, GradOnTest=true).

Builds: sum_I int_K F . grad(v_I) * u_I dK

Template parameters IndexBegin, IndexEnd, Dim, and FeSpace are deduced from the grad_v and u arguments, which must share the same component range and FE space.

Typical use: auto wf = fe::grad_contr(c_expr, fe::grad(v), u);

Parameters
funcDim-vector expression for F(x).
Note
The unnamed gradient argument (grad_v, gradient of the vector test function) only selects the overload and is not stored.
Parameters
uVector trial function. Must match grad_v's component range.
Returns
FeExpressionGradContr instance ready for integration.

◆ grad_contr_block() [1/2]

template<std::size_t TestComp, std::size_t TrialComp, std::size_t Dim, typename FuncExpr, std::size_t IndexBegin, std::size_t IndexEnd, typename FeSpace>
auto vulpes::fe::grad_contr_block ( const FeExpressionBase< Dim, FuncExpr > & func,
const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, true > & v,
const FeExpressionGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, false > &  )

Factory function for FeExpressionGradContrBlock with gradient on TRIAL (adjoint form, GradOnTest=false).

Builds the bilinear expression v_k * F . grad(u_l) for the single (TestComp, TrialComp) component block. TestComp and TrialComp must be specified explicitly; all other template parameters are deduced from v and grad_u.

Assembles: T_{ij} = int_K phi_i * F . grad(phi_j) dK This is the transpose of the test-gradient stiffness – no IBP, no face terms.

Typical use (off-diagonal block k=0, l=1): auto wf = fe::grad_contr_block<0, 1>(A_expr, v, fe::grad(u));

Parameters
funcDim-vector expression for F(x).
vVector test function. Must match grad_u's component range.
Note
The unnamed gradient argument (grad_u, gradient of the vector trial function) only selects the overload and is not stored.
Returns
FeExpressionGradContrBlock instance ready for integration.

◆ grad_contr_block() [2/2]

template<std::size_t TestComp, std::size_t TrialComp, std::size_t Dim, typename FuncExpr, std::size_t IndexBegin, std::size_t IndexEnd, typename FeSpace>
auto vulpes::fe::grad_contr_block ( const FeExpressionBase< Dim, FuncExpr > & func,
const FeExpressionGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, true > & ,
const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, false > & u )

Factory function for FeExpressionGradContrBlock with gradient on TEST (default, GradOnTest=true).

Builds the bilinear expression F . grad(v_k) * u_l for the single (TestComp, TrialComp) component block. TestComp and TrialComp must be specified explicitly; all other template parameters are deduced from grad_v and u.

Assembles: S_{ij} = int_K F . grad(phi_i) * phi_j dK

Typical use (off-diagonal block k=0, l=1): auto wf = fe::grad_contr_block<0, 1>(A_expr, fe::grad(v), u);

Parameters
funcDim-vector expression for F(x).
Note
The unnamed gradient argument (grad_v, gradient of the vector test function) only selects the overload and is not stored.
Parameters
uVector trial function. Must match grad_v's component range.
Returns
FeExpressionGradContrBlock instance ready for integration.

◆ grad_proj()

template<typename FeSpaceType, typename DofHandlerType>
FeGradProjectionExpr< FeSpaceType::dim, FeSpaceType, DofHandlerType > vulpes::fe::grad_proj ( const la::Vector & uh,
const FeSpaceType & fe_space,
const DofHandlerType & dof_handler )

Factory for FeGradProjectionExpr: gradient of a DG field.

Template Parameters
DimSpatial dimension (deduced from FeSpaceType).
FeSpaceTypeFE space type.
DofHandlerTypeDOF handler type.
Parameters
uhDOF coefficient vector of the field.
fe_spaceFE space used to define the basis.
dof_handlerDOF handler mapping cells to DOF indices.
Returns
FeGradProjectionExpr evaluating grad(u_h) at every quadrature point.

◆ inner()

template<std::size_t Dim, typename FeExpressionU, typename FeExpressionV>
FeExpressionInner< Dim, FeExpressionU, FeExpressionV > vulpes::fe::inner ( const FeExpressionBase< Dim, FeExpressionU > & u,
const FeExpressionBase< Dim, FeExpressionV > & v )

◆ inner_block()

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

Factory function for FeExpressionInnerBlock.

Builds the bilinear expression \( c(x) \, u_l \, v_k \) for the single (TestComp, TrialComp) block. TestComp and TrialComp must be specified explicitly; the remaining template parameters are deduced from u and v.

The test argument v may be either a regular vector test function ( FeExpressionFunc<...,true> ) or its neighbour-side wrapper ( FeExpressionNeighborFunc<...,true> obtained via fe::neigh ).

Typical use (off-diagonal coupling between two field components, e.g. one entry of a flux Jacobian split):

auto wf_diag = fe::inner_block<0, 1>(coeff_expr, u, v);
auto wf_neigh = fe::inner_block<0, 1>(coeff_expr, 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
Parameters
coeffScalar coefficient expression \( c(x) \).
uVector trial function (own cell).
vVector test function. Own or neighbour; must share the component range of u.
Returns
FeExpressionInnerBlock instance ready for integration.

◆ make_vec()

template<std::size_t Dim, typename... ScalarExprs>
FeExpressionMakeVec< Dim, ScalarExprs... > vulpes::fe::make_vec ( const FeExpressionBase< Dim, ScalarExprs > &... exprs)

◆ neigh()

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, bool IsTest>
FeExpressionNeighborFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > vulpes::fe::neigh ( const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > & w)

◆ normal()

template<typename FeSpace>
const auto vulpes::fe::normal ( const FeSpace & )

◆ ondiag()

template<std::size_t Dim, typename E>
FeExpressionDiagOnly< Dim, E > vulpes::fe::ondiag ( const E & w)

◆ operator*() [1/3]

template<std::size_t Dim, typename E>
FeExpressionScale< Dim, E > vulpes::fe::operator* ( const FeExpressionBase< Dim, E > & e,
double c )

Scalar-multiply an FE expression: expr * c.

Template Parameters
DimSpatial dimension.
EExpression type.
Parameters
eFE expression to scale.
cScalar multiplier.
Returns
FeExpressionScale wrapping e with factor c.

◆ operator*() [2/3]

template<std::size_t Dim, typename FeExpressionU, typename FeExpressionV>
FeExpressionProduct< Dim, FeExpressionU, FeExpressionV > vulpes::fe::operator* ( const FeExpressionBase< Dim, FeExpressionU > & u,
const FeExpressionBase< Dim, FeExpressionV > & v )

◆ operator*() [3/3]

template<std::size_t Dim, typename E>
FeExpressionScale< Dim, E > vulpes::fe::operator* ( double c,
const FeExpressionBase< Dim, E > & e )

Scalar-multiply an FE expression: c * expr.

Template Parameters
DimSpatial dimension.
EExpression type.
Parameters
cScalar multiplier.
eFE expression to scale.
Returns
FeExpressionScale wrapping e with factor c.

◆ operator+() [1/3]

template<std::size_t Dim, typename E, std::enable_if_t< std::is_same_v< typename E::OutputType, double >, int > = 0>
FeExpressionShift< Dim, E > vulpes::fe::operator+ ( const FeExpressionBase< Dim, E > & e,
double c )

Shift a scalar FE expression by a constant: expr + c.

Template Parameters
DimSpatial dimension.
EExpression type with OutputType = double.
Parameters
eScalar FE expression.
cScalar offset.
Returns
FeExpressionShift wrapping e with offset c.

◆ operator+() [2/3]

template<std::size_t Dim, typename FeExpressionU, typename FeExpressionV>
FeExpressionSum< Dim, FeExpressionU, FeExpressionV > vulpes::fe::operator+ ( const FeExpressionBase< Dim, FeExpressionU > & u,
const FeExpressionBase< Dim, FeExpressionV > & v )

◆ operator+() [3/3]

template<std::size_t Dim, typename E, std::enable_if_t< std::is_same_v< typename E::OutputType, double >, int > = 0>
FeExpressionShift< Dim, E > vulpes::fe::operator+ ( double c,
const FeExpressionBase< Dim, E > & e )

Shift a scalar FE expression by a constant: c + expr.

SFINAE-guarded to scalar expressions (OutputType = double) so that template argument deduction succeeds without ambiguity.

Template Parameters
DimSpatial dimension.
EExpression type with OutputType = double.
Parameters
cScalar offset.
eScalar FE expression.
Returns
FeExpressionShift wrapping e with offset c.

◆ operator-() [1/2]

template<std::size_t Dim, typename E, std::enable_if_t< std::is_same_v< typename E::OutputType, double >, int > = 0>
FeExpressionShift< Dim, E > vulpes::fe::operator- ( const FeExpressionBase< Dim, E > & e,
double c )

Shift a scalar FE expression by a negative constant: expr - c.

Template Parameters
DimSpatial dimension.
EExpression type with OutputType = double.
Parameters
eScalar FE expression.
cScalar value to subtract.
Returns
FeExpressionShift wrapping e with offset -c.

◆ operator-() [2/2]

template<std::size_t Dim, typename FeExpressionU, typename FeExpressionV>
FeExpressionDifference< Dim, FeExpressionU, FeExpressionV > vulpes::fe::operator- ( const FeExpressionBase< Dim, FeExpressionU > & u,
const FeExpressionBase< Dim, FeExpressionV > & v )

◆ outer()

template<std::size_t Dim, typename FeExpressionU, typename FeExpressionV>
FeExpressionOuter< Dim, FeExpressionU, FeExpressionV > vulpes::fe::outer ( const FeExpressionBase< Dim, FeExpressionU > & u,
const FeExpressionBase< Dim, FeExpressionV > & v )

◆ perp()

template<typename E>
auto vulpes::fe::perp ( const FeExpressionBase< 2, E > & e)

2D perpendicular rotation of a 2-vector coefficient expression.

Returns the 90-degree counterclockwise rotation: perp([u, v]) = [-v, u]

Implemented as make_vec(-spatial_component<1>(e), spatial_component<0>(e)). No new class is needed; this is a free factory that composes existing expressions. Only defined for Dim=2 and expressions with OutputType = Eigen::Vector2d.

Typical use (scalar weighting of a perpendicular 2D vector field):

auto w_perp = fe::perp(fe::make_vec(p_proj, q_proj));
auto wf = fe::inner(c * w_perp, V);
auto perp(const FeExpressionBase< 2, E > &e)
2D perpendicular rotation of a 2-vector coefficient expression.
Definition fe_expr_op.hpp:1081
FeExpressionMakeVec< Dim, ScalarExprs... > make_vec(const FeExpressionBase< Dim, ScalarExprs > &... exprs)
Definition fe_expr_op.hpp:764
FeExpressionInner< Dim, FeExpressionU, FeExpressionV > inner(const FeExpressionBase< Dim, FeExpressionU > &u, const FeExpressionBase< Dim, FeExpressionV > &v)
Definition fe_expr_op.hpp:224
Template Parameters
EExpression type; OutputType must be Eigen::Vector<double,2>.
Parameters
e2D vector-output coefficient expression.
Returns
make_vec(-spatial_component<1>(e), spatial_component<0>(e)).

◆ self()

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, bool IsTest>
FeExpressionSelfFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > vulpes::fe::self ( const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > & w)

◆ shift() [1/2]

template<std::size_t Dim, typename E>
FeExpressionShift< Dim, E > vulpes::fe::shift ( const FeExpressionBase< Dim, E > & e,
const typename E::OutputType & c )

General shift factory: expr + c, works for any OutputType.

Template Parameters
DimSpatial dimension.
EExpression type.
Parameters
eFE expression.
cConstant offset of type E::OutputType.
Returns
FeExpressionShift wrapping e with offset c.

◆ shift() [2/2]

template<std::size_t Dim, typename E>
FeExpressionShift< Dim, E > vulpes::fe::shift ( const typename E::OutputType & c,
const FeExpressionBase< Dim, E > & e )

General shift factory: c + expr, works for any OutputType.

Use this form for vector expressions where operator+ is not available due to template deduction limitations:

fe::shift(Eigen::Vector2d(1.0, -1.0), fe::make_vec(u_proj, v_proj))
FeExpressionShift< Dim, E > shift(const typename E::OutputType &c, const FeExpressionBase< Dim, E > &e)
General shift factory: c + expr, works for any OutputType.
Definition fe_expr_op.hpp:1037
Template Parameters
DimSpatial dimension.
EExpression type.
Parameters
cConstant offset of type E::OutputType.
eFE expression.
Returns
FeExpressionShift wrapping e with offset c.

◆ skip()

template<std::size_t Dim, typename E>
auto vulpes::fe::skip ( const E & expr,
const typename FeExpressionSkipper< Dim, E >::FuncType & func )

◆ spatial_component()

template<std::size_t K, std::size_t Dim, typename E>
FeExpressionSpatialComponent< K, Dim, E > vulpes::fe::spatial_component ( const FeExpressionBase< Dim, E > & e)

Extract the K-th scalar spatial component of a vector-output FE expression at every quadrature point.

Template Parameters
KCompile-time spatial component index (zero-based).
DimSpatial dimension.
EExpression type whose evaluate() returns a type supporting operator[].
Parameters
eVector-output FE expression.
Returns
FeExpressionSpatialComponent wrapping e, evaluating to e(q)[K].

◆ symgrad()

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, bool IsTest>
FeExpressionSymGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > vulpes::fe::symgrad ( const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > & w)

◆ trsymgrad()

template<std::size_t IndexBegin, std::size_t IndexEnd, std::size_t Dim, typename FeSpace, bool IsTest>
FeExpressionTraceSymGradFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > vulpes::fe::trsymgrad ( const FeExpressionFunc< IndexBegin, IndexEnd, Dim, FeSpace, IsTest > & w)