11#include "libmesh/utility.h"
19 params.
addClassDescription(
"Deprecated class: please use CrystalPlasticityKalidindiUpdate and "
20 "ComputeMultipleCrystalPlasticityStress instead.");
28 _dsliprate_dgss(_nss),
30 _dsliprate_dsliprate(_nss, _nss)
54 Real rnorm, rnorm0, rnorm_prev;
55 unsigned int iter = 0;
68 rnormst[iter] = rnorm;
69 Real slipratemax = 0.0;
70 for (
unsigned int i = 0; i <
_nss; ++i)
73 slipratest[iter] = slipratemax;
80 DenseVector<Real> update =
_resid;
93 mooseWarning(
"FiniteStrainCrystalPLasticity: Failed with line search");
107 for (
unsigned int i = 0; i <
_nss; ++i)
110 rnormst[iter] = rnorm;
111 slipratest[iter] = slipratemax;
118 mooseWarning(
"FiniteStrainCPSlipRateRes: NR exceeds maximum iteration ", iter,
" ", rnorm);
143 for (
unsigned int i = 0; i <
_nss; ++i)
146 eqv_slip_incr = iden - eqv_slip_incr;
157 for (
unsigned int i = 0; i <
_nss; ++i)
166 for (
unsigned int i = 0; i <
_nss; ++i)
177 for (
unsigned int i = 0; i <
_nss; ++i)
178 for (
unsigned int j = 0; j <
_nss; ++j)
191 std::vector<RankTwoTensor> dtaudpk2(
_nss), dfpinvdsliprate(
_nss);
193 for (
unsigned int i = 0; i <
_nss; ++i)
195 dtaudpk2[i] =
_s0[i];
208 deedfe(i, j, k, i) = deedfe(i, j, k, i) +
_fe(k, j) * 0.5;
209 deedfe(i, j, k, j) = deedfe(i, j, k, j) +
_fe(k, i) * 0.5;
216 for (
unsigned int i = 0; i <
_nss; ++i)
217 for (
unsigned int j = 0; j <
_nss; ++j)
219 _dslipdtau(i) * dtaudpk2[i].doubleContraction(dpk2dfpinv * dfpinvdsliprate[j]);
225 for (
unsigned int i = 0; i <
_nss; ++i)
226 for (
unsigned int j = 0; j <
_nss; ++j)
240 for (
unsigned int i = 0; i <
_nss; ++i)
250 DenseVector<Real> r(
_nss);
251 DenseVector<Real>
x(
_nss);
264 for (
unsigned int i = 0; i <
_nss; ++i)
265 rnorm += Utility::pow<2>(
_resid(i));
266 rnorm = std::sqrt(rnorm) /
_nss;
273 const DenseVector<Real> & update)
281 for (
unsigned int i = 0; i < update.size(); ++i)
286 for (
unsigned int i = 0; i < update.size(); ++i)
302 unsigned int count = 0;
312 for (
unsigned int i = 0; i < update.size(); ++i)
319 for (
unsigned int i = 0; i < update.size(); ++i)
322 if ((rnorm1 / rnorm0) <
_lsrch_tol || s_a * s_b > 0)
331 for (
unsigned int i = 0; i < update.size(); ++i)
334 step = 0.5 * (step_a + step_b);
336 for (
unsigned int i = 0; i < update.size(); ++i)
363 mooseError(
"Line search meothod is not provided.");
372 for (
unsigned int i = 0; i <
_nss; ++i)
373 dotprod +=
_resid(i) * update(i);
const std::vector< double > x
registerMooseObjectDeprecated("SolidMechanicsApp", FiniteStrainCPSlipRateRes, "11/15/2024 12:00")
void mooseWarning(Args &&... args)
void mooseError(Args &&... args)
FiniteStrainCPSlipRateRes(const InputParameters ¶meters)
DenseMatrix< Real > _jacob
virtual void calcResidualSlipRate()
This function calculates residual of slip rate.
virtual void getSlipIncrements()
This function updates the slip system resistances.
virtual void solveStress()
This function solves for stress, updates plastic deformation gradient.
DenseVector< Real > _slip_rate
virtual void calcDgssDsliprate()
This function calculates partial derivative of slip system resistances with respect to split rate.
virtual void calcDtauDsliprate()
This function calculates partial derivative of resolved shear stress with respect to split rate.
virtual void calcJacobianSlipRate()
This function calculates jacobian of slip rate.
virtual void calcResidJacobSlipRate()
This function calculates residual and jacobian of slip rate.
static InputParameters validParams()
void calcUpdate()
This function calculates and updates the residual of slip rate.
virtual Real calcResidNorm()
This function calculates the residual norm.
DenseVector< Real > _dsliprate_dgss
virtual void solveStatevar()
This function solves internal variables.
DenseVector< Real > _resid
bool lineSearchUpdateSlipRate(const Real, const DenseVector< Real > &)
This function performs the line search update.
Real calcResidDotProdUpdate(const DenseVector< Real > &)
This function calculates the dot product of residual and update.
DenseMatrix< Real > _dsliprate_dsliprate
virtual void preSolveStress()
This function sets variable for internal variable solve.
FiniteStrainCrystalPlasticity uses the multiplicative decomposition of deformation gradient and solve...
Real _rtol
Stress residual equation relative tolerance.
const MaterialProperty< RankFourTensor > & _elasticity_tensor
Elasticity tensor material property.
const unsigned int _nss
Number of slip system resistance.
virtual void update_slip_system_resistance()
This function updates the slip system resistances.
static InputParameters validParams()
unsigned int _lsrch_max_iter
Line search bisection method maximum iteration number.
RankTwoTensor _fp_old_inv
Real _lsrch_tol
Line search bisection method tolerance.
unsigned int _maxiter
Maximum number of iterations for stress update.
DenseVector< Real > _slip_incr
Real _min_lsrch_step
Minimum line search step size.
DenseMatrix< Real > _dgss_dsliprate
virtual void preSolveStress()
This function set variables for stress solve.
virtual void getSlipIncrements()
This function updates the slip increments.
std::vector< Real > _gss_tmp
DenseVector< Real > _dslipdtau
Real _abs_tol
Stress residual equation absolute tolerance.
std::vector< RankTwoTensor > _s0
virtual void postSolveStress()
This function update stress and plastic deformation gradient after solve.
bool _use_line_search
Flag to activate line serach.
T doubleContraction(const RankTwoTensorTempl< T > &a) const
RankTwoTensorTempl< T > transpose() const
static constexpr std::size_t dim