version 0.4
Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef > Class Template Reference

LinearElastic class represents a linear elastic finite element. More...

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

Inheritance diagram for Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >:
[legend]

Public Types

using Traits = TraitsFromFE< Basis_, FERequirements_, useEigenRef >
 
using Basis = typename Traits::Basis
 
using FlatBasis = typename Traits::FlatBasis
 
using FERequirementType = typename Traits::FERequirementType
 
using LocalView = typename Traits::LocalView
 
using Geometry = typename Traits::Geometry
 
using GridView = typename Traits::GridView
 
using Element = typename Traits::Element
 
using ResultRequirementsType = typename Traits::ResultRequirementsType
 
using BaseDisp = PowerBasisFE< FlatBasis >
 
using VolumeType = Volume< LinearElastic< Basis_, FERequirements_, useEigenRef >, Traits >
 
using TractionType = Traction< LinearElastic< Basis_, FERequirements_, useEigenRef >, Traits >
 
using LocalBasisType = decltype(std::declval< LocalView >().tree().child(0).finiteElement().localBasis())
 
using RootBasis = Basis_::FlatBasis
 Type of the root basis. More...
 
using GlobalIndex = typename LocalView::MultiIndex
 Type of the global index. More...
 
using GridElement = typename LocalView::Element
 Type of the grid element. More...
 

Public Member Functions

template<typename VolumeLoad = utils::LoadDefault, typename NeumannBoundaryLoad = utils::LoadDefault>
 LinearElastic (const Basis &globalBasis, const typename LocalView::Element &element, double emod, double nu, VolumeLoad p_volumeLoad={}, const BoundaryPatch< GridView > *p_neumannBoundary=nullptr, NeumannBoundaryLoad p_neumannBoundaryLoad={})
 Constructor for the LinearElastic class. More...
 
template<typename ScalarType = double>
auto displacementFunction (const FERequirementType &par, const std::optional< const Eigen::VectorX< ScalarType > > &dx=std::nullopt) const
 Gets the displacement function for the given FERequirementType and optional displacement vector. More...
 
template<class ScalarType = double>
auto strainFunction (const FERequirementType &par, const std::optional< const Eigen::VectorX< ScalarType > > &dx=std::nullopt) const
 Gets the strain function for the given FERequirementType and optional displacement vector. More...
 
auto materialTangent () const
 Gets the material tangent matrix for the linear elastic material. More...
 
auto materialTangentFunction (const FERequirementType &par) const
 Gets the material tangent function for the given FERequirementType. More...
 
const Geometrygeometry () const
 
size_t numberOfNodes () const
 
int order () const
 
double calculateScalar (const FERequirementType &par) const
 Calculates the scalar energy for the given FERequirementType. More...
 
void calculateVector (const FERequirementType &par, typename Traits::template VectorType<> force) const
 Calculates the vector force for the given FERequirementType. More...
 
void calculateMatrix (const FERequirementType &par, typename Traits::template MatrixType<> K) const
 Calculates the matrix stiffness for the given FERequirementType. More...
 
void calculateAt (const ResultRequirementsType &req, const Dune::FieldVector< double, Traits::mydim > &local, ResultTypeMap< double > &result) const
 Calculates results at a specific local position. More...
 
constexpr size_t size () const
 Get the size of the local view. More...
 
void globalFlatIndices (std::vector< GlobalIndex > &globalIndices) const
 Get the global flat indices for the power basis. 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...
 
double calculateScalar (const FERequirementType &req) const
 Calculate the scalar value. More...
 
void calculateVector (const FERequirementType &req, typename Traits::template VectorType<> force) const
 Calculate the vector associated with the given FERequirementType. More...
 
void calculateMatrix (const FERequirementType &req, typename Traits::template MatrixType<> K) const
 Calculate the matrix associated with the given FERequirementType. More...
 
double calculateScalar (const FERequirementType &req) const
 Calculate the scalar value. More...
 
