33template <Concepts::Material Material,
typename Derived>
35 const Eigen::MatrixBase<Derived>& Estart = Derived::Zero().eval(),
36 const double tol = 1e-12,
const int maxIter = 20) {
37 static_assert(Concepts::EigenMatrix33<
decltype(S)> or Concepts::EigenMatrix22<
decltype(S)>);
41 constexpr int dim = Derived::CompileTimeTraits::RowsAtCompileTime;
42 constexpr int dimVoigt = (dim * (dim + 1)) / 2;
43 constexpr auto strainTag =
46 using ST = Derived::Scalar;
47 using VoigtVec = Eigen::Vector<ST, dimVoigt>;
49 VoigtVec Es =
toVoigt(Estart.derived());
50 VoigtVec Svoigt =
toVoigt(S.derived(),
false);
52 auto r = VoigtVec::Zero().eval();
53 auto D = Eigen::Matrix<ST, dimVoigt, dimVoigt>::Zero().eval();
55 for (
auto i : Dune::range(maxIter)) {
56 r = (Svoigt - mat.template stresses<strainTag, true>(Es)).eval();
58 if (r.norm() < tol and i > 0)
60 else if (i == maxIter)
63 "Numerical material inversion failed to converge within the maximum number of iterations for the material: " +
66 D = mat.template tangentModuli<strainTag, true>(Es).inverse().eval();
69 return std::make_pair(D, transformStrain<strainTag, Material::strainTag>(Es).eval());
Helper for the Eigen::Tensor types.
Implementation of transformations for different strain measures.
helper functions used by material model implementations.
constexpr Eigen::Index toVoigt(Eigen::Index i, Eigen::Index j) noexcept
Converts 2D indices to Voigt notation index.
Definition: tensorutils.hh:182
Definition: arrudaboyce.hh:27
auto numericalMaterialInversion(const Material &mat, const Eigen::MatrixBase< Derived > &S, const Eigen::MatrixBase< Derived > &Estart=Derived::Zero().eval(), const double tol=1e-12, const int maxIter=20)
Computes numerically an approximation of the complementary strain energy function and returns the mat...
Definition: numericalmaterialinversion.hh:34
Interface classf or materials.
Definition: finiteelements/mechanics/materials/interface.hh:82
static constexpr std::string name()
Get the name of the implemented material.
Definition: finiteelements/mechanics/materials/interface.hh:112
Returns true if a given straintag is related only to the reference configuration.
Definition: utils/concepts.hh:677
Returns true if a given stresstag is related only to the reference configuration.
Definition: utils/concepts.hh:684
Contains the Material interface class and related template functions for material properties.