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

NonLinearElastic class represents a non-linear elastic finite element. More...

#include <ikarus/finiteelements/mechanics/nonlinearelastic.hh>

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

Public Types

using Traits = PreFE::Traits
 
using Basis = typename Traits::Basis
 
using FlatBasis = typename Traits::FlatBasis
 
using Requirement = FERequirements< FESolutions::displacement, FEParameter::loadfactor >
 
using LocalView = typename Traits::LocalView
 
using Geometry = typename Traits::Geometry
 
using GridView = typename Traits::GridView
 
using Element = typename Traits::Element
 
using Material = PRE::Material
 
using Pre = PRE
 
using LocalBasisType = decltype(std::declval< LocalView >().tree().child(0).finiteElement().localBasis())
 
template<typename ST >
using VectorXOptRef = std::optional< std::reference_wrapper< const Eigen::VectorX< ST > > >
 
template<template< typename, int, int > class RT>
using RTWrapperType = ResultWrapper< RT< typename Traits::ctype, myDim, Traits::worlddim >, ResultShape::Vector >
 
template<typename ST >
using StrainType = Eigen::Vector< ST, strainDim >
 
template<typename ST >
using BopType = Eigen::Matrix< ST, strainDim, myDim >
 
template<typename ST >
using KgType = Eigen::Matrix< ST, myDim, myDim >
 
using SupportedResultTypes = std::tuple< decltype(makeRT< ResultTypes >())... >
 

Public Member Functions

 NonLinearElastic (const Pre &pre)
 Constructor for the NonLinearElastic class. More...
 
template<typename ScalarType = double>
auto displacementFunction (const Requirement &par, const VectorXOptRef< ScalarType > &dx=std::nullopt) const
 Get the displacement function for the given Requirement. More...
 
template<typename ScalarType = double>
auto strainFunction (const Requirement &par, const VectorXOptRef< ScalarType > &dx=std::nullopt) const
 The strain function for the given Requirement. More...
 
template<typename ScalarType , int strainDim>
auto internalEnergy (const Eigen::Vector< ScalarType, strainDim > &strain) const
 Get the internal energy for the given strain. More...
 
template<typename ScalarType , int strainDim, bool voigt = true>
auto stress (const Eigen::Vector< ScalarType, strainDim > &strain) const
 Get the stress for the given strain. More...
 
template<typename ScalarType , int strainDim, bool voigt = true>
auto materialTangent (const Eigen::Vector< ScalarType, strainDim > &strain) const
 Get the material tangent for the given strain for the given Requirement. More...
 
const Geometrygeometry () const
 
size_t numberOfNodes () const
 
int order () const
 
const Dune::CachedLocalBasis< std::remove_cvref_t< LocalBasisType > > & localBasis () const
 
template<typename ScalarType = double>
decltype(auto) material () const
 
template<template< typename, int, int > class RT>
requires (supportsResultType<RT>())
auto resultFunction () const
 Get a lambda function that evaluates the requested result type for a given strain (in Voigt notation). More...
 
template<template< typename, int, int > class RT>
requires (supportsResultType<RT>())
auto calculateAtImpl (const Requirement &req, const Dune::FieldVector< double, Traits::mydim > &local, Dune::PriorityTag< 1 >) const
 Calculates a requested result at a specific local position. More...
 
template<typename ST >
auto stiffnessMatrixFunction (const Requirement &par, typename Traits::template MatrixType< ST > &K, const VectorXOptRef< ST > &dx=std::nullopt) const
 Get a lambda function that evaluates the stiffness matrix for a given strain, integration point and its index. More...
 
template<typename ST >
auto internalForcesFunction (const Requirement &par, typename Traits::template VectorType< ST > &force, const VectorXOptRef< ST > &dx=std::nullopt) const
 Get a lambda function that evaluates the internal force vector for a given strain, integration point and its index. More...
 
template<typename ST >
auto energyFunction (const Requirement &par, const VectorXOptRef< ST > &dx=std::nullopt) const
 Get a lambda function that evaluates the internal energy at a given integration point and its index. More...
 

Static Public Member Functions

static consteval bool supportsResultType ()
 Returns whether a ResultType is provided by the element. More...
 

Static Public Attributes

static constexpr int myDim = Traits::mydim
 
static constexpr int strainDim = myDim * (myDim + 1) / 2
 
static constexpr auto strainType = StrainTags::greenLagrangian
 
static constexpr auto stressType = StressTags::PK2
 
static constexpr bool hasEAS
 

Protected Member Functions