void calculateVector (const FERequirementType &req, typename Traits::template VectorType<> force) const
 Calculate the vector associated with the given FERequirementType. More...
 
void calculateMatrix (const FERequirementType &req, typename Traits::template MatrixType<> K) const
 Calculate the matrix associated with the given FERequirementType. More...
 

Static Public Attributes

static constexpr int myDim = Traits::mydim
 
static constexpr int num_children
 Number of children in the powerBasis. More...
 
static constexpr int worldDim
 
static constexpr int worldDim
 

Protected Member Functions

template<typename ScalarType >
auto calculateScalarImpl (const FERequirementType &par, const std::optional< const Eigen::VectorX< ScalarType > > &dx=std::nullopt) const -> ScalarType
 
template<typename ScalarType >
void calculateVectorImpl (const FERequirementType &par, typename Traits::template VectorType< ScalarType > force, const std::optional< const Eigen::VectorX< ScalarType > > &dx=std::nullopt) const
 
auto calculateScalarImpl (const FERequirementType &par, const std::optional< const Eigen::VectorX< ScalarType > > &dx=std::nullopt) const -> ScalarType
 
void calculateVectorImpl (const FERequirementType &par, typename Traits::template VectorType< ScalarType > force, const std::optional< const Eigen::VectorX< ScalarType > > &dx=std::nullopt) const
 
void calculateMatrixImpl (const FERequirementType &par, typename Traits::template MatrixType<> K, const std::optional< const Eigen::VectorX< ScalarType > > &dx=std::nullopt) const
 
auto calculateScalarImpl (const FERequirementType &par, const std::optional< const Eigen::VectorX< ScalarType > > &dx=std::nullopt) const -> ScalarType
 
void calculateVectorImpl (const FERequirementType &par, typename Traits::template VectorType< ScalarType > force, const std::optional< const Eigen::VectorX< ScalarType > > dx=std::nullopt) const
 
void calculateMatrixImpl (const FERequirementType &par, typename Traits::template MatrixType<> K, const std::optional< const Eigen::VectorX< ScalarType > > &dx=std::nullopt) const
 

Detailed Description

template<typename Basis_, typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
class Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >
Template Parameters
Basis_The basis type for the finite element.
FERequirements_The requirements for the finite element.
useEigenRefA boolean flag indicating whether to use Eigen references.

Member Typedef Documentation

◆ BaseDisp

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
using Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::BaseDisp = PowerBasisFE<FlatBasis>

◆ Basis

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
using Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::Basis = typename Traits::Basis

◆ Element

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
using Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::Element = typename Traits::Element

◆ FERequirementType

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
using Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::FERequirementType = typename Traits::FERequirementType

◆ FlatBasis

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
using Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::FlatBasis = typename Traits::FlatBasis

◆ Geometry

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
using Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::Geometry = typename Traits::Geometry

◆ GlobalIndex

using Ikarus::PowerBasisFE< Basis_::FlatBasis >::GlobalIndex = typename LocalView::MultiIndex
inherited

◆ GridElement

using Ikarus::PowerBasisFE< Basis_::FlatBasis >::GridElement = typename LocalView::Element
inherited

◆ GridView

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
using Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::GridView = typename Traits::GridView

◆ LocalBasisType

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
using Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::LocalBasisType = decltype(std::declval<LocalView>().tree().child(0).finiteElement().localBasis())

◆ LocalView

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
using Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::LocalView = typename Traits::LocalView

◆ ResultRequirementsType

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
using Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::ResultRequirementsType = typename Traits::ResultRequirementsType

◆ RootBasis

using Ikarus::PowerBasisFE< Basis_::FlatBasis >::RootBasis = Basis_::FlatBasis
inherited

◆ TractionType

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
using Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::TractionType = Traction<LinearElastic<Basis_, FERequirements_, useEigenRef>, Traits>

