13 #include "libmesh/utility.h" 24 const InputParameters & parameters,
unsigned num_yf,
unsigned num_intnl)
36 _dsp_scratch(_num_pq),
37 _dsp_trial_scratch(_num_pq),
38 _d2sp_scratch(_num_pq)
44 const std::vector<Real> & intnl,
45 std::vector<Real> & yf)
const 47 const Real p = stress_params[0];
48 const Real q = stress_params[1];
68 const std::vector<Real> & intnl_old,
69 const std::vector<Real> & yf,
72 const Real p_trial = trial_stress_params[0];
73 const Real q_trial = trial_stress_params[1];
74 preReturnMap(p_trial, q_trial, stress_trial, intnl_old, yf, Eijkl);
81 const std::vector<Real> & ,
82 const std::vector<Real> & ,
91 const std::vector<Real> & intnl_old,
95 std::vector<Real> & intnl)
const 100 std::copy(intnl_old.begin(), intnl_old.end(), intnl.begin());
105 const std::vector<Real> & intnl,
106 std::vector<yieldAndFlow> & all_q)
const 108 const Real p = stress_params[0];
109 const Real q = stress_params[1];
115 const std::vector<Real> & intnl_old,
116 std::vector<Real> & stress_params,
118 std::vector<Real> & intnl)
const 120 const Real p_trial = trial_stress_params[0];
121 const Real q_trial = trial_stress_params[1];
125 stress_params[0] =
p;
126 stress_params[1] = q;
131 const std::vector<Real> & current_stress_params,
132 const std::vector<Real> & intnl_old,
133 std::vector<Real> & intnl)
const 135 const Real p_trial = trial_stress_params[0];
136 const Real q_trial = trial_stress_params[1];
137 const Real p = current_stress_params[0];
138 const Real q = current_stress_params[1];
144 const std::vector<Real> & trial_stress_params,
145 const std::vector<Real> & current_stress_params,
146 const std::vector<Real> & intnl_old,
147 std::vector<std::vector<Real>> & dintnl)
const 149 const Real p_trial = trial_stress_params[0];
150 const Real q_trial = trial_stress_params[1];
151 const Real p = current_stress_params[0];
152 const Real q = current_stress_params[1];
158 std::vector<Real> & stress_params)
const 163 stress_params[0] =
p;
164 stress_params[1] = q;
170 const std::vector<Real> & trial_stress_params,
172 const std::vector<Real> & stress_params,
176 bool compute_full_tangent_operator,
177 const std::vector<std::vector<Real>> & dvar_dtrial,
180 const Real p_trial = trial_stress_params[0];
181 const Real q_trial = trial_stress_params[1];
182 const Real p = stress_params[0];
183 const Real q = stress_params[1];
199 compute_full_tangent_operator,
214 bool compute_full_tangent_operator,
218 if (!compute_full_tangent_operator)
235 cto(i,
j,
k, l) -= s1(i,
j) * t1(
k, l) + s2(i,
j) * t2(
k, l);
252 mooseWarning(
"TwoParameterPlasticityStressUpdate: Cannot invert 1+T in consistent tangent " 253 "operator computation at quadpoint ",
265 const std::vector<Real> & stress_params,
267 const std::vector<Real> & intnl,
272 const Real p_ok = stress_params[0];
273 const Real q_ok = stress_params[1];
286 inelastic_strain_increment = (gaE /
_Epp) * (smoothed_q.
dg[0] *
dpdstress(returned_stress) +
292 std::vector<RankTwoTensor> & dsp)
const 295 mooseAssert(dsp.size() ==
_num_pq,
296 "TwoParameterPlasticityStressUpdate: dsp incorrectly sized in dstressparam_dstress");
303 std::vector<RankFourTensor> & d2sp)
const 308 "TwoParameterPlasticityStressUpdate: d2sp incorrectly sized in d2stressparam_dstress");
virtual RankFourTensor d2pdstress2(const RankTwoTensor &stress) const =0
d2(p)/d(stress)/d(stress) Derived classes must override this
virtual void d2stressparam_dstress(const RankTwoTensor &stress, std::vector< RankFourTensor > &d2sp) const override
d2(stress_param[i])/d(stress)/d(stress) at given stress.
virtual void setStressAfterReturn(const RankTwoTensor &stress_trial, Real p_ok, Real q_ok, Real gaE, const std::vector< Real > &intnl, const yieldAndFlow &smoothed_q, const RankFourTensor &Eijkl, RankTwoTensor &stress) const =0
Sets stress from the admissible parameters.
static constexpr int _num_pq
Number of variables = 2 = (p, q)
virtual void setEppEqq(const RankFourTensor &Eijkl, Real &Epp, Real &Eqq) const =0
Set Epp and Eqq based on the elasticity tensor Derived classes must override this.
Real _dp_dpt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
Real _dq_dpt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
virtual void consistentTangentOperator(const RankTwoTensor &stress_trial, Real p_trial, Real q_trial, const RankTwoTensor &stress, Real p, Real q, Real gaE, const yieldAndFlow &smoothed_q, const RankFourTensor &Eijkl, bool compute_full_tangent_operator, RankFourTensor &cto) const
Calculates the consistent tangent operator.
virtual void setEffectiveElasticity(const RankFourTensor &Eijkl) override
Sets _Eij and _En and _Cij.
Real _En
normalising factor
virtual void setIntnlValues(Real p_trial, Real q_trial, Real p, Real q, const std::vector< Real > &intnl_old, std::vector< Real > &intnl) const =0
Sets the internal parameters based on the trial values of p and q, their current values, and the old values of the internal parameters.
Struct designed to hold info about a single yield function and its derivatives, as well as the flow d...
void setIntnlValuesV(const std::vector< Real > &trial_stress_params, const std::vector< Real > ¤t_stress_params, const std::vector< Real > &intnl_old, std::vector< Real > &intnl) const override
Sets the internal parameters based on the trial values of stress_params, their current values...
std::vector< std::vector< Real > > _Cij
_Cij[i, j] * _Eij[j, k] = 1 iff j == k
virtual void computeAllQ(Real p, Real q, const std::vector< Real > &intnl, std::vector< yieldAndFlow > &all_q) const =0
Completely fills all_q with correct values.
Real _dgaE_dqt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
void setInelasticStrainIncrementAfterReturn(const RankTwoTensor &stress_trial, Real gaE, const yieldAndFlow &smoothed_q, const RankFourTensor &elasticity_tensor, const RankTwoTensor &returned_stress, RankTwoTensor &inelastic_strain_increment) override
Sets inelastic strain increment from the returned configuration This is called after the return-map p...
Real _dgaE_dpt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)
virtual void initializeVars(Real p_trial, Real q_trial, const std::vector< Real > &intnl_old, Real &p, Real &q, Real &gaE, std::vector< Real > &intnl) const
Sets (p, q, gaE, intnl) at "good guesses" of the solution to the Return-Map algorithm.
TwoParameterPlasticityStressUpdate(const InputParameters ¶meters, unsigned num_yf, unsigned num_intnl)
std::vector< std::vector< Real > > _Eij
E[i, j] in the system of equations to be solved.
virtual void yieldFunctionValues(Real p, Real q, const std::vector< Real > &intnl, std::vector< Real > &yf) const =0
Computes the values of the yield functions, given p, q and intnl parameters.
virtual void setIntnlDerivativesV(const std::vector< Real > &trial_stress_params, const std::vector< Real > ¤t_stress_params, const std::vector< Real > &intnl, std::vector< std::vector< Real >> &dintnl) const override
Sets the derivatives of internal parameters, based on the trial values of stress_params, their current values, and the current values of the internal parameters.
void initializeVarsV(const std::vector< Real > &trial_stress_params, const std::vector< Real > &intnl_old, std::vector< Real > &stress_params, Real &gaE, std::vector< Real > &intnl) const override
Sets (stress_params, intnl) at "good guesses" of the solution to the Return-Map algorithm.
Real _dq_dqt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
void computeAllQV(const std::vector< Real > &stress_params, const std::vector< Real > &intnl, std::vector< yieldAndFlow > &all_q) const override
Completely fills all_q with correct values.
std::vector< RankFourTensor > _d2sp_scratch
d2(stress_param[:])/d(stress)/d(stress) used in d2stressparam_dstress to avoid repeatedly allocating/...
virtual void computePQ(const RankTwoTensor &stress, Real &p, Real &q) const =0
Computes p and q, given stress.
static InputParameters validParams()
RankFourTensorTempl< T > transposeMajor() const
void consistentTangentOperatorV(const RankTwoTensor &stress_trial, const std::vector< Real > &trial_stress_params, const RankTwoTensor &stress, const std::vector< Real > &stress_params, Real gaE, const yieldAndFlow &smoothed_q, const RankFourTensor &Eijkl, bool compute_full_tangent_operator, const std::vector< std::vector< Real >> &dvar_dtrial, RankFourTensor &cto) override
Calculates the consistent tangent operator.
void yieldFunctionValuesV(const std::vector< Real > &stress_params, const std::vector< Real > &intnl, std::vector< Real > &yf) const override
Computes the values of the yield functions, given stress_params and intnl parameters.
Real _Epp
elasticity tensor in p direction
void setStressAfterReturnV(const RankTwoTensor &stress_trial, const std::vector< Real > &stress_params, Real gaE, const std::vector< Real > &intnl, const yieldAndFlow &smoothed_q, const RankFourTensor &Eijkl, RankTwoTensor &stress) const override
Sets stress from the admissible parameters.
virtual void dstressparam_dstress(const RankTwoTensor &stress, std::vector< RankTwoTensor > &dsp) const override
d(stress_param[i])/d(stress) at given stress.
virtual void computeStressParams(const RankTwoTensor &stress, std::vector< Real > &stress_params) const override
Computes stress_params, given stress.
virtual RankTwoTensor dqdstress(const RankTwoTensor &stress) const =0
d(q)/d(stress) Derived classes must override this
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _Eqq
elasticity tensor in q direction
MultiParameterPlasticityStressUpdate performs the return-map algorithm and associated stress updates ...
void preReturnMapV(const std::vector< Real > &trial_stress_params, const RankTwoTensor &stress_trial, const std::vector< Real > &intnl_old, const std::vector< Real > &yf, const RankFourTensor &Eijkl) override
Derived classes may employ this function to record stuff or do other computations prior to the return...
virtual void preReturnMap(Real p_trial, Real q_trial, const RankTwoTensor &stress_trial, const std::vector< Real > &intnl_old, const std::vector< Real > &yf, const RankFourTensor &Eijkl)
Derived classes may employ this function to record stuff or do other computations prior to the return...
void mooseWarning(Args &&... args) const
virtual void setIntnlDerivatives(Real p_trial, Real q_trial, Real p, Real q, const std::vector< Real > &intnl, std::vector< std::vector< Real >> &dintnl) const =0
Sets the derivatives of internal parameters, based on the trial values of p and q, their current values, and the old values of the internal parameters.
static InputParameters validParams()
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
std::vector< RankTwoTensor > _dsp_trial_scratch
d(stress_param[:])/d(stress_trial) used in dstressparam_dstress to avoid repeatedly allocating/deallo...
std::vector< RankTwoTensor > _dsp_scratch
d(stress_param[:])/d(stress) used in dstressparam_dstress to avoid repeatedly allocating/deallocating...
Real _dp_dqt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
RankFourTensorTempl< T > invSymm() const
virtual RankFourTensor d2qdstress2(const RankTwoTensor &stress) const =0
d2(q)/d(stress)/d(stress) Derived classes must override this
static constexpr unsigned _tensor_dimensionality
Internal dimensionality of tensors (currently this is 3 throughout solid mechanics) ...
static const std::string k
const Elem *const & _current_elem
virtual RankTwoTensor dpdstress(const RankTwoTensor &stress) const =0
d(p)/d(stress) Derived classes must override this