clsName.def( \
#functionname, \
[](materialName& self,
StrainTags straintag, Eigen::Ref<
const Eigen::Vector<double, vecSize>> eVoigt_) { \
if constexpr (not Concepts::IsMaterial<LinearElasticityT, materialName>) { \
Eigen::Vector<double, vecSize> eVoigt = eVoigt_; \
if (straintag == StrainTags::rightCauchyGreenTensor) \
return self.template functionname<StrainTags::rightCauchyGreenTensor>(eVoigt); \
else if (straintag == StrainTags::greenLagrangian) \
return self.template functionname<StrainTags::greenLagrangian>(eVoigt); \
else if (straintag == StrainTags::linear) \
DUNE_THROW(Dune::MathError, "Passing linear strain to " + std::string(#materialName) + \
" does not makes sense use LinearElastic class"); \
else if (straintag == StrainTags::displacementGradient) \
DUNE_THROW(Dune::MathError, \
"Passing displacementGradient strain in 6d Voigt notation does not make any sense!"); \
else if (straintag == StrainTags::deformationGradient) \
DUNE_THROW(Dune::MathError, \
"Passing deformationGradient strain in 6d Voigt notation does not make any sense!"); \
else \
DUNE_THROW(Dune::MathError,
toString(straintag) +
"is not a valid strain tag."); \
} else { \
Eigen::Vector<double, vecSize> eVoigt = eVoigt_; \
if (straintag == StrainTags::linear) \
return self.template functionname<StrainTags::linear>(eVoigt); \
else \
DUNE_THROW(Dune::MathError, "Linear elastic material only accepts linear strains!"); \
} \
__builtin_unreachable(); \
}, \
"StrainName"_a, "strainVector"_a);
StrainTags
A strongly typed enum class representing the type of the passed strain.
Definition: tags.hh:19
constexpr std::string toString(DBCOption _e)
Definition: dirichletbcenforcement.hh:7