version 0.4.1
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
15
16namespace Ikarus {
17
34template <typename ST>
35struct LinearElasticityT : Material<LinearElasticityT<ST>>
36{
37 [[nodiscard]] constexpr std::string nameImpl() const noexcept { return "LinearElasticity"; }
38
39 using ScalarType = ST;
41
48 : svk_{mpt} {}
49
51 static constexpr int worldDimension = 3;
52 using StrainMatrix = Eigen::Matrix<ScalarType, worldDimension, worldDimension>;
54
55 static constexpr auto strainTag = StrainTags::linear;
56 static constexpr auto stressTag = StressTags::linear;
59 static constexpr bool stressToVoigt = Base::stressToVoigt;
61 static constexpr bool moduliToVoigt = Base::moduliToVoigt;
63
64 // This factor denotes the differences between the returned stresses and moduli
65 // and the passed strain. For neoHooke the inserted quantity is C, the right Cauchy-Green tensor.
66 // The function relation between the energy and the stresses is S = 2*\partial \psi(C)/ \partial C.
67 // This factor is a pre-factor, which is the difference to the actual derivative is written here.
68 static constexpr double derivativeFactor = 1;
69
77 template <typename Derived>
78 ScalarType storedEnergyImpl(const Eigen::MatrixBase<Derived>& E) const {
79 return svk_.template storedEnergyImpl(E);
80 }
81
90 template <bool voigt, typename Derived>
91 auto stressesImpl(const Eigen::MatrixBase<Derived>& E) const {
92 return svk_.template stressesImpl<voigt>(E);
93 }
94
103 template <bool voigt, typename Derived>
104 auto tangentModuliImpl(const Eigen::MatrixBase<Derived>& E) const {
105 return svk_.template tangentModuliImpl<voigt>(E);
106 }
107
114 template <typename STO>
115 auto rebind() const {
116 LinearElasticityT<STO> leRebound;
117 leRebound.svk = svk_.template rebind<STO>();
118 return leRebound;
119 }
120
121private:
123};
124
129
130} // namespace Ikarus
Contains the Material interface class and related template functions for material properties.
Implementation of the Saint Venant-Kirchhoff material model.
Definition: simpleassemblers.hh:22
Interface classf or materials.
Definition: interface.hh:77
Implementation of the Linear Elasticity material model.The energy is computed as.
Definition: linearelasticity.hh:36
static constexpr bool stressAcceptsVoigt
Definition: linearelasticity.hh:60
static constexpr bool energyAcceptsVoigt
Definition: linearelasticity.hh:58
static constexpr bool stressToVoigt
Definition: linearelasticity.hh:59
static constexpr int worldDimension
Definition: linearelasticity.hh:51
static constexpr auto stressTag
Definition: linearelasticity.hh:56
auto rebind() const
Rebind material to a different scalar type.
Definition: linearelasticity.hh:115
static constexpr auto strainTag
Definition: linearelasticity.hh:55
static constexpr auto tangentModuliTag
Definition: linearelasticity.hh:57
static constexpr bool moduliToVoigt
Definition: linearelasticity.hh:61
constexpr std::string nameImpl() const noexcept
Definition: linearelasticity.hh:37
ST ScalarType
Definition: linearelasticity.hh:39
static constexpr double derivativeFactor
Definition: linearelasticity.hh:68
auto stressesImpl(const Eigen::MatrixBase< Derived > &E) const
Calculates the stresses in the material.
Definition: linearelasticity.hh:91
StrainMatrix StressMatrix
Definition: linearelasticity.hh:53
Eigen::Matrix< ScalarType, worldDimension, worldDimension > StrainMatrix
Definition: linearelasticity.hh:52
LinearElasticityT(const LamesFirstParameterAndShearModulus &mpt)
Constructor for LinearElasticityT.
Definition: linearelasticity.hh:47
ScalarType field_type
Definition: linearelasticity.hh:50
auto tangentModuliImpl(const Eigen::MatrixBase< Derived > &E) const
Calculates the tangent moduli in the material.
Definition: linearelasticity.hh:104
static constexpr bool moduliAcceptsVoigt
Definition: linearelasticity.hh:62
ScalarType storedEnergyImpl(const Eigen::MatrixBase< Derived > &E) const
Calculates the stored energy in the material.
Definition: linearelasticity.hh:78
static constexpr bool moduliAcceptsVoigt
Definition: svk.hh:59
static constexpr bool stressAcceptsVoigt
Definition: svk.hh:57
static constexpr bool moduliToVoigt
Definition: svk.hh:58
static constexpr bool stressToVoigt
Definition: svk.hh:56
static constexpr bool energyAcceptsVoigt
Definition: svk.hh:55
Definition: physicshelper.hh:88