https://mooseframework.inl.gov
Loading...
Searching...
No Matches
TwoParameterPlasticityStressUpdate.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
13
14#include <array>
15
25{
26public:
28
30 unsigned num_yf,
31 unsigned num_intnl);
32
33protected:
35 constexpr static int _num_pq = 2;
36
39
42
44 Real _Epp;
45
47 Real _Eqq;
48
54 Real _dp_dpt;
56 Real _dq_dpt;
58 Real _dp_dqt;
60 Real _dq_dqt;
61
71 virtual void yieldFunctionValues(Real p,
72 Real q,
73 const std::vector<Real> & intnl,
74 std::vector<Real> & yf) const = 0;
75 void yieldFunctionValuesV(const std::vector<Real> & stress_params,
76 const std::vector<Real> & intnl,
77 std::vector<Real> & yf) const override;
78
92 virtual void computeAllQ(Real p,
93 Real q,
94 const std::vector<Real> & intnl,
95 std::vector<yieldAndFlow> & all_q) const = 0;
96 void computeAllQV(const std::vector<Real> & stress_params,
97 const std::vector<Real> & intnl,
98 std::vector<yieldAndFlow> & all_q) const override;
99
111 virtual void preReturnMap(Real p_trial,
112 Real q_trial,
113 const RankTwoTensor & stress_trial,
114 const std::vector<Real> & intnl_old,
115 const std::vector<Real> & yf,
116 const RankFourTensor & Eijkl);
117 void preReturnMapV(const std::vector<Real> & trial_stress_params,
118 const RankTwoTensor & stress_trial,
119 const std::vector<Real> & intnl_old,
120 const std::vector<Real> & yf,
121 const RankFourTensor & Eijkl) override;
122
139 virtual void initializeVars(Real p_trial,
140 Real q_trial,
141 const std::vector<Real> & intnl_old,
142 Real & p,
143 Real & q,
144 Real & gaE,
145 std::vector<Real> & intnl) const;
146 void initializeVarsV(const std::vector<Real> & trial_stress_params,
147 const std::vector<Real> & intnl_old,
148 std::vector<Real> & stress_params,
149 Real & gaE,
150 std::vector<Real> & intnl) const override;
151
164 virtual void setIntnlValues(Real p_trial,
165 Real q_trial,
166 Real p,
167 Real q,
168 const std::vector<Real> & intnl_old,
169 std::vector<Real> & intnl) const = 0;
170 void setIntnlValuesV(const std::vector<Real> & trial_stress_params,
171 const std::vector<Real> & current_stress_params,
172 const std::vector<Real> & intnl_old,
173 std::vector<Real> & intnl) const override;
174
188 virtual void setIntnlDerivatives(Real p_trial,
189 Real q_trial,
190 Real p,
191 Real q,
192 const std::vector<Real> & intnl,
193 std::vector<std::vector<Real>> & dintnl) const = 0;
194 virtual void setIntnlDerivativesV(const std::vector<Real> & trial_stress_params,
195 const std::vector<Real> & current_stress_params,
196 const std::vector<Real> & intnl,
197 std::vector<std::vector<Real>> & dintnl) const override;
198
206 virtual void computePQ(const RankTwoTensor & stress, Real & p, Real & q) const = 0;
207 virtual void computeStressParams(const RankTwoTensor & stress,
208 std::vector<Real> & stress_params) const override;
209
217 virtual void setEppEqq(const RankFourTensor & Eijkl, Real & Epp, Real & Eqq) const = 0;
218 virtual void setEffectiveElasticity(const RankFourTensor & Eijkl) override;
219
235 virtual void setStressAfterReturn(const RankTwoTensor & stress_trial,
236 Real p_ok,
237 Real q_ok,
238 Real gaE,
239 const std::vector<Real> & intnl,
240 const yieldAndFlow & smoothed_q,
241 const RankFourTensor & Eijkl,
242 RankTwoTensor & stress) const = 0;
243 void setStressAfterReturnV(const RankTwoTensor & stress_trial,
244 const std::vector<Real> & stress_params,
245 Real gaE,
246 const std::vector<Real> & intnl,
247 const yieldAndFlow & smoothed_q,
248 const RankFourTensor & Eijkl,
249 RankTwoTensor & stress) const override;
250
252 Real gaE,
253 const yieldAndFlow & smoothed_q,
254 const RankFourTensor & elasticity_tensor,
255 const RankTwoTensor & returned_stress,
256 RankTwoTensor & inelastic_strain_increment) override;
257
277 virtual void consistentTangentOperator(const RankTwoTensor & stress_trial,
278 Real p_trial,
279 Real q_trial,
280 const RankTwoTensor & stress,
281 Real p,
282 Real q,
283 Real gaE,
284 const yieldAndFlow & smoothed_q,
285 const RankFourTensor & Eijkl,
286 bool compute_full_tangent_operator,
287 RankFourTensor & cto) const;
288
289 void consistentTangentOperatorV(const RankTwoTensor & stress_trial,
290 const std::vector<Real> & trial_stress_params,
291 const RankTwoTensor & stress,
292 const std::vector<Real> & stress_params,
293 Real gaE,
294 const yieldAndFlow & smoothed_q,
295 const RankFourTensor & Eijkl,
296 bool compute_full_tangent_operator,
297 const std::vector<std::vector<Real>> & dvar_dtrial,
298 RankFourTensor & cto) override;
299
300 virtual void dstressparam_dstress(const RankTwoTensor & stress,
301 std::vector<RankTwoTensor> & dsp) const override;
302 virtual void d2stressparam_dstress(const RankTwoTensor & stress,
303 std::vector<RankFourTensor> & d2sp) const override;
310 virtual RankTwoTensor dpdstress(const RankTwoTensor & stress) const = 0;
311
318 virtual RankFourTensor d2pdstress2(const RankTwoTensor & stress) const = 0;
319
326 virtual RankTwoTensor dqdstress(const RankTwoTensor & stress) const = 0;
327
334 virtual RankFourTensor d2qdstress2(const RankTwoTensor & stress) const = 0;
335
336private:
341 mutable std::vector<RankTwoTensor> _dsp_scratch;
342
347 mutable std::vector<RankTwoTensor> _dsp_trial_scratch;
348
353 mutable std::vector<RankFourTensor> _d2sp_scratch;
354};
const Real p
const InputParameters & parameters() const
MultiParameterPlasticityStressUpdate performs the return-map algorithm and associated stress updates ...
TwoParameterPlasticityStressUpdate performs the return-map algorithm and associated stress updates fo...
std::vector< RankTwoTensor > _dsp_trial_scratch
d(stress_param[:])/d(stress_trial) used in dstressparam_dstress to avoid repeatedly allocating/deallo...
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...
virtual void setEffectiveElasticity(const RankFourTensor &Eijkl) override
Sets _Eij and _En and _Cij.
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,...
std::vector< RankTwoTensor > _dsp_scratch
d(stress_param[:])/d(stress) used in dstressparam_dstress to avoid repeatedly allocating/deallocating...
void setIntnlValuesV(const std::vector< Real > &trial_stress_params, const std::vector< Real > &current_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,...
Real _dq_dpt
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...
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,...
virtual RankTwoTensor dpdstress(const RankTwoTensor &stress) const =0
d(p)/d(stress) Derived classes must override this
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 RankFourTensor d2pdstress2(const RankTwoTensor &stress) const =0
d2(p)/d(stress)/d(stress) Derived classes must override this
virtual void setIntnlDerivativesV(const std::vector< Real > &trial_stress_params, const std::vector< Real > &current_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,...
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 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.
virtual void computeStressParams(const RankTwoTensor &stress, std::vector< Real > &stress_params) const override
Computes stress_params, given stress.
static constexpr int _num_pq
Number of variables = 2 = (p, q)
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...
Real _dp_dqt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
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...
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.
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 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.
virtual RankFourTensor d2qdstress2(const RankTwoTensor &stress) const =0
d2(q)/d(stress)/d(stress) Derived classes must override this
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...
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 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 dstressparam_dstress(const RankTwoTensor &stress, std::vector< RankTwoTensor > &dsp) const override
d(stress_param[i])/d(stress) at given stress.
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.
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.
virtual RankTwoTensor dqdstress(const RankTwoTensor &stress) const =0
d(q)/d(stress) Derived classes must override this
Real _dp_dpt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
Real _dgaE_dpt
derivative of Variable with respect to trial variable (used in consistent-tangent-operator calculatio...
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.
Struct designed to hold info about a single yield function and its derivatives, as well as the flow d...