27template <auto strainIndexPair,
typename MI>
39 static constexpr auto strainTag = Underlying::strainTag;
40 static constexpr auto stressTag = Underlying::stressTag;
56 [[nodiscard]]
constexpr static std::string
nameImpl() noexcept {
57 auto matName = MI::name() +
"_VanishingStrain(";
59 matName +=
"(" + std::to_string(p.row) + std::to_string(p.col) +
")";
75 template <
typename Derived>
77 const auto Esol = reduceStrain(E);
78 return matImpl_.storedEnergyImpl(Esol);
88 template <
bool voigt,
typename Derived>
90 const auto Esol = reduceStrain(E);
91 auto stressesRed = matImpl_.template stresses<Underlying::strainTag, true>(Esol);
93 if constexpr (voigt) {
108 template <
bool voigt,
typename Derived>
110 const auto Esol = reduceStrain(E);
111 auto C = matImpl_.template tangentModuli<Underlying::strainTag, true>(Esol);
123 template <
typename ScalarTypeOther>
125 auto reboundMatImpl = matImpl_.template rebind<ScalarTypeOther>();
138 template <
typename Derived>
139 auto reduceStrain(
const Eigen::MatrixBase<Derived>& Eraw)
const {
141 Eigen::Matrix3<ScalarType> E = Impl::maybeFromVoigt(Eraw);
145 decltype(
auto) E = Impl::maybeFromVoigt(Eraw);
146 Eigen::Matrix3<ScalarType> Egl = transformStrain<strainTag, StrainTags::greenLagrangian>(E);
147 setStrainsToZero(Egl);
148 return transformStrain<StrainTags::greenLagrangian, strainTag>(Egl).derived();
154 inline void setStrainsToZero(
auto& E)
const {
170template <Impl::MatrixIndexPair... stressIndexPair,
typename MaterialImpl>
172 return VanishingStrain<std::to_array({stressIndexPair...}), MaterialImpl>(mat);
187template <
typename MaterialImpl>
189 return makeVanishingStrain<Impl::MatrixIndexPair{2, 1}, Impl::MatrixIndexPair{2, 0}, Impl::MatrixIndexPair{2, 2}>(
Provides a NonLinearOperator class for handling nonlinear operators.
Implementation of the Newton-Raphson method for solving nonlinear equations.
Implementation of strain-related functions.
auto removeCol(const Eigen::MatrixBase< Derived > &E, const std::array< size_t, sizeOfRemovedCols > &indices)
Removes specified columns from a matrix.
Definition: linearalgebrahelper.hh:539
auto fromVoigt(const Eigen::Matrix< ST, size, 1, Options, maxSize, 1 > &EVoigt, bool isStrain=true)
Converts a vector given in Voigt notation to a matrix.
Definition: tensorutils.hh:271
Definition: assemblermanipulatorbuildingblocks.hh:22
auto planeStrain(const MaterialImpl &mat)
Factory function to create a VanishingStrain material for plane strain conditions.
Definition: vanishingstrain.hh:188
auto makeVanishingStrain(MaterialImpl mat)
Factory function to create a VanishingStrain material with specified strain indices.
Definition: vanishingstrain.hh:171
auto reduceMatrix(const Eigen::MatrixBase< Derived > &E, const std::array< size_t, sizeOfCondensedIndices > &indices)
Definition: linearalgebrahelper.hh:514
Interface classf or materials.
Definition: finiteelements/mechanics/materials/interface.hh:80
VanishingStrain material model that enforces strain components to be zero.
Definition: vanishingstrain.hh:29
typename Underlying::MaterialParameters MaterialParameters
Definition: vanishingstrain.hh:32
static constexpr bool stressAcceptsVoigt
Stress accepts Voigt notation.
Definition: vanishingstrain.hh:44
static constexpr double derivativeFactorImpl
Derivative factor.
Definition: vanishingstrain.hh:47
static constexpr bool moduliToVoigt
Moduli to Voigt notation.
Definition: vanishingstrain.hh:45
MI Underlying
The underlying material type.
Definition: vanishingstrain.hh:30
static constexpr auto fixedVoigtIndices
Fixed Voigt indices.
Definition: vanishingstrain.hh:36
static constexpr auto stressTag
Stress tag.
Definition: vanishingstrain.hh:40
static constexpr std::string nameImpl() noexcept
Definition: vanishingstrain.hh:56
VanishingStrain(MI mat)
Constructor for VanishingStrain.
Definition: vanishingstrain.hh:53
static constexpr auto freeStrains
Number of free strains.
Definition: vanishingstrain.hh:37
static constexpr auto strainTag
Strain tag.
Definition: vanishingstrain.hh:39
static constexpr bool energyAcceptsVoigt
Energy accepts Voigt notation.
Definition: vanishingstrain.hh:42
typename Underlying::ScalarType ScalarType
Scalar type.
Definition: vanishingstrain.hh:31
static constexpr auto fixedPairs
Array of fixed stress components.
Definition: vanishingstrain.hh:34
auto tangentModuliImpl(const Eigen::MatrixBase< Derived > &E) const
Computes the tangent moduli for the VanishingStrain material.
Definition: vanishingstrain.hh:109
static constexpr auto freeVoigtIndices
Free Voigt indices.
Definition: vanishingstrain.hh:35
static constexpr bool moduliAcceptsVoigt
Moduli accepts Voigt notation.
Definition: vanishingstrain.hh:46
MaterialParameters materialParametersImpl() const
Returns the material parameters stored in the material.
Definition: vanishingstrain.hh:67
auto rebind() const
Rebinds the material to a different scalar type.
Definition: vanishingstrain.hh:124
ScalarType storedEnergyImpl(const Eigen::MatrixBase< Derived > &E) const
Computes the stored energy for the VanishingStrain material.
Definition: vanishingstrain.hh:76
static constexpr auto tangentModuliTag
Tangent moduli tag.
Definition: vanishingstrain.hh:41
static constexpr bool stressToVoigt
Stress to Voigt notation.
Definition: vanishingstrain.hh:43
auto stressesImpl(const Eigen::MatrixBase< Derived > &E) const
Computes the stresses for the VanishingStrain material.
Definition: vanishingstrain.hh:89
Contains the Material interface class and related template functions for material properties.