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 using ScalarType = ST;
39
41 static constexpr int worldDimension = 3;
42 using StrainMatrix = Eigen::Matrix<ScalarType, worldDimension, worldDimension>;
45
46 static constexpr auto strainTag = StrainTags::linear;
47 static constexpr auto stressTag = StressTags::linear;
50 static constexpr bool stressToVoigt = Base::stressToVoigt;
52 static constexpr bool moduliToVoigt = Base::moduliToVoigt;
55
56 [[nodiscard]] constexpr static std::string nameImpl() noexcept { return "LinearElasticity"; }
57
64 : svk_{mpt} {}
65
70
78 template <typename Derived>
79 ScalarType storedEnergyImpl(const Eigen::MatrixBase<Derived>& E) const {
80 return svk_.template storedEnergyImpl(E);
81 }
82
91 template <bool voigt, typename Derived>
92 auto stressesImpl(const Eigen::MatrixBase<Derived>& E) const {
93 return svk_.template stressesImpl<voigt>(E);
94 }
95
104 template <bool voigt, typename Derived>
105 auto tangentModuliImpl(const Eigen::MatrixBase<Derived>& E) const {
106 return svk_.template tangentModuliImpl<voigt>(E);
107 }
108
115 template <typename STO>
116 auto rebind() const {
117 LinearElasticityT<STO> leRebound;
118 leRebound.svk = svk_.template rebind<STO>();
119 return leRebound;
120 }
121
122private:
124};
125
130
131} // namespace Ikarus
Implementation of the Saint Venant-Kirchhoff material model.
Definition: assemblermanipulatorbuildingblocks.hh:22
Interface classf or materials.
Definition: finiteelements/mechanics/materials/interface.hh:80
Implementation of the Linear Elasticity material model.The energy is computed as.
Definition: linearelasticity.hh:36
static constexpr bool stressAcceptsVoigt
Definition: linearelasticity.hh:51
static constexpr bool energyAcceptsVoigt
Definition: linearelasticity.hh:49
static constexpr bool stressToVoigt
Definition: linearelasticity.hh:50
static constexpr int worldDimension
Definition: linearelasticity.hh:41
MaterialParameters materialParametersImpl() const
Returns the material parameters stored in the material.
Definition: linearelasticity.hh:69
static constexpr auto stressTag
Definition: linearelasticity.hh:47
auto rebind() const
Rebind material to a different scalar type.
Definition: linearelasticity.hh:116
static constexpr auto strainTag
Definition: linearelasticity.hh:46
static constexpr double derivativeFactorImpl
Definition: linearelasticity.hh:54
static constexpr auto tangentModuliTag
Definition: linearelasticity.hh:48
static constexpr bool moduliToVoigt
Definition: linearelasticity.hh:52
ST ScalarType
Definition: linearelasticity.hh:37
auto stressesImpl(const Eigen::MatrixBase< Derived > &E) const
Calculates the stresses in the material.
Definition: linearelasticity.hh:92
StrainMatrix StressMatrix
Definition: linearelasticity.hh:43
Eigen::Matrix< ScalarType, worldDimension, worldDimension > StrainMatrix
Definition: linearelasticity.hh:42
static constexpr std::string nameImpl() noexcept
Definition: linearelasticity.hh:56
LinearElasticityT(const MaterialParameters &mpt)
Constructor for LinearElasticityT.
Definition: linearelasticity.hh:63
ScalarType field_type
Definition: linearelasticity.hh:40
auto tangentModuliImpl(const Eigen::MatrixBase< Derived > &E) const
Calculates the tangent moduli in the material.
Definition: linearelasticity.hh:105
static constexpr bool moduliAcceptsVoigt
Definition: linearelasticity.hh:53
ScalarType storedEnergyImpl(const Eigen::MatrixBase< Derived > &E) const
Calculates the stored energy in the material.
Definition: linearelasticity.hh:79
typename Base::MaterialParameters MaterialParameters
Definition: linearelasticity.hh:44
static constexpr bool moduliAcceptsVoigt
Definition: svk.hh:51
static constexpr double derivativeFactorImpl
Definition: svk.hh:52
static constexpr bool stressAcceptsVoigt
Definition: svk.hh:49
MaterialParameters materialParametersImpl() const
Returns the material parameters stored in the material.
Definition: svk.hh:66
static constexpr bool moduliToVoigt
Definition: svk.hh:50
LamesFirstParameterAndShearModulus MaterialParameters
Definition: svk.hh:42
static constexpr bool stressToVoigt
Definition: svk.hh:48
static constexpr bool energyAcceptsVoigt
Definition: svk.hh:47
Contains the Material interface class and related template functions for material properties.