◆ Traits

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
using Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::Traits = TraitsFromFE<Basis_, FERequirements_, useEigenRef>

◆ VolumeType

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
using Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::VolumeType = Volume<LinearElastic<Basis_, FERequirements_, useEigenRef>, Traits>

Constructor & Destructor Documentation

◆ LinearElastic()

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
template<typename VolumeLoad = utils::LoadDefault, typename NeumannBoundaryLoad = utils::LoadDefault>
Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::LinearElastic ( const Basis globalBasis,
const typename LocalView::Element &  element,
double  emod,
double  nu,
VolumeLoad  p_volumeLoad = {},
const BoundaryPatch< GridView > *  p_neumannBoundary = nullptr,
NeumannBoundaryLoad  p_neumannBoundaryLoad = {} 
)
inline
Template Parameters
VolumeLoadThe type for the volume load function.
NeumannBoundaryLoadThe type for the Neumann boundary load function.
Parameters
globalBasisThe global basis for the finite element.
elementThe element for which the finite element is constructed.
emodYoung's modulus.
nuPoisson's ratio.
p_volumeLoadVolume load function (default is LoadDefault).
p_neumannBoundaryNeumann boundary patch (default is nullptr).
p_neumannBoundaryLoadNeumann boundary load function (default is LoadDefault).

Member Function Documentation

◆ calculateAt()

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
void Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::calculateAt ( const ResultRequirementsType req,
const Dune::FieldVector< double, Traits::mydim > &  local,
ResultTypeMap< double > &  result 
) const
inline
Parameters
reqThe ResultRequirementsType object specifying the requested results.
localLocal position vector.
resultMap to store the calculated results.

◆ calculateMatrix() [1/3]

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
void Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::calculateMatrix ( const FERequirementType par,
typename Traits::template MatrixType<>  K 
) const
inline
Parameters
parThe FERequirementType object.
KMatrix to store the calculated stiffness.

◆ calculateMatrix() [2/3]

void Ikarus::Traction< LinearElastic< Basis_, FERequirements<>, false > , TraitsFromFE< Basis_, FERequirements<>, false > >::calculateMatrix ( const FERequirementType req,
typename Traits::template MatrixType<>  K 
) const
inlineinherited
Template Parameters
ScalarTypeThe scalar type for the calculation.
Parameters
reqThe FERequirementType object specifying the requirements for the calculation.
KThe matrix to store the calculated result.

◆ calculateMatrix() [3/3]

void Ikarus::Volume< LinearElastic< Basis_, FERequirements<>, false > , TraitsFromFE< Basis_, FERequirements<>, false > >::calculateMatrix ( const FERequirementType req,
typename Traits::template MatrixType<>  K 
) const
inlineinherited
Template Parameters
ScalarTypeThe scalar type for the calculation.
Parameters
reqThe FERequirementType object specifying the requirements for the calculation.
KThe matrix to store the calculated result.

◆ calculateMatrixImpl() [1/2]

void Ikarus::Traction< LinearElastic< Basis_, FERequirements<>, false > , TraitsFromFE< Basis_, FERequirements<>, false > >::calculateMatrixImpl ( const FERequirementType par,
typename Traits::template MatrixType<>  K,
const std::optional< const Eigen::VectorX< ScalarType > > &  dx = std::nullopt 
) const
inlineprotectedinherited

◆ calculateMatrixImpl() [2/2]

void Ikarus::Volume< LinearElastic< Basis_, FERequirements<>, false > , TraitsFromFE< Basis_, FERequirements<>, false > >::calculateMatrixImpl ( const FERequirementType par,
typename Traits::template MatrixType<>  K,
const std::optional< const Eigen::VectorX< ScalarType > > &  dx = std::nullopt 
) const
inlineprotectedinherited

◆ calculateScalar() [1/3]

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
double Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::calculateScalar ( const FERequirementType par) const
inline
Parameters
parThe FERequirementType object.
Returns
The scalar energy.

