version 0.4.1
Ikarus::FEMixin< PreFE, Skills > Struct Template Reference

CRTP mixin class for finite elements with additional skills. More...

#include <ikarus/finiteelements/mixin.hh>

Inheritance diagram for Ikarus::FEMixin< PreFE, Skills >:
[legend]

Public Types

using SupportedResultTypes = decltype(std::tuple_cat(computeSupportedResultTypes< Skills< PreFE, typename PreFE::template FE< Skills... > > >()...))
 Type alias for the supported result types by the mixin. More...
 
using Traits = PreFE::Traits
 
using FERequirementType = typename Traits::FERequirementType
 
using LocalView = typename Traits::LocalView
 
using Args = std::tuple< ARGS... >
 

Public Member Functions

 FEMixin (typename Skills< PreFE, typename PreFE::template FE< Skills... > >::Pre &&... skillsArgs)
 Constructor for the FEMixin class. More...
 
template<template< typename, int, int > class RT>
requires requires(FEMixin m, const FERequirementType& req, const Dune::FieldVector<double, Traits::mydim>& local) { m.template calculateAtImpl<RT>(req, local, Dune::PriorityTag<10>()); }
auto calculateAt (const FERequirementType &req, const Dune::FieldVector< double, Traits::mydim > &local) const
 Calculate the element values at a specific location for a given ResultType. More...
 
void bind ()
 Call all bind functions if the skill implements it. More...
 
template<typename ScalarType = double>
requires implementsCalculateScalarImpl
auto calculateScalarImpl (const FERequirementType &par, const std::optional< std::reference_wrapper< const Eigen::VectorX< ScalarType > > > &dx=std::nullopt) const
 Calculate the scalar value in each skill and joins them by +. More...
 
template<typename ScalarType >
requires implementsCalculateVectorImpl
void calculateVectorImpl (const FERequirementType &par, typename Traits::template VectorType< ScalarType > force, const std::optional< std::reference_wrapper< const Eigen::VectorX< ScalarType > > > &dx=std::nullopt) const
 Calculate the vector for each skill. More...
 
template<typename ScalarType >
requires implementsCalculateMatrixImpl
void calculateMatrixImpl (const FERequirementType &par, typename Traits::template MatrixType< ScalarType > K, const std::optional< std::reference_wrapper< const Eigen::VectorX< ScalarType > > > &dx=std::nullopt) const
 Calculate the matrix for each skill. More...
 

Static Public Member Functions

template<template< typename, typename > class Skill>
static consteval bool hasSkill ()
 Checks if the mixin class has a specific skill. More...
 

Public Attributes

Args args
 

Static Public Attributes

static constexpr int worldDim = Traits::worlddim
 

Protected Member Functions

const auto & underlying () const
 Get a reference to the underlying finite element object. More...
 
auto & underlying ()
 Get a reference to the underlying finite element object. More...
 

Detailed Description

template<typename PreFE, template< typename, typename > class... Skills>
struct Ikarus::FEMixin< PreFE, Skills >

This mixin class is designed for finite elements and provides the ability to include additional skills through the CRTP (Curiously Recurring Template Pattern).

Template Parameters
PreFEThe base finite element class.
SkillsA template parameter pack for additional skills to be mixed into the finite element.

Member Typedef Documentation

◆ Args

using Ikarus::Skills< ARGS >::Args = std::tuple<ARGS...>
inherited

◆ FERequirementType

template<typename PreFE , template< typename, typename > class... Skills>
using Ikarus::FEMixin< PreFE, Skills >::FERequirementType = typename Traits::FERequirementType

◆ LocalView

template<typename PreFE , template< typename, typename > class... Skills>
using Ikarus::FEMixin< PreFE, Skills >::LocalView = typename Traits::LocalView

◆ SupportedResultTypes

template<typename PreFE , template< typename, typename > class... Skills>
using Ikarus::FEMixin< PreFE, Skills >::SupportedResultTypes = decltype(std::tuple_cat(computeSupportedResultTypes<Skills<PreFE, typename PreFE::template FE<Skills...> >>()...))

◆ Traits

template<typename PreFE , template< typename, typename > class... Skills>
using Ikarus::FEMixin< PreFE, Skills >::Traits = PreFE::Traits

Constructor & Destructor Documentation

◆ FEMixin()