void bindImpl ()
 A helper function to bind the local view to the element. More...
 
template<typename ScalarType >
void calculateMatrixImpl (const Requirement &par, const MatrixAffordance &affordance, typename Traits::template MatrixType<> K, const VectorXOptRef< ScalarType > &dx=std::nullopt) const
 Calculate the matrix associated with the given Requirement. More...
 
template<typename ScalarType >
auto calculateScalarImpl (const Requirement &par, ScalarAffordance affordance, const VectorXOptRef< ScalarType > &dx=std::nullopt) const -> ScalarType
 
template<typename ScalarType >
void calculateVectorImpl (const Requirement &par, VectorAffordance affordance, typename Traits::template VectorType< ScalarType > force, const VectorXOptRef< ScalarType > &dx=std::nullopt) const
 

Detailed Description

template<typename PreFE, typename FE, typename PRE>
class Ikarus::NonLinearElastic< PreFE, FE, PRE >
Template Parameters
PreFEThe type of the total pre finite element.
FEThe type of the finite element.
PREThe type of the non-linear elastic pre finite element.

Member Typedef Documentation

◆ Basis

template<typename PreFE , typename FE , typename PRE >
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::Basis = typename Traits::Basis

◆ BopType

template<typename PreFE , typename FE , typename PRE >
template<typename ST >
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::BopType = Eigen::Matrix<ST, strainDim, myDim>

◆ Element

template<typename PreFE , typename FE , typename PRE >
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::Element = typename Traits::Element

◆ FlatBasis

template<typename PreFE , typename FE , typename PRE >
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::FlatBasis = typename Traits::FlatBasis

◆ Geometry

template<typename PreFE , typename FE , typename PRE >
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::Geometry = typename Traits::Geometry

◆ GridView

template<typename PreFE , typename FE , typename PRE >
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::GridView = typename Traits::GridView

◆ KgType

template<typename PreFE , typename FE , typename PRE >
template<typename ST >
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::KgType = Eigen::Matrix<ST, myDim, myDim>

◆ LocalBasisType

template<typename PreFE , typename FE , typename PRE >
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::LocalBasisType = decltype(std::declval<LocalView>().tree().child(0).finiteElement().localBasis())

◆ LocalView

template<typename PreFE , typename FE , typename PRE >
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::LocalView = typename Traits::LocalView

◆ Material

template<typename PreFE , typename FE , typename PRE >
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::Material = PRE::Material

◆ Pre

template<typename PreFE , typename FE , typename PRE >
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::Pre = PRE

◆ Requirement

template<typename PreFE , typename FE , typename PRE >
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::Requirement = FERequirements<FESolutions::displacement, FEParameter::loadfactor>

◆ RTWrapperType

template<typename PreFE , typename FE , typename PRE >
template<template< typename, int, int > class RT>
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::RTWrapperType = ResultWrapper<RT<typename Traits::ctype, myDim, Traits::worlddim>, ResultShape::Vector>

◆ StrainType

template<typename PreFE , typename FE , typename PRE >
template<typename ST >
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::StrainType = Eigen::Vector<ST, strainDim>

◆ SupportedResultTypes

using Ikarus::ResultTypeBase< ResultTypes >::SupportedResultTypes = std::tuple<decltype(makeRT<ResultTypes>())...>
inherited

◆ Traits

template<typename PreFE , typename FE , typename PRE >
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::Traits = PreFE::Traits

◆ VectorXOptRef

template<typename PreFE , typename FE , typename PRE >
template<typename ST >
using Ikarus::NonLinearElastic< PreFE, FE, PRE >::VectorXOptRef = std::optional<std::reference_wrapper<const Eigen::VectorX<ST> >>

Constructor & Destructor Documentation

◆ NonLinearElastic()

template<typename PreFE , typename FE , typename PRE >
Ikarus::NonLinearElastic< PreFE, FE, PRE >::NonLinearElastic ( const Pre pre)
inlineexplicit
Parameters
preThe pre fe

Member Function Documentation

◆ bindImpl()

template<typename PreFE , typename FE , typename PRE >
void Ikarus::NonLinearElastic< PreFE, FE, PRE >::bindImpl ( )
inlineprotected

◆ calculateAtImpl()

template<typename PreFE , typename FE , typename PRE >
template<template< typename, int, int > class RT>
requires (supportsResultType<RT>())
auto Ikarus::NonLinearElastic< PreFE, FE, PRE >::calculateAtImpl ( const Requirement req,
const Dune::FieldVector< double, Traits::mydim > &  local,
Dune::PriorityTag< 1 >   
) const
inline
Parameters
reqThe Requirement object holding the global solution.
localLocal position vector.
Returns
calculated result
Template Parameters
RTThe type representing the requested result.

