version 0.4
linearelasticity.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2021-2024 The Ikarus Developers mueller@ibb.uni-stuttgart.de
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
10#pragma once
11
12#include "svk.hh"
13
16
17namespace Ikarus {
18
35 template <typename ScalarType_>
36 struct LinearElasticityT : public Material<LinearElasticityT<ScalarType_>> {
37 [[nodiscard]] constexpr std::string nameImpl() const noexcept { return "LinearElasticity"; }
38
39 using ScalarType = ScalarType_;
41
48
50 static constexpr int worldDimension = 3;
51 using StrainMatrix = Eigen::Matrix<ScalarType, worldDimension, worldDimension>;
53
54 static constexpr auto strainTag = StrainTags::linear;
55 static constexpr auto stressTag = StressTags::linear;
58 static constexpr bool stressToVoigt = Base::stressToVoigt;
60 static constexpr bool moduliToVoigt = Base::moduliToVoigt;
62
63 // This factor denotes the differences between the returned stresses and moduli
64 // and the passed strain. For neoHooke the inserted quantity is C, the right Cauchy-Green tensor.
65 // The function relation between the energy and the stresses is S = 2*\partial \psi(C)/ \partial C.
66 // This factor is a pre-factor, which is the difference to the actual derivative is written here.
67 static constexpr double derivativeFactor = 1;
68
76 template <typename Derived>
77 ScalarType storedEnergyImpl(const Eigen::MatrixBase<Derived>& E) const {
78 return svk.template storedEnergyImpl(E);
79 }
80
89 template <bool voigt, typename Derived>
90 auto stressesImpl(const Eigen::MatrixBase<Derived>& E) const {
91 return svk.template stressesImpl<voigt>(E);
92 }
93
102 template <bool voigt, typename Derived>
103 auto tangentModuliImpl(const Eigen::MatrixBase<Derived>& E) const {
104 return svk.template tangentModuliImpl<voigt>(E);
105 }
106
113 template <typename ScalarTypeOther>
114 auto rebind() const {
116 leRebound.svk = svk.template rebind<ScalarTypeOther>();
117 return leRebound;
118 }
119
121 };
122
127
128} // namespace Ikarus
Helper for the Eigen::Tensor types.
Implementation of the Saint Venant-Kirchhoff material model.
Contains the Material interface class and related template functions for material properties.
Definition: simpleassemblers.hh:21
LinearElasticityT< double > LinearElasticity
Convenience typedef for LinearElasticity with double as ScalarType.
Definition: linearelasticity.hh:126
Interface classf or materials.
Definition: interface.hh:75
Implementation of the Linear Elasticity material model.The energy is computed as.
Definition: linearelasticity.hh:36
static constexpr bool moduliToVoigt
Definition: linearelasticity.hh:60
LinearElasticityT(const LamesFirstParameterAndShearModulus &mpt)
Constructor for LinearElasticityT.
Definition: linearelasticity.hh:47
Eigen::Matrix< ScalarType, worldDimension, worldDimension > StrainMatrix
Definition: linearelasticity.hh:51
ScalarType field_type
Definition: linearelasticity.hh:49
auto stressesImpl(const Eigen::MatrixBase< Derived > &E) const
Calculates the stresses in the material.
Definition: linearelasticity.hh:90
ScalarType storedEnergyImpl(const Eigen::MatrixBase< Derived > &E) const
Calculates the stored energy in the material.
Definition: linearelasticity.hh:77
static constexpr int worldDimension
Definition: linearelasticity.hh:50
auto rebind() const
Rebind material to a different scalar type.
Definition: linearelasticity.hh:114
StrainMatrix StressMatrix
Definition: linearelasticity.hh:52
static constexpr bool stressAcceptsVoigt
Definition: linearelasticity.hh:59
StVenantKirchhoffT< ScalarType > svk
Definition: linearelasticity.hh:120
static constexpr bool energyAcceptsVoigt
Definition: linearelasticity.hh:57
static constexpr bool moduliAcceptsVoigt
Definition: linearelasticity.hh:61
auto tangentModuliImpl(const Eigen::MatrixBase< Derived > &E) const
Calculates the tangent moduli in the material.
Definition: linearelasticity.hh:103
static constexpr auto strainTag
Definition: linearelasticity.hh:54
static constexpr auto stressTag
Definition: linearelasticity.hh:55
constexpr std::string nameImpl() const noexcept
Definition: linearelasticity.hh:37
static constexpr double derivativeFactor
Definition: linearelasticity.hh:67
static constexpr bool stressToVoigt
Definition: linearelasticity.hh:58
static constexpr auto tangentModuliTag
Definition: linearelasticity.hh:56
ScalarType_ ScalarType
Definition: linearelasticity.hh:39
static constexpr bool stressAcceptsVoigt
Definition: svk.hh:55
static constexpr bool energyAcceptsVoigt
Definition: svk.hh:53
static constexpr bool stressToVoigt
Definition: svk.hh:54
static constexpr bool moduliToVoigt
Definition: svk.hh:56
static constexpr bool moduliAcceptsVoigt
Definition: svk.hh:57
Definition: physicshelper.hh:143