version 0.4.1
Ikarus::FE< PreFE, Skills > Class Template Reference

FE class is a base class for all finite elements. More...

#include <ikarus/finiteelements/febase.hh>

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

Public Types

using Traits = PreFE::Traits
 Type traits. More...
 
using BasisHandler = Traits::BasisHandler
 Type of the basisHandler. More...
 
using LocalView = typename Traits::LocalView
 Type of the local view. More...
 
using GridView = typename Traits::GridView
 Type of the global view. More...
 
using GlobalIndex = typename Traits::GlobalIndex
 Type of the global index. More...
 
using GridElement = typename Traits::Element
 Type of the grid element. More...
 
using PreTuple = std::tuple< typename Skills< PreFE, FE >::Pre... >
 
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 Requirement = RequirementType< requirementDetected >::type
 

Public Member Functions

 FE (const BasisHandler &basisHandler, typename Skills< PreFE, FE >::Pre... skillsArgs)
 Constructor for the FE class. More...
 
void bind (const GridElement &element)
 Convenient function to bind the local view to the element. More...
 
constexpr size_t size () const
 Get the size of the local view. More...
 
const GridElementgridElement () const
 Get the grid element associated with the local view. More...
 
const LocalViewlocalView () const
 Get the const reference to the local view. More...
 
LocalViewlocalView ()
 Get the reference to the local view. More...
 
auto calculateAt (const Requirement &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...
 
auto calculateScalarImpl (const Requirement &par, ScalarAffordance affordance, 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...
 
void calculateVectorImpl (const Requirement &par, VectorAffordance affordance, 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...
 
void calculateMatrixImpl (const Requirement &par, MatrixAffordance affordance, 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

static consteval bool hasSkill ()
 Checks if the mixin class has a specific skill. More...
 
static auto createRequirement ()
 Create a Requirement object. More...
 

Static Public Attributes

static constexpr int myDim = Traits::mydim
 
static constexpr int worldDim = Traits::worlddim
 

Protected Types

using Mixin = FEMixin< PreFE, Skills... >
 Type of the FE mixin. More...
 

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...
 

Protected Attributes

friend Mixin
 

Detailed Description

template<typename PreFE, template< typename, typename > class... Skills>
class Ikarus::FE< PreFE, Skills >

A single class which can be used by the finite elements to get different information from the local view of the element. It works for both the flat and untouched version of the basis.

Template Parameters
PreFEThe type of the pre finite element.
SkillsVariadic template for skill arguments possessed by the FE.

Member Typedef Documentation

◆ BasisHandler

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

◆ GlobalIndex

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

◆ GridElement

template<typename PreFE , template< typename, typename > class... Skills>
using Ikarus::FE< PreFE, Skills >::GridElement = typename Traits::Element

◆ GridView

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

◆ LocalView

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

◆ Mixin

template<typename PreFE , template< typename, typename > class... Skills>
using Ikarus::FE< PreFE, Skills >::Mixin = FEMixin<PreFE, Skills...>
protected

◆ PreTuple

template<typename PreFE , template< typename, typename > class... Skills>
using Ikarus::FE< PreFE, Skills >::PreTuple = std::tuple<typename Skills<PreFE, FE>::Pre...>

◆ Requirement

using Ikarus::FEMixin< PreFE, Skills... >::Requirement = RequirementType<requirementDetected>::type
inherited

◆ SupportedResultTypes

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

◆ Traits

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

Constructor & Destructor Documentation

◆ FE()

template<typename PreFE , template< typename, typename > class... Skills>
Ikarus::FE< PreFE, Skills >::FE ( const BasisHandler basisHandler,
typename Skills< PreFE< PreFE, Skills >, FE< PreFE, Skills > >::Pre...  skillsArgs 
)
inlineexplicit
Parameters
basisHandlerThe basis handler.
skillsArgsSkill arguments.

Member Function Documentation

◆ bind() [1/2]

void Ikarus::FEMixin< PreFE, Skills... >::bind ( )
inlineinherited

◆ bind() [2/2]

template<typename PreFE , template< typename, typename > class... Skills>
void Ikarus::FE< PreFE, Skills >::bind ( const GridElement element)
inline
Parameters
elementThe element to be bounded
Here is the caller graph for this function:

◆ calculateAt()

auto Ikarus::FEMixin< PreFE, Skills... >::calculateAt ( const Requirement req,
const Dune::FieldVector< double, Traits::mydim > &  local 
) const
inlineinherited
Template Parameters
RTThe ResultType to calculate.
Parameters
reqThe Requirement 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()

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

◆ calculateScalarImpl()

auto Ikarus::FEMixin< PreFE, Skills... >::calculateScalarImpl ( const Requirement par,
ScalarAffordance  affordance,
const std::optional< std::reference_wrapper< const Eigen::VectorX< ScalarType > > > &  dx = std::nullopt 
) const
inlineinherited
Template Parameters
ScalarTypeThe scalar type for the calculation.
Parameters
parThe Requirement object specifying the requirements for the calculation.
dxOptional vector used in the calculation.
Returns
The calculated scalar value.

◆ calculateVectorImpl()

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

◆ createRequirement()

static auto Ikarus::FEMixin< PreFE, Skills... >::createRequirement ( )
inlinestaticinherited
Returns
The created Requirement object.

◆ gridElement()

template<typename PreFE , template< typename, typename > class... Skills>
const GridElement & Ikarus::FE< PreFE, Skills >::gridElement ( ) const
inline
Returns
The grid element.
Here is the caller graph for this function:

◆ hasSkill()

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

◆ localView() [1/2]

template<typename PreFE , template< typename, typename > class... Skills>
LocalView & Ikarus::FE< PreFE, Skills >::localView ( )
inline
Returns
The reference to the local view.

◆ localView() [2/2]

template<typename PreFE , template< typename, typename > class... Skills>
const LocalView & Ikarus::FE< PreFE, Skills >::localView ( ) const
inline
Returns
The const reference to the local view.
Here is the caller graph for this function:

◆ size()

template<typename PreFE , template< typename, typename > class... Skills>
constexpr size_t Ikarus::FE< PreFE, Skills >::size ( ) const
inlineconstexpr
Returns
The size of the local view.

◆ underlying() [1/2]

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

◆ underlying() [2/2]

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

Member Data Documentation

◆ Mixin

template<typename PreFE , template< typename, typename > class... Skills>
friend Ikarus::FE< PreFE, Skills >::Mixin
protected

◆ myDim

template<typename PreFE , template< typename, typename > class... Skills>
constexpr int Ikarus::FE< PreFE, Skills >::myDim = Traits::mydim
staticconstexpr

◆ worldDim

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

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