◆ calculateMatrixImpl()

template<typename PreFE , typename FE , typename PRE >
template<typename ScalarType >
void Ikarus::NonLinearElastic< PreFE, FE, PRE >::calculateMatrixImpl ( const Requirement par,
const MatrixAffordance affordance,
typename Traits::template MatrixType<>  K,
const VectorXOptRef< ScalarType > &  dx = std::nullopt 
) const
inlineprotected
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.

◆ calculateScalarImpl()

template<typename PreFE , typename FE , typename PRE >
template<typename ScalarType >
auto Ikarus::NonLinearElastic< PreFE, FE, PRE >::calculateScalarImpl ( const Requirement par,
ScalarAffordance  affordance,
const VectorXOptRef< ScalarType > &  dx = std::nullopt 
) const -> ScalarType
inlineprotected

◆ calculateVectorImpl()

template<typename PreFE , typename FE , typename PRE >
template<typename ScalarType >
void Ikarus::NonLinearElastic< PreFE, FE, PRE >::calculateVectorImpl ( const Requirement par,
VectorAffordance  affordance,
typename Traits::template VectorType< ScalarType >  force,
const VectorXOptRef< ScalarType > &  dx = std::nullopt 
) const
inlineprotected

◆ displacementFunction()

template<typename PreFE , typename FE , typename PRE >
template<typename ScalarType = double>
auto Ikarus::NonLinearElastic< PreFE, FE, PRE >::displacementFunction ( const Requirement par,
const VectorXOptRef< ScalarType > &  dx = std::nullopt 
) const
inline
Template Parameters
ScalarTypeThe scalar type for the displacement function.
Parameters
parThe Requirement object.
dxOptional displacement vector.
Returns
A StandardLocalFunction representing the displacement function.
Here is the caller graph for this function:

◆ energyFunction()

template<typename PreFE , typename FE , typename PRE >
template<typename ST >
auto Ikarus::NonLinearElastic< PreFE, FE, PRE >::energyFunction ( const Requirement par,
const VectorXOptRef< ST > &  dx = std::nullopt 
) const
inline
Template Parameters
STThe scalar type for the material and strain.
Parameters
parThe Requirement object.
dxOptional displacement vector.
Returns
A lambda function that returns the intenral energy at a given integration point and its index.
Here is the caller graph for this function:

◆ geometry()

template<typename PreFE , typename FE , typename PRE >
const Geometry & Ikarus::NonLinearElastic< PreFE, FE, PRE >::geometry ( ) const
inline

◆ internalEnergy()

template<typename PreFE , typename FE , typename PRE >
template<typename ScalarType , int strainDim>
auto Ikarus::NonLinearElastic< PreFE, FE, PRE >::internalEnergy ( const Eigen::Vector< ScalarType, strainDim > &  strain) const
inline
Template Parameters
ScalarTypeThe scalar type for the material and strain.
strainDimThe dimension of the strain vector.
Parameters
strainThe strain vector.
Returns
The internal energy calculated using the material's storedEnergy function.
Here is the caller graph for this function:

◆ internalForcesFunction()

template<typename PreFE , typename FE , typename PRE >
template<typename ST >
auto Ikarus::NonLinearElastic< PreFE, FE, PRE >::internalForcesFunction ( const Requirement par,
typename Traits::template VectorType< ST > &  force,
const VectorXOptRef< ST > &  dx = std::nullopt 
) const
inline
Template Parameters
STThe scalar type for the material and strain.
Parameters
parThe Requirement object.
dxOptional displacement vector.
forceThe vector to store the calculated result.
Returns
A lambda function that evaluates the intenral force vector for a given strain, integration point and its index.

◆ localBasis()

template<typename PreFE , typename FE , typename PRE >
const Dune::CachedLocalBasis< std::remove_cvref_t< LocalBasisType > > & Ikarus::NonLinearElastic< PreFE, FE, PRE >::localBasis ( ) const
inline

◆ material()

template<typename PreFE , typename FE , typename PRE >
template<typename ScalarType = double>
decltype(auto) Ikarus::NonLinearElastic< PreFE, FE, PRE >::material ( ) const
inline

◆ materialTangent()

