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);
bool _use_line_search
Flag to activate line serach.
DenseMatrix< Real > _jacob
virtual void solveStress()
This function solves for stress, updates plastic deformation gradient.
const MaterialProperty< RankFourTensor > & _elasticity_tensor
Elasticity tensor material property.
virtual void getSlipIncrements()
This function updates the slip system resistances.
Real calcResidDotProdUpdate(const DenseVector< Real > &)
This function calculates the dot product of residual and update.
DenseVector< Real > _dsliprate_dgss
virtual void update_slip_system_resistance()
This function updates the slip system resistances.
static constexpr std::size_t dim
virtual void preSolveStress()
This function sets variable for internal variable solve.
DenseVector< Real > _resid
Real _rtol
Stress residual equation relative tolerance.
void mooseWarning(Args &&... args) const
unsigned int _maxiter
Maximum number of iterations for stress update.
static InputParameters validParams()
const unsigned int _nss
Number of slip system resistance.
void calcUpdate()
This function calculates and updates the residual of slip rate.
FiniteStrainCPSlipRateRes(const InputParameters ¶meters)
const std::vector< double > x
DenseMatrix< Real > _dsliprate_dsliprate
Real doubleContraction(const RankTwoTensorTempl< Real > &a) const
unsigned int _lsrch_max_iter
Line search bisection method maximum iteration number.
static InputParameters validParams()
virtual Real calcResidNorm()
This function calculates the residual norm.
DenseVector< Real > _dslipdtau
virtual void calcResidJacobSlipRate()
This function calculates residual and jacobian of slip rate.
virtual void preSolveStress()
This function set variables for stress solve.
virtual void calcJacobianSlipRate()
This function calculates jacobian of slip rate.
RankTwoTensorTempl< Real > transpose() const
std::vector< Real > _gss_tmp
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void calcDtauDsliprate()
This function calculates partial derivative of resolved shear stress with respect to split rate...
virtual void postSolveStress()
This function update stress and plastic deformation gradient after solve.
Real _lsrch_tol
Line search bisection method tolerance.
virtual void calcDgssDsliprate()
This function calculates partial derivative of slip system resistances with respect to split rate...
IntRange< T > make_range(T beg, T end)
std::vector< RankTwoTensor > _s0
DenseMatrix< Real > _dgss_dsliprate
virtual void calcResidualSlipRate()
This function calculates residual of slip rate.
RankTwoTensor _fp_old_inv
void mooseError(Args &&... args) const
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
DenseVector< Real > _slip_incr
FiniteStrainCrystalPlasticity uses the multiplicative decomposition of deformation gradient and solve...
bool lineSearchUpdateSlipRate(const Real, const DenseVector< Real > &)
This function performs the line search update.
registerMooseObjectDeprecated("SolidMechanicsApp", FiniteStrainCPSlipRateRes, "11/15/2024 12:00")
virtual void solveStatevar()
This function solves internal variables.
Real _abs_tol
Stress residual equation absolute tolerance.
DenseVector< Real > _slip_rate
virtual void getSlipIncrements()
This function updates the slip increments.
MooseUnits pow(const MooseUnits &, int)
static const std::string k
Real _min_lsrch_step
Minimum line search step size.