template<typename PreFE , template< typename, typename > class... Skills>
Ikarus::FEMixin< PreFE, Skills >::FEMixin ( typename Skills< PreFE, typename PreFE::template FE< Skills... > >::Pre &&...  skillsArgs)
inlineexplicit
Parameters
skillsArgsVariadic arguments for initializing the additional skills.

Member Function Documentation

◆ bind()

template<typename PreFE , template< typename, typename > class... Skills>
void Ikarus::FEMixin< PreFE, Skills >::bind ( )
inline

◆ calculateAt()

template<typename PreFE , template< typename, typename > class... Skills>
template<template< typename, int, int > class RT>
requires requires(FEMixin m, const FERequirementType& req, const Dune::FieldVector<double, Traits::mydim>& local) { m.template calculateAtImpl<RT>(req, local, Dune::PriorityTag<10>()); }
auto Ikarus::FEMixin< PreFE, Skills >::calculateAt ( const FERequirementType req,
const Dune::FieldVector< double, Traits::mydim > &  local 
) const
inline
Template Parameters
RTThe ResultType to calculate.
Parameters
reqThe FERequirementType object specifying the requirements for the calculation.
localThe local coordinates where the calculation is performed.
Returns
The calculated result as specified by the ResultType.

◆ calculateMatrixImpl()

template<typename PreFE , template< typename, typename > class... Skills>
template<typename ScalarType >
requires implementsCalculateMatrixImpl
void Ikarus::FEMixin< PreFE, Skills >::calculateMatrixImpl ( const FERequirementType par,
typename Traits::template MatrixType< ScalarType >  K,
const std::optional< std::reference_wrapper< const Eigen::VectorX< ScalarType > > > &  dx = std::nullopt 
) const
inline
Template Parameters
ScalarTypeThe scalar type for the calculation.
Parameters
parThe FERequirementType object specifying the requirements for the calculation.
KThe matrix to store the calculated result.
dxOptional vector used in the calculation.

◆ calculateScalarImpl()

template<typename PreFE , template< typename, typename > class... Skills>
template<typename ScalarType = double>
requires implementsCalculateScalarImpl
auto Ikarus::FEMixin< PreFE, Skills >::calculateScalarImpl ( const FERequirementType par,
const std::optional< std::reference_wrapper< const Eigen::VectorX< ScalarType > > > &  dx = std::nullopt 
) const
inline
Template Parameters
ScalarTypeThe scalar type for the calculation.
Parameters
parThe FERequirementType object specifying the requirements for the calculation.
dxOptional vector used in the calculation.
Returns
The calculated scalar value.

◆ calculateVectorImpl()

template<typename PreFE , template< typename, typename > class... Skills>
template<typename ScalarType >
requires implementsCalculateVectorImpl
void Ikarus::FEMixin< PreFE, Skills >::calculateVectorImpl ( const FERequirementType par,
typename Traits::template VectorType< ScalarType >  force,
const std::optional< std::reference_wrapper< const Eigen::VectorX< ScalarType > > > &  dx = std::nullopt 
) const
inline
Template Parameters
ScalarTypeThe scalar type for the calculation.
Parameters
parThe FERequirementType object specifying the requirements for the calculation.
forceThe vector to store the calculated result.
dxOptional vector used in the calculation.

◆ hasSkill()

template<typename PreFE , template< typename, typename > class... Skills>
template<template< typename, typename > class Skill>
static consteval bool Ikarus::FEMixin< PreFE, Skills >::hasSkill ( )
inlinestatic
Template Parameters
SkillThe skill to check for.
Returns
True if the skill is present, false otherwise.

◆ underlying() [1/2]

template<typename PreFE , template< typename, typename > class... Skills>
auto & Ikarus::FEMixin< PreFE, Skills >::underlying ( )
inlineprotected
Returns
A reference to the underlying finite element object.

◆ underlying() [2/2]

template<typename PreFE , template< typename, typename > class... Skills>
const auto & Ikarus::FEMixin< PreFE, Skills >::underlying ( ) const
inlineprotected
Returns
A reference to the underlying finite element object.

Member Data Documentation

◆ args

Args Ikarus::Skills< ARGS >::args
inherited

◆ worldDim

template<typename PreFE , template< typename, typename > class... Skills>
constexpr int Ikarus::FEMixin< PreFE, Skills >::worldDim = Traits::worlddim
staticconstexpr

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