◆ calculateScalar() [2/3]

double Ikarus::Traction< LinearElastic< Basis_, FERequirements<>, false > , TraitsFromFE< Basis_, FERequirements<>, false > >::calculateScalar ( const FERequirementType req) const
inlineinherited

Calculates the scalar value based on the given FERequirements.

Parameters
reqThe FERequirements.
Returns
The calculated scalar value.

◆ calculateScalar() [3/3]

double Ikarus::Volume< LinearElastic< Basis_, FERequirements<>, false > , TraitsFromFE< Basis_, FERequirements<>, false > >::calculateScalar ( const FERequirementType req) const
inlineinherited

Calculates the scalar value based on the given FERequirements.

Parameters
reqThe FERequirements.
Returns
The calculated scalar value.

◆ calculateScalarImpl() [1/3]

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
template<typename ScalarType >
auto Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::calculateScalarImpl ( const FERequirementType par,
const std::optional< const Eigen::VectorX< ScalarType > > &  dx = std::nullopt 
) const -> ScalarType
inlineprotected

◆ calculateScalarImpl() [2/3]

auto Ikarus::Traction< LinearElastic< Basis_, FERequirements<>, false > , TraitsFromFE< Basis_, FERequirements<>, false > >::calculateScalarImpl ( const FERequirementType par,
const std::optional< const Eigen::VectorX< ScalarType > > &  dx = std::nullopt 
) const-> ScalarType
inlineprotectedinherited

◆ calculateScalarImpl() [3/3]

auto Ikarus::Volume< LinearElastic< Basis_, FERequirements<>, false > , TraitsFromFE< Basis_, FERequirements<>, false > >::calculateScalarImpl ( const FERequirementType par,
const std::optional< const Eigen::VectorX< ScalarType > > &  dx = std::nullopt 
) const-> ScalarType
inlineprotectedinherited

◆ calculateVector() [1/3]

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
void Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::calculateVector ( const FERequirementType par,
typename Traits::template VectorType<>  force 
) const
inline
Parameters
parThe FERequirementType object.
forceVector to store the calculated force.

◆ calculateVector() [2/3]

void Ikarus::Traction< LinearElastic< Basis_, FERequirements<>, false > , TraitsFromFE< Basis_, FERequirements<>, false > >::calculateVector ( const FERequirementType req,
typename Traits::template VectorType<>  force 
) const
inlineinherited
Template Parameters
ScalarTypeThe scalar type for the calculation.
Parameters
reqThe FERequirementType object specifying the requirements for the calculation.
forceThe vector to store the calculated result.

◆ calculateVector() [3/3]

void Ikarus::Volume< LinearElastic< Basis_, FERequirements<>, false > , TraitsFromFE< Basis_, FERequirements<>, false > >::calculateVector ( const FERequirementType req,
typename Traits::template VectorType<>  force 
) const
inlineinherited
Template Parameters
ScalarTypeThe scalar type for the calculation.
Parameters
reqThe FERequirementType object specifying the requirements for the calculation.
forceThe vector to store the calculated result.

◆ calculateVectorImpl() [1/3]

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
template<typename ScalarType >
void Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::calculateVectorImpl ( const FERequirementType par,
typename Traits::template VectorType< ScalarType >  force,
const std::optional< const Eigen::VectorX< ScalarType > > &  dx = std::nullopt 
) const
inlineprotected

◆ calculateVectorImpl() [2/3]

void Ikarus::Volume< LinearElastic< Basis_, FERequirements<>, false > , TraitsFromFE< Basis_, FERequirements<>, false > >::calculateVectorImpl ( const FERequirementType par,
typename Traits::template VectorType< ScalarType >  force,
const std::optional< const Eigen::VectorX< ScalarType > > &  dx = std::nullopt 
) const
inlineprotectedinherited

◆ calculateVectorImpl() [3/3]

