35 template <
typename ScalarType_>
37 [[nodiscard]]
constexpr std::string
nameImpl() const noexcept {
return "NeoHooke"; }
47 using StrainMatrix = Eigen::Matrix<ScalarType, worldDimension, worldDimension>;
66 template <
typename Derived>
68 static_assert(Concepts::EigenMatrixOrVoigtNotation3<Derived>);
70 const auto traceC = C.trace();
71 const auto logdetF = log(sqrt(C.determinant()));
75 "NeoHooke energy can only be called with a matrix and not a vector in Voigt notation");
85 template <
bool voigt,
typename Derived>
87 static_assert(Concepts::EigenMatrixOrVoigtNotation3<Derived>);
88 if constexpr (!voigt) {
90 const auto logdetF = log(sqrt(C.determinant()));
91 const auto invC = C.inverse().eval();
95 "NeoHooke can only be called with a matrix and not a vector in Voigt notation");
97 static_assert(voigt ==
false,
"NeoHooke does not support returning stresses in Voigt notation");
107 template <
bool voigt,
typename Derived>
109 static_assert(Concepts::EigenMatrixOrVoigtNotation3<Derived>);
110 if constexpr (!voigt) {
111 const auto invC = C.inverse().eval();
112 const auto logdetF = log(sqrt(C.determinant()));
113 const auto CTinv =
tensorView(invC, std::array<Eigen::Index, 2>({3, 3}));
114 static_assert(Eigen::TensorFixedSize<ScalarType, Eigen::Sizes<3, 3>>::NumIndices == 2);
115 Eigen::TensorFixedSize<ScalarType, Eigen::Sizes<3, 3, 3, 3>> moduli
121 static_assert(voigt ==
false,
"NeoHooke does not support returning tangent moduli in Voigt notation");
129 template <
typename ScalarTypeOther>
Helper for the Eigen::Tensor types.
Contains the Material interface class and related template functions for material properties.
Eigen::Tensor< typename Derived::Scalar, rank > tensorView(const Eigen::EigenBase< Derived > &matrix, const std::array< T, rank > &dims)
View an Eigen matrix as an Eigen Tensor with specified dimensions.
Definition: tensorutils.hh:32
auto fourthOrderIKJL(const Eigen::MatrixBase< AType > &A, const Eigen::MatrixBase< BType > &B)
Computes the IKJL product of two matrices.
Definition: tensorutils.hh:122
auto dyadic(const auto &A_ij, const auto &B_kl)
Computes the dyadic product of two Eigen tensors.
Definition: tensorutils.hh:47
auto symTwoSlots(const Eigen::TensorFixedSize< ScalarType, Eigen::Sizes< dim, dim, dim, dim > > &t, const std::array< size_t, 2 > &slots)
Creates a symmetric fourth-order tensor in the two specified slots of the input tensor.
Definition: tensorutils.hh:146
Definition: simpleassemblers.hh:21
NeoHookeT< double > NeoHooke
Alias for NeoHookeT with double as the default scalar type.
Definition: neohooke.hh:140
Interface classf or materials.
Definition: interface.hh:75
Implementation of the Neo-Hookean material model.The energy is computed as.
Definition: neohooke.hh:36
static constexpr bool moduliAcceptsVoigt
Definition: neohooke.hh:57
NeoHookeT(const LamesFirstParameterAndShearModulus &mpt)
Constructor for NeoHookeT.
Definition: neohooke.hh:43
Eigen::Matrix< ScalarType, worldDimension, worldDimension > StrainMatrix
Definition: neohooke.hh:47
ScalarType_ ScalarType
Definition: neohooke.hh:45
auto stressesImpl(const Eigen::MatrixBase< Derived > &C) const
Computes the stresses in the Neo-Hookean material model.
Definition: neohooke.hh:86
static constexpr bool stressToVoigt
Definition: neohooke.hh:54
static constexpr double derivativeFactor
Definition: neohooke.hh:58
static constexpr bool energyAcceptsVoigt
Definition: neohooke.hh:53
constexpr std::string nameImpl() const noexcept
Definition: neohooke.hh:37
ScalarType storedEnergyImpl(const Eigen::MatrixBase< Derived > &C) const noexcept
Computes the stored energy in the Neo-Hookean material model.
Definition: neohooke.hh:67
static constexpr auto strainTag
Definition: neohooke.hh:50
auto rebind() const
Rebinds the material to a different scalar type.
Definition: neohooke.hh:130
static constexpr int worldDimension
Definition: neohooke.hh:46
LamesFirstParameterAndShearModulus lambdaAndmu
Definition: neohooke.hh:134
static constexpr auto stressTag
Definition: neohooke.hh:51
static constexpr auto tangentModuliTag
Definition: neohooke.hh:52
StrainMatrix StressMatrix
Definition: neohooke.hh:48
static constexpr bool moduliToVoigt
Definition: neohooke.hh:56
static constexpr bool stressAcceptsVoigt
Definition: neohooke.hh:55
auto tangentModuliImpl(const Eigen::MatrixBase< Derived > &C) const
Computes the tangent moduli in the Neo-Hookean material model.
Definition: neohooke.hh:108
Definition: physicshelper.hh:143
double lambda
Definition: physicshelper.hh:144
double mu
Definition: physicshelper.hh:145
Concept defining the requirements for Eigen vectors.
Definition: concepts.hh:381