27template <auto strainIndexPair,
typename MI>
36 static constexpr int dim = Underlying::dim;
43 static constexpr auto strainTag = Underlying::strainTag;
44 static constexpr auto stressTag = Underlying::stressTag;
60 [[nodiscard]]
constexpr static std::string
nameImpl() noexcept {
61 auto matName = MI::name() +
"_VanishingStrain(";
63 matName +=
"(" + std::to_string(p.row) + std::to_string(p.col) +
")";
79 template <
typename Derived>
81 const auto Esol = reduceStrain(E);
82 return matImpl_.storedEnergyImpl(Esol);
92 template <
bool voigt,
typename Derived>
94 const auto Esol = reduceStrain(E);
95 auto stressesRed = matImpl_.template stresses<Underlying::strainTag, true>(Esol);
97 if constexpr (voigt) {
112 template <
bool voigt,
typename Derived>
114 const auto Esol = reduceStrain(E);
115 auto C = matImpl_.template tangentModuli<Underlying::strainTag, true>(Esol);
127 template <
typename ScalarTypeOther>
129 auto reboundMatImpl = matImpl_.template rebind<ScalarTypeOther>();
147 template <
typename Derived>
148 auto reduceStrain(
const Eigen::MatrixBase<Derived>& Eraw)
const {
150 Eigen::Matrix3<ScalarType> E = Impl::maybeFromVoigt(Eraw);
154 decltype(
auto) E = Impl::maybeFromVoigt(Eraw);
155 Eigen::Matrix3<ScalarType> Egl = transformStrain<strainTag, StrainTags::greenLagrangian>(E);
156 setStrainsToZero(Egl);
157 return transformStrain<StrainTags::greenLagrangian, strainTag>(Egl).derived();
163 inline void setStrainsToZero(
auto& E)
const {
179template <MatrixIndexPair... stressIndexPair,
typename MaterialImpl>
181 return VanishingStrain<std::to_array({stressIndexPair...}), MaterialImpl>(mat);
196template <
typename MaterialImpl>
Provides a NonLinearOperator class for handling nonlinear operators.
Implementation of the Newton-Raphson method for solving nonlinear equations.
Implementation of strain-related functions.
helper functions used by material model implementations.
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:284
auto reduceMatrix(const Eigen::MatrixBase< Derived > &E, const std::array< size_t, sizeOfCondensedIndices > &indices)
Definition: linearalgebrahelper.hh:514
Definition: arrudaboyce.hh:27
auto makeVanishingStrain(MaterialImpl mat)
Factory function to create a VanishingStrain material with specified strain indices.
Definition: vanishingstrain.hh:180
auto planeStrain(const MaterialImpl &mat)
Factory function to create a VanishingStrain material for plane strain conditions.
Definition: vanishingstrain.hh:197
Interface classf or materials.
Definition: finiteelements/mechanics/materials/interface.hh:80
Represents a pair of stress or strain matrix indices (row and column).
Definition: materialhelpers.hh:26
VanishingStrain material model that enforces strain components to be zero.
Definition: vanishingstrain.hh:29
MaterialParameters materialParametersImpl() const
Returns the material parameters stored in the material.
Definition: vanishingstrain.hh:71
static constexpr bool stressToVoigt
Stress to Voigt notation.
Definition: vanishingstrain.hh:47
ScalarType storedEnergyImpl(const Eigen::MatrixBase< Derived > &E) const
Computes the stored energy for the VanishingStrain material.
Definition: vanishingstrain.hh:80
static constexpr auto freeStrains
Number of free strains.
Definition: vanishingstrain.hh:41
static constexpr std::string nameImpl() noexcept
Definition: vanishingstrain.hh:60
static constexpr auto strainTag
Strain tag.
Definition: vanishingstrain.hh:43
static constexpr bool energyAcceptsVoigt
Energy accepts Voigt notation.
Definition: vanishingstrain.hh:46
static constexpr auto tangentModuliTag
Tangent moduli tag.
Definition: vanishingstrain.hh:45
VanishingStrain(MI mat)
Constructor for VanishingStrain.
Definition: vanishingstrain.hh:57
typename Underlying::StressMatrix StressMatrix
Definition: vanishingstrain.hh:34
static constexpr int dim
Definition: vanishingstrain.hh:36
auto & underlying() const
Returns a const reference to the underlying material.
Definition: vanishingstrain.hh:136
static constexpr auto fixedVoigtIndices
Fixed Voigt indices.
Definition: vanishingstrain.hh:40
auto stressesImpl(const Eigen::MatrixBase< Derived > &E) const
Computes the stresses for the VanishingStrain material.
Definition: vanishingstrain.hh:93
auto tangentModuliImpl(const Eigen::MatrixBase< Derived > &E) const
Computes the tangent moduli for the VanishingStrain material.
Definition: vanishingstrain.hh:113
static constexpr bool moduliToVoigt
Moduli to Voigt notation.
Definition: vanishingstrain.hh:49
static constexpr bool stressAcceptsVoigt
Stress accepts Voigt notation.
Definition: vanishingstrain.hh:48
typename Underlying::StrainMatrix StrainMatrix
Definition: vanishingstrain.hh:33
static constexpr double derivativeFactorImpl
Derivative factor.
Definition: vanishingstrain.hh:51
typename Underlying::MaterialTensor MaterialTensor
Definition: vanishingstrain.hh:35
static constexpr auto stressTag
Stress tag.
Definition: vanishingstrain.hh:44
MI Underlying
The underlying material type.
Definition: vanishingstrain.hh:30
auto rebind() const
Rebinds the material to a different scalar type.
Definition: vanishingstrain.hh:128
static constexpr auto freeVoigtIndices
Free Voigt indices.
Definition: vanishingstrain.hh:39
static constexpr auto fixedPairs
Array of fixed stress components.
Definition: vanishingstrain.hh:38
typename Underlying::ScalarType ScalarType
Scalar type.
Definition: vanishingstrain.hh:31
static constexpr bool moduliAcceptsVoigt
Moduli accepts Voigt notation.
Definition: vanishingstrain.hh:50
typename Underlying::MaterialParameters MaterialParameters
Definition: vanishingstrain.hh:32
Contains the Material interface class and related template functions for material properties.