template<typename PreFE , typename FE , typename PRE >
template<typename ScalarType , int strainDim, bool voigt = true>
auto Ikarus::NonLinearElastic< PreFE, FE, PRE >::materialTangent ( const Eigen::Vector< ScalarType, strainDim > &  strain) const
inline
Template Parameters
ScalarTypeThe scalar type for the material and strain.
strainDimThe dimension of the strain vector.
voigtFlag indicating whether to use Voigt notation.
Parameters
strainThe strain vector.
Returns
The material tangent calculated using the material's tangentModuli function.
Here is the caller graph for this function:

◆ numberOfNodes()

template<typename PreFE , typename FE , typename PRE >
size_t Ikarus::NonLinearElastic< PreFE, FE, PRE >::numberOfNodes ( ) const
inline

◆ order()

template<typename PreFE , typename FE , typename PRE >
int Ikarus::NonLinearElastic< PreFE, FE, PRE >::order ( ) const
inline

◆ resultFunction()

template<typename PreFE , typename FE , typename PRE >
template<template< typename, int, int > class RT>
requires (supportsResultType<RT>())
auto Ikarus::NonLinearElastic< PreFE, FE, PRE >::resultFunction ( ) const
inline
Template Parameters
RTThe type representing the requested result.
Returns
A lambda function that evaluates the requested result type for a given strain (in Voigt notation).

◆ stiffnessMatrixFunction()

template<typename PreFE , typename FE , typename PRE >
template<typename ST >
auto Ikarus::NonLinearElastic< PreFE, FE, PRE >::stiffnessMatrixFunction ( const Requirement par,
typename Traits::template MatrixType< ST > &  K,
const VectorXOptRef< ST > &  dx = std::nullopt 
) const
inline
Template Parameters
STThe scalar type for the material and strain.
Parameters
parThe Requirement object.
dxOptional displacement vector.
KThe matrix to store the calculated result.
Returns
A lambda function that evaluates the stiffness matrix for a given strain, integration point and its index.

◆ strainFunction()

template<typename PreFE , typename FE , typename PRE >
template<typename ScalarType = double>
auto Ikarus::NonLinearElastic< PreFE, FE, PRE >::strainFunction ( const Requirement par,
const VectorXOptRef< ScalarType > &  dx = std::nullopt 
) const
inline
Template Parameters
ScalarTypeThe scalar type for the strain function.
Parameters
parThe Requirement object.
dxOptional displacement vector.
Returns
The strain function calculated using greenLagrangeStrains.
Here is the caller graph for this function:

◆ stress()

template<typename PreFE , typename FE , typename PRE >
template<typename ScalarType , int strainDim, bool voigt = true>
auto Ikarus::NonLinearElastic< PreFE, FE, PRE >::stress ( const Eigen::Vector< ScalarType, strainDim > &  strain) const
inline
Template Parameters
ScalarTypeThe scalar type for the material and strain.
strainDimThe dimension of the strain vector.
voigtA boolean indicating whether to use the Voigt notation for stress.
Parameters
strainThe strain vector.
Returns
The stress vector calculated using the material's stresses function.
Here is the caller graph for this function:

◆ supportsResultType()

static consteval bool Ikarus::ResultTypeBase< ResultTypes >::supportsResultType ( )
inlinestaticinherited
Template Parameters
RTrequested ResultType

Member Data Documentation

◆ hasEAS

template<typename PreFE , typename FE , typename PRE >
constexpr bool Ikarus::NonLinearElastic< PreFE, FE, PRE >::hasEAS
staticconstexpr
Initial value:
= FE::template hasEAS<EAS::GreenLagrangeStrain> or
FE::template hasEAS<EAS::DisplacementGradient> or
FE::template hasEAS<EAS::DisplacementGradientTransposed>

◆ myDim

template<typename PreFE , typename FE , typename PRE >
constexpr int Ikarus::NonLinearElastic< PreFE, FE, PRE >::myDim = Traits::mydim
staticconstexpr

◆ strainDim

template<typename PreFE , typename FE , typename PRE >
constexpr int Ikarus::NonLinearElastic< PreFE, FE, PRE >::strainDim = myDim * (myDim + 1) / 2
staticconstexpr

◆ strainType

template<typename PreFE , typename FE , typename PRE >
constexpr auto Ikarus::NonLinearElastic< PreFE, FE, PRE >::strainType = StrainTags::greenLagrangian
staticconstexpr

◆ stressType

template<typename PreFE , typename FE , typename PRE >
constexpr auto Ikarus::NonLinearElastic< PreFE, FE, PRE >::stressType = StressTags::PK2
staticconstexpr

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