void Ikarus::Traction< LinearElastic< Basis_, FERequirements<>, false > , TraitsFromFE< Basis_, FERequirements<>, false > >::calculateVectorImpl ( const FERequirementType par,
typename Traits::template VectorType< ScalarType >  force,
const std::optional< const Eigen::VectorX< ScalarType > >  dx = std::nullopt 
) const
inlineprotectedinherited

Integration rule along the boundary

The value of the local function wrt the i-th coeff

Value of the Neumann data at the current position

◆ displacementFunction()

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
template<typename ScalarType = double>
auto Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::displacementFunction ( const FERequirementType par,
const std::optional< const Eigen::VectorX< ScalarType > > &  dx = std::nullopt 
) const
inline
Template Parameters
ScalarTypeThe scalar type for the displacement vector.
Parameters
parThe FERequirementType object.
dxOptional displacement vector.
Returns
The displacement function.
Here is the caller graph for this function:

◆ geometry()

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
const Geometry & Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::geometry ( ) const
inline

◆ globalFlatIndices()

void Ikarus::PowerBasisFE< Basis_::FlatBasis >::globalFlatIndices ( std::vector< GlobalIndex > &  globalIndices) const
inlineinherited

The global indices are collected in a FlatInterLeaved order. I.e. x_0, y_0, z_0, ..., x_n, y_n, z_n

Parameters
globalIndicesOutput vector to store global indices.

◆ gridElement()

const GridElement & Ikarus::PowerBasisFE< Basis_::FlatBasis >::gridElement ( ) const
inlineinherited
Returns
The grid element.

◆ localView() [1/2]

LocalView & Ikarus::PowerBasisFE< Basis_::FlatBasis >::localView ( )
inlineinherited
Returns
The reference to the local view.

◆ localView() [2/2]

const LocalView & Ikarus::PowerBasisFE< Basis_::FlatBasis >::localView ( ) const
inlineinherited
Returns
The const reference to the local view.

◆ materialTangent()

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
auto Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::materialTangent ( ) const
inline
Returns
The material tangent matrix.
Here is the caller graph for this function:

◆ materialTangentFunction()

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
auto Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::materialTangentFunction ( const FERequirementType par) const
inline
Parameters
parThe FERequirementType object.
Returns
The material tangent function.

◆ numberOfNodes()

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
size_t Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::numberOfNodes ( ) const
inline

◆ order()

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
int Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::order ( ) const
inline

◆ size()

constexpr size_t Ikarus::PowerBasisFE< Basis_::FlatBasis >::size ( ) const
inlineconstexprinherited
Returns
The size of the local view.

◆ strainFunction()

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
template<class ScalarType = double>
auto Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::strainFunction ( const FERequirementType par,
const std::optional< const Eigen::VectorX< ScalarType > > &  dx = std::nullopt 
) const
inline
Template Parameters
ScalarTypeThe scalar type for the strain vector.
Parameters
parThe FERequirementType object.
dxOptional displacement vector.
Returns
The strain function.
Here is the caller graph for this function:

Member Data Documentation

◆ myDim

template<typename Basis_ , typename FERequirements_ = FERequirements<>, bool useEigenRef = false>
constexpr int Ikarus::LinearElastic< Basis_, FERequirements_, useEigenRef >::myDim = Traits::mydim
staticconstexpr

◆ num_children

constexpr int Ikarus::PowerBasisFE< Basis_::FlatBasis >::num_children
staticconstexprinherited

◆ worldDim [1/2]

constexpr int Ikarus::Traction< LinearElastic< Basis_, FERequirements<>, false > , TraitsFromFE< Basis_, FERequirements<>, false > >::worldDim
staticconstexprinherited

◆ worldDim [2/2]

constexpr int Ikarus::Volume< LinearElastic< Basis_, FERequirements<>, false > , TraitsFromFE< Basis_, FERequirements<>, false > >::worldDim
staticconstexprinherited

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