40 template <
int dim,
typename DispGradType,
typename BulkType,
typename ShearType>
42 const BulkType& DeltaK,
const ShearType& DeltaG)
const
44 constexpr
auto I = Identity<dim>();
45 auto K =
K0 + get<0>(DeltaK);
46 auto G =
G0 + get<0>(DeltaG);
47 auto lambda = K - (2.0 / dim) * G;
48 auto epsilon = 0.5 * (
transpose(du_dX) + du_dX);
49 return lambda *
tr(epsilon) * I + 2.0 * G * epsilon;
83 template <
int dim,
typename DispGradType,
typename BulkType,
typename ShearType>
85 const BulkType& DeltaK,
const ShearType& DeltaG)
const
88 constexpr
auto I = Identity<dim>();
89 auto K =
K0 + get<0>(DeltaK);
90 auto G =
G0 + get<0>(DeltaG);
91 auto lambda = K - (2.0 / dim) * G;
96 auto TK = lambda * logJ * I + G * B_minus_I;
120 template <
typename... T>
122 using type = decltype((T{} + ...));
127 static constexpr
int dim = 3;
128 static constexpr
double tol = 1e-10;
141 template <
typename DisplacementGradient,
typename YieldStrength,
typename SaturationStrength,
typename StrainConstant>
142 auto operator()(
State& state,
const DisplacementGradient du_dX,
const YieldStrength sigma_y,
143 const SaturationStrength sigma_sat,
const StrainConstant strain_constant)
const
155 constexpr
auto I = Identity<dim>();
156 const double K =
E / (3.0 * (1.0 - 2.0 *
nu));
157 const double G = 0.5 *
E / (1.0 +
nu);
162 auto p = K *
tr(el_strain);
163 auto s = 2.0 * G *
dev(el_strain) * one;
168 auto residual = [eqps_old, G, *
this](
auto delta_eqps,
auto trial_mises,
auto y0,
auto ysat,
auto e0) {
169 auto Y = this->
flow_strength(eqps_old + delta_eqps, y0, ysat, e0);
170 return trial_mises - 3.0 * G * delta_eqps - Y;
179 double lower_bound = 0.0;
183 auto [delta_eqps, status] =
184 solve_scalar_equation(residual, 0.0, lower_bound, upper_bound, opts, q, sigma_y, sigma_sat, strain_constant);
186 auto Np = 1.5 * s / q;
188 s = s - 2.0 * G * delta_eqps * Np;
197 template <
typename PlasticStrain,
typename YieldStrength,
typename SaturationStrength,
typename StrainConstant>
198 auto flow_strength(
const PlasticStrain accumulated_plastic_strain,
const YieldStrength sigma_y,
199 const SaturationStrength sigma_sat,
const StrainConstant strain_constant)
const
202 return sigma_sat - (sigma_sat - sigma_y) *
exp(-accumulated_plastic_strain / strain_constant);
#define SMITH_HOST_DEVICE
Macro that evaluates to __host__ __device__ when compiling with nvcc or amdclang and does nothing on ...
Implementation of the quadrature-function-based functional enabling rapid development of FEM formulat...
SolidMechanics helper data types.
SMITH_HOST_DEVICE auto exp(dual< gradient_type > a)
implementation of exponential function for dual numbers
constexpr SMITH_HOST_DEVICE auto detApIm1(const tensor< T, 2, 2 > &A)
computes det(A + I) - 1, where precision is not lost when the entries A_{ij} << 1
auto solve_scalar_equation(const function &f, double x0, double lower_bound, double upper_bound, ScalarSolverOptions options, ParamTypes... params)
Solves a nonlinear scalar-valued equation and gives derivatives of solution to parameters.
constexpr SMITH_HOST_DEVICE auto inv(const isotropic_tensor< T, m, m > &I)
return the inverse of an isotropic tensor
SMITH_HOST_DEVICE auto sqrt(dual< gradient_type > x)
implementation of square root for dual numbers
constexpr SMITH_HOST_DEVICE auto norm(const isotropic_tensor< T, m, m > &I)
compute the Frobenius norm (sqrt(tr(dot(transpose(I), I)))) of an isotropic tensor
constexpr SMITH_HOST_DEVICE auto transpose(const isotropic_tensor< T, m, m > &I)
return the transpose of an isotropic tensor
constexpr SMITH_HOST_DEVICE auto dev(const tensor< T, n, n > &A)
Calculates the deviator of a matrix (rank-2 tensor)
constexpr SMITH_HOST_DEVICE auto get_value(const T &arg)
return the "value" part from a given type. For non-dual types, this is just the identity function
constexpr SMITH_HOST_DEVICE auto sym(const isotropic_tensor< T, m, m > &I)
return the symmetric part of an isotropic tensor
constexpr SMITH_HOST_DEVICE auto tr(const isotropic_tensor< T, m, m > &I)
calculate the trace of an isotropic tensor
SMITH_HOST_DEVICE auto log1p(dual< gradient_type > a)
implementation of the natural logarithm of one plus the argument function for dual numbers
constexpr SMITH_HOST_DEVICE auto dot(const isotropic_tensor< S, m, m > &I, const tensor< T, m, n... > &A)
dot product between an isotropic and (nonisotropic) tensor
The material and load types for the solid functional physics module.
see Nothing for a complete description of this class and when to use it
Settings for solve_scalar_equation.
double xtol
absolute tolerance on Newton correction
variables required to characterize the hysteresis response
tensor< double, dim, dim > plastic_strain
plastic strain
double accumulated_plastic_strain
uniaxial equivalent plastic strain
J2 material with Voce hardening, with hardening parameters exposed as differentiable parameters.
double nu
Poisson's ratio.
static constexpr double tol
relative tolerance on residual for accepting return map solution
double density
mass density
auto operator()(State &state, const DisplacementGradient du_dX, const YieldStrength sigma_y, const SaturationStrength sigma_sat, const StrainConstant strain_constant) const
calculate the first Piola stress, given the displacement gradient and previous material state
auto flow_strength(const PlasticStrain accumulated_plastic_strain, const YieldStrength sigma_y, const SaturationStrength sigma_sat, const StrainConstant strain_constant) const
Computes flow strength from Voce's hardening law.
static constexpr int dim
dimension of space
Linear isotropic elasticity material model.
static constexpr int numParameters()
The number of parameters in the model.
double G0
base shear modulus
double K0
base bulk modulus
SMITH_HOST_DEVICE auto operator()(State &, const smith::tensor< DispGradType, dim, dim > &du_dX, const BulkType &DeltaK, const ShearType &DeltaG) const
stress calculation for a linear isotropic material model
double density
mass density
Neo-Hookean material model.
SMITH_HOST_DEVICE auto operator()(State &, const smith::tensor< DispGradType, dim, dim > &du_dX, const BulkType &DeltaK, const ShearType &DeltaG) const
stress calculation for a NeoHookean material model
double K0
base bulk modulus
double density
mass density
double G0
base shear modulus
static constexpr int numParameters()
The number of parameters in the model.
Infers type resulting from algebraic expressions of a group of variables.
decltype((T{}+...)) type
type of the sum of the parameters
Arbitrary-rank tensor class.