14 #include <muesli/muesli.h>
16 #include <Eigen/Eigen>
33requires(std::is_base_of_v<muesli::finiteStrainMaterial, FM>)
34struct FiniteStrain :
public Material<FiniteStrain<FM>>
36 using MaterialModel = FM;
37 using ScalarType = double;
38 static constexpr int dim = 3;
39 using StrainMatrix = Eigen::Matrix<ScalarType, dim, dim>;
40 using StressMatrix = StrainMatrix;
41 using MaterialTensor = Eigen::TensorFixedSize<ScalarType, Eigen::Sizes<dim, dim, dim, dim>>;
42 using MaterialParameters = muesli::materialProperties;
47 static constexpr bool energyAcceptsVoigt =
false;
48 static constexpr bool stressToVoigt =
false;
49 static constexpr bool stressAcceptsVoigt =
false;
50 static constexpr bool moduliToVoigt =
false;
51 static constexpr bool moduliAcceptsVoigt =
false;
52 static constexpr double derivativeFactorImpl = 2;
54 [[nodiscard]]
constexpr static std::string nameImpl() noexcept {
return "FiniteStrain: " + materialName<FM>(); }
60 explicit FiniteStrain(
const MaterialParameters& mpt)
61 : materialParameter_{mpt},
62 material_{
Dune::className<FM>(), mpt},
63 mp_{material_.createMaterialPoint()} {}
68 MaterialParameters materialParametersImpl()
const {
return materialParameter_; }
76 template <
typename Derived>
77 ScalarType storedEnergyImpl(
const Eigen::MatrixBase<Derived>& C)
const {
78 static_assert(Concepts::EigenMatrixOrVoigtNotation3<Derived>);
79 if constexpr (!Concepts::EigenVector<Derived>) {
81 return mp_->storedEnergy();
83 static_assert(!Concepts::EigenVector<Derived>,
84 "MuesliFiniteStrain energy can only be called with a matrix and not a vector in Voigt notation");
94 template <
bool voigt,
typename Derived>
95 auto stressesImpl(
const Eigen::MatrixBase<Derived>& C)
const {
96 static_assert(Concepts::EigenMatrixOrVoigtNotation3<Derived>);
97 if constexpr (!voigt) {
98 if constexpr (!Concepts::EigenVector<Derived>) {
101 mp_->secondPiolaKirchhoffStress(stress);
102 return toEigenMatrix(stress).eval();
104 static_assert(!Concepts::EigenVector<Derived>,
105 "MuesliFiniteStrain can only be called with a matrix and not a vector in Voigt notation");
107 static_assert(voigt ==
false,
"MuesliFiniteStrain does not support returning stresses in Voigt notation");
117 template <
bool voigt,
typename Derived>
118 auto tangentModuliImpl(
const Eigen::MatrixBase<Derived>& C)
const {
119 static_assert(Concepts::EigenMatrixOrVoigtNotation3<Derived>);
120 if constexpr (!voigt) {
121 if constexpr (!Concepts::EigenVector<Derived>) {
123 itensor4 tangentModuli;
125 mp_->convectedTangent(tangentModuli);
126 return toEigenTensor(tangentModuli);
128 static_assert(!Concepts::EigenVector<Derived>,
129 "MuesliFiniteStrain can only be called with a matrix and not a vector in Voigt notation");
131 static_assert(voigt ==
false,
"MuesliFiniteStrain does not support returning tangent moduli in Voigt notation");
138 auto& material()
const {
return material_; }
144 auto& materialPoint()
const {
return mp_; }
146 FiniteStrain(
const FiniteStrain& other)
147 : materialParameter_{other.materialParameter_},
148 material_{
Dune::className<FM>(), materialParameter_},
149 mp_{material_.createMaterialPoint()} {}
152 MaterialParameters materialParameter_;
153 MaterialModel material_;
154 std::unique_ptr<muesli::finiteStrainMP> mp_;
156 template <
typename Derived>
157 void updateState(
const Eigen::MatrixBase<Derived>& C)
const {
158 Impl::checkPositiveOrAbort(C.determinant());
159 auto F = toitensor(transformStrain<strainTag, StrainTags::deformationGradient>(C));
160 mp_->updateCurrentState(0.0, F);
166 #error Muesli materials depends on the Muesli library, which is not included
Helper for the Eigen::Tensor types.
helper functions used by material model implementations.
Definition: arrudaboyce.hh:27
Definition: utils/dirichletvalues.hh:30
Contains the Material interface class and related template functions for material properties.