12#include <dune/common/float_cmp.hh>
34template <Concepts::DeviatoricFunction DF>
39 template <
typename ST = ScalarType>
45 template <
typename ST = ScalarType>
47 template <
typename ST = ScalarType>
50 static constexpr int dim = 3;
52 template <
typename ST = ScalarType>
55 template <
typename ST = ScalarType>
56 using MaterialTensor = Eigen::TensorFixedSize<ST, Eigen::Sizes<dim, dim, dim, dim>>;
58 [[nodiscard]]
constexpr static std::string
name() noexcept {
return "Deviatoric function: " + DF::name(); }
61 : deviatoricFunction_{df} {}
76 template <
typename ST>
78 return deviatoricFunction_.storedEnergyImpl(lambda);
88 template <
typename ST>
90 auto dWdLambda = deviatoricFunction_.firstDerivativeImpl(lambda);
91 return (dWdLambda.array() / lambda.array()).eval();
102 template <
typename ST>
105 auto dS = deviatoricFunction_.secondDerivativeImpl(lambda);
110 for (
const auto i : dimensionRange())
111 for (
const auto k : dimensionRange())
112 L(i, i, k, k) = 1.0 / (lambda(i) * lambda(k)) * dS(i, k);
114 Eigen::ArrayXd lambdaSquared = lambda.array().square();
115 for (
const auto i : dimensionRange())
116 for (
const auto k : dimensionRange())
118 if (Dune::FloatCmp::eq(lambda(i), lambda(k), 1e-8))
119 L(i, k, i, k) = 0.5 * (L(i, i, i, i) - L(i, i, k, k));
121 L(i, k, i, k) += (S(i) - S(k)) / (lambdaSquared(i) - lambdaSquared(k));
132 template <
typename STO>
134 auto reboundDF = deviatoricFunction_.template rebind<STO>();
135 return Deviatoric<
decltype(reboundDF)>{reboundDF};
139 DF deviatoricFunction_;
141 inline static constexpr auto dimensionRange() {
return Dune::range(
dim); }
Helper for the Eigen::Tensor types.
Definition: arrudaboyce.hh:27
This is the interface implementation for the deviatoric part of a hyperelastic material....
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:36
typename DF::ScalarType ScalarType
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:37
const MaterialParameters materialParameters() const
Returns the material parameters stored in the deviatoric part of the material.
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:66
StressMatrix< ST > stresses(const PrincipalStretches< ST > &lambda) const
Returns the principal PK2 stresses obtained from the first derivative of the deviatoric function.
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:89
DF DeviatoricFunction
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:43
MaterialTensor< ST > tangentModuli(const PrincipalStretches< ST > &lambda) const
Returns the material tangent modulus obtained from the second derivative of the deviatoric function.
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:103
auto rebind() const
Rebinds the material to a different scalar type.
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:133
static constexpr std::string name() noexcept
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:58
Eigen::Vector< ST, dim > StressMatrix
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:53
static constexpr int dim
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:50
typename DF::MaterialParameters MaterialParameters
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:41
typename DF::template PrincipalStretches< ST > PrincipalStretches
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:40
ST storedEnergy(const PrincipalStretches< ST > &lambda) const
Returns the stored energy obtained from the deviatoric function.
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:77
typename DF::template FirstDerivative< ST > FirstDerivative
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:46
typename DF::template SecondDerivative< ST > SecondDerivative
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:48
Eigen::TensorFixedSize< ST, Eigen::Sizes< dim, dim, dim, dim > > MaterialTensor
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:56
Deviatoric(const DF df)
Definition: finiteelements/mechanics/materials/hyperelastic/deviatoric/interface.hh:60
Header file including concepts for hyperelastic material models.