www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
IsotropicPlasticity Class Reference

#include <IsotropicPlasticity.h>

Inheritance diagram for IsotropicPlasticity:
[legend]

Public Member Functions

 IsotropicPlasticity (const InputParameters &parameters)
 
virtual void initQpStatefulProperties () override
 
virtual void computeStress (const Elem &current_elem, const SymmElasticityTensor &elasticityTensor, const SymmTensor &stress_old, SymmTensor &strain_increment, SymmTensor &stress_new) override
 
void computeStress (const Elem &current_elem, const SymmElasticityTensor &elasticityTensor, const SymmTensor &stress_old, SymmTensor &strain_increment, SymmTensor &stress_new, SymmTensor &inelastic_strain_increment)
 Compute stress by performing return mapping iterations. More...
 
virtual Real computeReferenceResidual (const Real effective_trial_stress, const Real scalar) override
 Compute a reference quantity to be used for checking relative convergence. More...
 
Real computeTimeStepLimit ()
 Compute the limiting value of the time step for this material. More...
 
virtual Real minimumPermissibleValue (const Real) const override
 Compute the minimum permissible value of the scalar. More...
 
void outputIterationSummary (std::stringstream *iter_output, const unsigned int total_it) override
 Output summary information for the convergence history of the model. More...
 
void setQp (unsigned int qp)
 Sets the value of the variable _qp for inheriting classes. More...
 
virtual bool modifyStrainIncrement (const Elem &, SymmTensor &strain_increment, SymmTensor &d_strain_dT)
 
virtual bool updateElasticityTensor (SymmElasticityTensor &)
 
virtual bool applyThermalStrain (SymmTensor &strain_increment, SymmTensor &d_strain_dT)
 

Protected Member Functions

virtual void computeYieldStress ()
 
virtual void computeStressInitialize (Real effectiveTrialStress, const SymmElasticityTensor &elasticityTensor) override
 Perform any necessary initialization before return mapping iterations. More...
 
virtual void computeStressFinalize (const SymmTensor &plasticStrainIncrement) override
 Perform any necessary steps to finalize state after return mapping iterations. More...
 
virtual Real computeResidual (const Real effectiveTrialStress, const Real scalar) override
 Compute the residual for a predicted value of the scalar. More...
 
virtual Real computeDerivative (const Real effectiveTrialStress, const Real scalar) override
 Compute the derivative of the residual as a function of the scalar variable. More...
 
virtual void iterationFinalize (Real scalar) override
 Finalize internal state variables for a model for a given iteration. More...
 
virtual Real computeHardeningValue (Real scalar)
 
virtual Real computeHardeningDerivative (Real scalar)
 
void returnMappingSolve (const Real effective_trial_stress, Real &scalar, const ConsoleStream &console)
 Perform the return mapping iterations. More...
 
virtual Real maximumPermissibleValue (const Real effective_trial_stress) const
 Compute the maximum permissible value of the scalar. More...
 
virtual Real initialGuess (const Real)
 Compute an initial guess for the value of the scalar. More...
 
virtual void outputIterationStep (std::stringstream *iter_output, const unsigned int it, const Real effective_trial_stress, const Real scalar, const Real residual, const Real reference_residual)
 Output information for a single iteration step to build the convergence history of the model. More...
 

Protected Attributes

Function * _yield_stress_function
 
Real _yield_stress
 
const Real _hardening_constant
 
PiecewiseLinear *const _hardening_function
 
Real _yield_condition
 
Real _shear_modulus
 
Real _hardening_slope
 
MaterialProperty< SymmTensor > & _plastic_strain
 
const MaterialProperty< SymmTensor > & _plastic_strain_old
 
MaterialProperty< Real > & _hardening_variable
 
const MaterialProperty< Real > & _hardening_variable_old
 
Real _effective_strain_increment
 
Real _three_shear_modulus
 3 * shear modulus More...
 
MaterialProperty< Real > & _effective_inelastic_strain
 
const MaterialProperty< Real > & _effective_inelastic_strain_old
 
Real _max_inelastic_increment
 
const bool _compute_matl_timestep_limit
 
MaterialProperty< Real > * _matl_timestep_limit
 
const bool _has_temp
 
const VariableValue & _temperature
 
const VariableValue & _temperature_old
 
const Real _alpha
 
Function * _alpha_function
 
bool _has_stress_free_temp
 
Real _stress_free_temp
 
bool _mean_alpha_function
 
Real _ref_temp
 
bool _check_range
 Whether to check to see whether iterative solution is within admissible range, and set within that range if outside. More...
 
bool _line_search
 Whether to use line searches to improve convergence. More...
 
bool _bracket_solution
 Whether to save upper and lower bounds of root for scalar, and set solution to the midpoint between those bounds if outside them. More...
 
bool & _step_zero_cm
 Restartable data to check for the zeroth and first time steps. More...
 
bool & _step_one_cm
 

Detailed Description

Definition at line 22 of file IsotropicPlasticity.h.

Constructor & Destructor Documentation

◆ IsotropicPlasticity()

IsotropicPlasticity::IsotropicPlasticity ( const InputParameters &  parameters)

Definition at line 37 of file IsotropicPlasticity.C.

38  : ReturnMappingModel(parameters, "plastic"),
40  isParamValid("yield_stress_function") ? &getFunction("yield_stress_function") : NULL),
41  _yield_stress(isParamValid("yield_stress") ? getParam<Real>("yield_stress") : 0),
42  _hardening_constant(isParamValid("hardening_constant") ? getParam<Real>("hardening_constant")
43  : 0),
44  _hardening_function(isParamValid("hardening_function")
45  ? dynamic_cast<PiecewiseLinear *>(&getFunction("hardening_function"))
46  : NULL),
47 
48  _plastic_strain(declareProperty<SymmTensor>("plastic_strain")),
49  _plastic_strain_old(getMaterialPropertyOld<SymmTensor>("plastic_strain")),
50 
51  _hardening_variable(declareProperty<Real>("hardening_variable")),
52  _hardening_variable_old(getMaterialPropertyOld<Real>("hardening_variable"))
53 {
54  if (isParamValid("yield_stress") && _yield_stress <= 0)
55  mooseError("Yield stress must be greater than zero");
56 
57  if (_yield_stress_function == NULL && !isParamValid("yield_stress"))
58  mooseError("Either yield_stress or yield_stress_function must be given");
59 
60  if ((isParamValid("hardening_constant") && isParamValid("hardening_function")) ||
61  (!isParamValid("hardening_constant") && !isParamValid("hardening_function")))
62  mooseError("Either hardening_constant or hardening_function must be defined");
63 
64  if (isParamValid("hardening_function") && !_hardening_function)
65  mooseError("The hardening_function must be PiecewiseLinear");
66 }
MaterialProperty< SymmTensor > & _plastic_strain
MaterialProperty< Real > & _hardening_variable
const MaterialProperty< Real > & _hardening_variable_old
const MaterialProperty< SymmTensor > & _plastic_strain_old
ReturnMappingModel(const InputParameters &parameters, const std::string inelastic_strain_name="")
Function * _yield_stress_function
PiecewiseLinear *const _hardening_function

Member Function Documentation

◆ applyThermalStrain()

bool ConstitutiveModel::applyThermalStrain ( SymmTensor strain_increment,
SymmTensor d_strain_dT 
)
virtualinherited

Definition at line 106 of file ConstitutiveModel.C.

Referenced by ConstitutiveModel::modifyStrainIncrement().

107 {
108  if (_t_step >= 1)
109  _step_zero_cm = false;
110 
111  if (_t_step >= 2)
112  _step_one_cm = false;
113 
114  if (_has_temp && !_step_zero_cm)
115  {
116  Real inc_thermal_strain;
117  Real d_thermal_strain_d_temp;
118 
119  Real old_temp;
121  old_temp = _stress_free_temp;
122  else
123  old_temp = _temperature_old[_qp];
124 
125  Real current_temp = _temperature[_qp];
126 
127  Real delta_t = current_temp - old_temp;
128 
129  Real alpha = _alpha;
130 
131  if (_alpha_function)
132  {
133  Point p;
134  Real alpha_current_temp = _alpha_function->value(current_temp, p);
135  Real alpha_old_temp = _alpha_function->value(old_temp, p);
136  Real alpha_stress_free_temperature = _alpha_function->value(_stress_free_temp, p);
137 
139  {
140  Real small(1e-6);
141 
142  Real numerator = alpha_current_temp * (current_temp - _ref_temp) -
143  alpha_old_temp * (old_temp - _ref_temp);
144  Real denominator = 1.0 + alpha_stress_free_temperature * (_stress_free_temp - _ref_temp);
145  if (denominator < small)
146  mooseError("Denominator too small in thermal strain calculation");
147  inc_thermal_strain = numerator / denominator;
148  d_thermal_strain_d_temp = alpha_current_temp * (current_temp - _ref_temp);
149  }
150  else
151  {
152  inc_thermal_strain = delta_t * 0.5 * (alpha_current_temp + alpha_old_temp);
153  d_thermal_strain_d_temp = alpha_current_temp;
154  }
155  }
156  else
157  {
158  inc_thermal_strain = delta_t * alpha;
159  d_thermal_strain_d_temp = alpha;
160  }
161 
162  strain_increment.addDiag(-inc_thermal_strain);
163  d_strain_dT.addDiag(-d_thermal_strain_d_temp);
164  }
165 
166  bool modified = true;
167  return modified;
168 }
const VariableValue & _temperature
Function * _alpha_function
bool & _step_zero_cm
Restartable data to check for the zeroth and first time steps.
void addDiag(Real value)
Definition: SymmTensor.h:282
const VariableValue & _temperature_old

◆ computeDerivative()

Real IsotropicPlasticity::computeDerivative ( const Real  effective_trial_stress,
const Real  scalar 
)
overrideprotectedvirtual

Compute the derivative of the residual as a function of the scalar variable.

The residual should be in strain increment units for all models for consistency.

Parameters
effective_trial_stressEffective trial stress
scalarInelastic strain increment magnitude being solved for

Implements SingleVariableReturnMappingSolution.

Definition at line 118 of file IsotropicPlasticity.C.

119 {
120  Real derivative(1);
121  if (_yield_condition > 0)
122  derivative = -1.0 - _hardening_slope / (3.0 * _shear_modulus);
123 
124  return derivative;
125 }

◆ computeHardeningDerivative()

Real IsotropicPlasticity::computeHardeningDerivative ( Real  scalar)
protectedvirtual

Reimplemented in IsotropicPowerLawHardening, and IsotropicTempDepHardening.

Definition at line 148 of file IsotropicPlasticity.C.

Referenced by computeResidual().

149 {
150  Real slope = _hardening_constant;
152  {
153  const Real strain_old = _effective_inelastic_strain_old[_qp];
154  Point p;
155 
156  slope = _hardening_function->timeDerivative(strain_old, p);
157  }
158  return slope;
159 }
const MaterialProperty< Real > & _effective_inelastic_strain_old
PiecewiseLinear *const _hardening_function

◆ computeHardeningValue()

Real IsotropicPlasticity::computeHardeningValue ( Real  scalar)
protectedvirtual

Reimplemented in IsotropicTempDepHardening.

Definition at line 135 of file IsotropicPlasticity.C.

Referenced by computeResidual(), and iterationFinalize().

136 {
137  Real hardening = _hardening_variable_old[_qp] + (_hardening_slope * scalar);
139  {
140  const Real strain_old = _effective_inelastic_strain_old[_qp];
141  Point p;
142 
143  hardening = _hardening_function->value(strain_old + scalar, p) - _yield_stress;
144  }
145  return hardening;
146 }
const MaterialProperty< Real > & _hardening_variable_old
const MaterialProperty< Real > & _effective_inelastic_strain_old
PiecewiseLinear *const _hardening_function

◆ computeReferenceResidual()

Real ReturnMappingModel::computeReferenceResidual ( const Real  effective_trial_stress,
const Real  scalar 
)
overridevirtualinherited

Compute a reference quantity to be used for checking relative convergence.

This should be in strain increment units for all models for consistency.

Parameters
effective_trial_stressEffective trial stress
scalarInelastic strain increment magnitude being solved for

Implements SingleVariableReturnMappingSolution.

Definition at line 135 of file ReturnMappingModel.C.

136 {
137  return effective_trial_stress / _three_shear_modulus - scalar;
138 }
Real _three_shear_modulus
3 * shear modulus

◆ computeResidual()

Real IsotropicPlasticity::computeResidual ( const Real  effective_trial_stress,
const Real  scalar 
)
overrideprotectedvirtual

Compute the residual for a predicted value of the scalar.

This residual should be in strain increment units for all models for consistency.

Parameters
effective_trial_stressEffective trial stress
scalarInelastic strain increment magnitude being solved for

Implements SingleVariableReturnMappingSolution.

Definition at line 98 of file IsotropicPlasticity.C.

99 {
100  Real residual = 0.0;
101  _hardening_slope = 0.0;
102  if (_yield_condition > 0.0)
103  {
106 
107  // The order here is important. The final term can be small, and we don't want it lost to
108  // roundoff.
109  residual =
110  (effectiveTrialStress - _hardening_variable[_qp] - _yield_stress) / (3.0 * _shear_modulus) -
111  scalar;
112  }
113 
114  return residual;
115 }
MaterialProperty< Real > & _hardening_variable
virtual Real computeHardeningValue(Real scalar)
virtual Real computeHardeningDerivative(Real scalar)

◆ computeStress() [1/2]

void ReturnMappingModel::computeStress ( const Elem &  current_elem,
const SymmElasticityTensor elasticityTensor,
const SymmTensor stress_old,
SymmTensor strain_increment,
SymmTensor stress_new 
)
overridevirtualinherited

Reimplemented from ConstitutiveModel.

Definition at line 53 of file ReturnMappingModel.C.

58 {
59  // Given the stretching, compute the stress increment and add it to the old stress. Also update
60  // the creep strain
61  // stress = stressOld + stressIncrement
62  if (_t_step == 0 && !_app.isRestarting())
63  {
65  (*_matl_timestep_limit)[_qp] = std::numeric_limits<Real>::max();
66  return;
67  }
68 
69  stress_new = elasticityTensor * strain_increment;
70  stress_new += stress_old;
71 
72  SymmTensor inelastic_strain_increment;
73  computeStress(current_elem,
74  elasticityTensor,
75  stress_old,
76  strain_increment,
77  stress_new,
78  inelastic_strain_increment);
79 }
const bool _compute_matl_timestep_limit
virtual void computeStress(const Elem &current_elem, const SymmElasticityTensor &elasticityTensor, const SymmTensor &stress_old, SymmTensor &strain_increment, SymmTensor &stress_new) override

◆ computeStress() [2/2]

void ReturnMappingModel::computeStress ( const Elem &  current_elem,
const SymmElasticityTensor elasticityTensor,
const SymmTensor stress_old,
SymmTensor strain_increment,
SymmTensor stress_new,
SymmTensor inelastic_strain_increment 
)
inherited

Compute stress by performing return mapping iterations.

This can be called either from within this model, or by an external model that combines multiple inelastic models.

Parameters
current_elemCurrent element
elasticityTensorElasticity tensor
stress_oldOld state of stress
strain_incrementStrain increment
stress_newNew state of stress
inelastic_strain_incrementInelastic strain increment

Definition at line 82 of file ReturnMappingModel.C.

88 {
89  // compute deviatoric trial stress
90  SymmTensor dev_trial_stress(stress_new);
91  dev_trial_stress.addDiag(-dev_trial_stress.trace() / 3.0);
92 
93  // compute effective trial stress
94  Real dts_squared = dev_trial_stress.doubleContraction(dev_trial_stress);
95  Real effective_trial_stress = std::sqrt(1.5 * dts_squared);
96 
97  // compute effective strain increment
98  SymmTensor dev_strain_increment(strain_increment);
99  dev_strain_increment.addDiag(-strain_increment.trace() / 3.0);
100  _effective_strain_increment = dev_strain_increment.doubleContraction(dev_strain_increment);
102 
103  const SymmIsotropicElasticityTensor * iso_e_t =
104  dynamic_cast<const SymmIsotropicElasticityTensor *>(&elasticityTensor);
105  if (!iso_e_t)
106  mooseError("Models derived from ReturnMappingModel require a SymmIsotropicElasticityTensor");
107  _three_shear_modulus = 3.0 * iso_e_t->shearModulus();
108 
109  computeStressInitialize(effective_trial_stress, elasticityTensor);
110 
111  Real scalar;
112  returnMappingSolve(effective_trial_stress, scalar, _console);
113 
114  // compute inelastic and elastic strain increments
115  if (scalar != 0.0)
116  inelastic_strain_increment = dev_trial_stress * (1.5 * scalar / effective_trial_stress);
117  else
118  inelastic_strain_increment = 0.0;
119 
120  strain_increment -= inelastic_strain_increment;
122 
123  // compute stress increment
124  stress_new = elasticityTensor * strain_increment;
125 
126  // update stress
127  stress_new += stress_old;
128 
129  computeStressFinalize(inelastic_strain_increment);
131  (*_matl_timestep_limit)[_qp] = computeTimeStepLimit();
132 }
const bool _compute_matl_timestep_limit
MaterialProperty< Real > & _effective_inelastic_strain
Real shearModulus() const
Return the shear modulus...
Real _three_shear_modulus
3 * shear modulus
void returnMappingSolve(const Real effective_trial_stress, Real &scalar, const ConsoleStream &console)
Perform the return mapping iterations.
virtual void computeStressInitialize(Real, const SymmElasticityTensor &)
Perform any necessary initialization before return mapping iterations.
const MaterialProperty< Real > & _effective_inelastic_strain_old
Real trace() const
Definition: SymmTensor.h:98
virtual void computeStressFinalize(const SymmTensor &)
Perform any necessary steps to finalize state after return mapping iterations.
Real computeTimeStepLimit()
Compute the limiting value of the time step for this material.
Defines an Isotropic Elasticity Tensor.

◆ computeStressFinalize()

void IsotropicPlasticity::computeStressFinalize ( const SymmTensor )
overrideprotectedvirtual

Perform any necessary steps to finalize state after return mapping iterations.

Parameters
inelasticStrainIncrementInelastic strain increment

Reimplemented from ReturnMappingModel.

Definition at line 92 of file IsotropicPlasticity.C.

93 {
94  _plastic_strain[_qp] += plasticStrainIncrement;
95 }
MaterialProperty< SymmTensor > & _plastic_strain

◆ computeStressInitialize()

void IsotropicPlasticity::computeStressInitialize ( Real  ,
const SymmElasticityTensor  
)
overrideprotectedvirtual

Perform any necessary initialization before return mapping iterations.

Parameters
effectiveTrialStressEffective trial stress
elasticityTensorElasticity tensor

Reimplemented from ReturnMappingModel.

Reimplemented in IsotropicPowerLawHardening, and IsotropicTempDepHardening.

Definition at line 76 of file IsotropicPlasticity.C.

78 {
80  dynamic_cast<const SymmIsotropicElasticityTensor *>(&elasticityTensor);
81  if (!eT)
82  mooseError("IsotropicPlasticity requires a SymmIsotropicElasticityTensor");
83 
86  _yield_condition = effectiveTrialStress - _hardening_variable_old[_qp] - _yield_stress;
89 }
MaterialProperty< SymmTensor > & _plastic_strain
MaterialProperty< Real > & _hardening_variable
Real shearModulus() const
Return the shear modulus...
const MaterialProperty< Real > & _hardening_variable_old
virtual void computeYieldStress()
const MaterialProperty< SymmTensor > & _plastic_strain_old
Defines an Isotropic Elasticity Tensor.

◆ computeTimeStepLimit()

Real ReturnMappingModel::computeTimeStepLimit ( )
inherited

Compute the limiting value of the time step for this material.

Returns
Limiting time step

Definition at line 141 of file ReturnMappingModel.C.

Referenced by ReturnMappingModel::computeStress().

142 {
143  Real scalar_inelastic_strain_incr;
144 
145  scalar_inelastic_strain_incr =
147  if (MooseUtils::absoluteFuzzyEqual(scalar_inelastic_strain_incr, 0.0))
148  return std::numeric_limits<Real>::max();
149 
150  return _dt * _max_inelastic_increment / scalar_inelastic_strain_incr;
151 }
MaterialProperty< Real > & _effective_inelastic_strain
const MaterialProperty< Real > & _effective_inelastic_strain_old

◆ computeYieldStress()

void IsotropicPlasticity::computeYieldStress ( )
protectedvirtual

Reimplemented in IsotropicPowerLawHardening, and IsotropicTempDepHardening.

Definition at line 162 of file IsotropicPlasticity.C.

Referenced by computeStressInitialize().

163 {
165  {
166  Point p;
168  if (_yield_stress <= 0)
169  mooseError("Yield stress must be greater than zero");
170  }
171 }
const VariableValue & _temperature
Function * _yield_stress_function

◆ initialGuess()

virtual Real SingleVariableReturnMappingSolution::initialGuess ( const Real  )
inlineprotectedvirtualinherited

Compute an initial guess for the value of the scalar.

For some cases, an intellegent starting point can provide enhanced robustness in the Newton iterations. This is also an opportunity for classes that derive from this to perform initialization tasks.

Parameters
effective_trial_stressEffective trial stress

Definition at line 63 of file SingleVariableReturnMappingSolution.h.

Referenced by SingleVariableReturnMappingSolution::internalSolve().

63 { return 0.0; }

◆ initQpStatefulProperties()

void IsotropicPlasticity::initQpStatefulProperties ( )
overridevirtual

Reimplemented from ReturnMappingModel.

Definition at line 69 of file IsotropicPlasticity.C.

70 {
71  _hardening_variable[_qp] = 0;
73 }
MaterialProperty< Real > & _hardening_variable
virtual void initQpStatefulProperties() override

◆ iterationFinalize()

void IsotropicPlasticity::iterationFinalize ( Real  )
overrideprotectedvirtual

Finalize internal state variables for a model for a given iteration.

Parameters
scalarInelastic strain increment magnitude being solved for

Reimplemented from SingleVariableReturnMappingSolution.

Definition at line 128 of file IsotropicPlasticity.C.

129 {
130  if (_yield_condition > 0)
132 }
MaterialProperty< Real > & _hardening_variable
virtual Real computeHardeningValue(Real scalar)

◆ maximumPermissibleValue()

Real SingleVariableReturnMappingSolution::maximumPermissibleValue ( const Real  effective_trial_stress) const
protectedvirtualinherited

Compute the maximum permissible value of the scalar.

For some models, the magnitude of this may be known.

Parameters
effective_trial_stressEffective trial stress

Reimplemented in RadialReturnStressUpdate.

Definition at line 84 of file SingleVariableReturnMappingSolution.C.

Referenced by SingleVariableReturnMappingSolution::internalSolve().

86 {
87  return std::numeric_limits<Real>::max();
88 }

◆ minimumPermissibleValue()

virtual Real ReturnMappingModel::minimumPermissibleValue ( const Real  effective_trial_stress) const
inlineoverridevirtualinherited

Compute the minimum permissible value of the scalar.

For some models, the magnitude of this may be known.

Parameters
effective_trial_stressEffective trial stress

Reimplemented from SingleVariableReturnMappingSolution.

Definition at line 68 of file ReturnMappingModel.h.

69  {
70  return 0.0;
71  }

◆ modifyStrainIncrement()

virtual bool ConstitutiveModel::modifyStrainIncrement ( const Elem &  ,
SymmTensor strain_increment,
SymmTensor d_strain_dT 
)
inlinevirtualinherited

Reimplemented in CombinedCreepPlasticity.

Definition at line 39 of file ConstitutiveModel.h.

42  {
43  return applyThermalStrain(strain_increment, d_strain_dT);
44  }
virtual bool applyThermalStrain(SymmTensor &strain_increment, SymmTensor &d_strain_dT)

◆ outputIterationStep()

void SingleVariableReturnMappingSolution::outputIterationStep ( std::stringstream *  iter_output,
const unsigned int  it,
const Real  effective_trial_stress,
const Real  scalar,
const Real  residual,
const Real  reference_residual 
)
protectedvirtualinherited

Output information for a single iteration step to build the convergence history of the model.

Parameters
iter_outputOutput stream
itCurrent iteration count
effective_trial_stressEffective trial stress
scalarInelastic strain increment magnitude being solved for
residualCurrent value of the residual
referenceCurrent value of the reference quantity

Definition at line 327 of file SingleVariableReturnMappingSolution.C.

Referenced by SingleVariableReturnMappingSolution::internalSolve().

333 {
334  if (iter_output)
335  {
336  *iter_output << " iteration=" << it << " trial_stress=" << effective_trial_stress
337  << " scalar=" << scalar << " residual=" << residual
338  << " ref_res=" << reference_residual
339  << " rel_res=" << std::abs(residual) / reference_residual
340  << " rel_tol=" << _relative_tolerance << " abs_res=" << std::abs(residual)
341  << " abs_tol=" << _absolute_tolerance << '\n';
342  }
343 }
Real _relative_tolerance
Relative convergence tolerance.
Real _absolute_tolerance
Absolute convergence tolerance.

◆ outputIterationSummary()

void ReturnMappingModel::outputIterationSummary ( std::stringstream *  iter_output,
const unsigned int  total_it 
)
overridevirtualinherited

Output summary information for the convergence history of the model.

Parameters
iter_outputOutput stream
total_itTotal iteration count

Reimplemented from SingleVariableReturnMappingSolution.

Definition at line 154 of file ReturnMappingModel.C.

156 {
157  if (iter_output)
158  {
159  *iter_output << "At element " << _current_elem->id() << " _qp=" << _qp << " Coordinates "
160  << _q_point[_qp] << " block=" << _current_elem->subdomain_id() << '\n';
161  }
163 }
virtual void outputIterationSummary(std::stringstream *iter_output, const unsigned int total_it)
Output summary information for the convergence history of the model.

◆ returnMappingSolve()

void SingleVariableReturnMappingSolution::returnMappingSolve ( const Real  effective_trial_stress,
Real &  scalar,
const ConsoleStream &  console 
)
protectedinherited

Perform the return mapping iterations.

Parameters
effective_trial_stressEffective trial stress
scalarInelastic strain increment magnitude being solved for
consoleConsole output

Definition at line 91 of file SingleVariableReturnMappingSolution.C.

Referenced by ReturnMappingModel::computeStress(), and RadialReturnStressUpdate::updateState().

94 {
95  // construct the stringstream here only if the debug level is set to ALL
96  std::stringstream * iter_output =
97  (_internal_solve_output_on == InternalSolveOutput::ALWAYS) ? new std::stringstream : nullptr;
98 
99  // do the internal solve and capture iteration info during the first round
100  // iff full history output is requested regardless of whether the solve failed or succeeded
101  auto solve_state = internalSolve(effective_trial_stress,
102  scalar,
103  _internal_solve_full_iteration_history ? iter_output : nullptr);
104  if (solve_state != SolveState::SUCCESS &&
106  {
107  // output suppressed by user, throw immediately
109  throw MooseException("");
110 
111  // user expects some kind of output, if necessary setup output stream now
112  if (!iter_output)
113  iter_output = new std::stringstream;
114 
115  // add the appropriate error message to the output
116  switch (solve_state)
117  {
118  case SolveState::NAN_INF:
119  *iter_output << "Encountered inf or nan in material return mapping iterations.\n";
120  break;
121 
123  *iter_output << "Exceeded maximum iterations in material return mapping iterations.\n";
124  break;
125 
126  default:
127  mooseError("Unhandled solver state");
128  }
129 
130  // if full history output is only requested for failed solves we have to repeat
131  // the solve a second time
133  internalSolve(effective_trial_stress, scalar, iter_output);
134 
135  // Append summary and throw exception
136  outputIterationSummary(iter_output, _iteration);
137  throw MooseException(iter_output->str());
138  }
139 
141  {
142  // the solve did not fail but the user requested debug output anyways
143  outputIterationSummary(iter_output, _iteration);
144  console << iter_output->str();
145  }
146 }
virtual void outputIterationSummary(std::stringstream *iter_output, const unsigned int total_it)
Output summary information for the convergence history of the model.
enum SingleVariableReturnMappingSolution::InternalSolveOutput _internal_solve_output_on
SolveState internalSolve(const Real effective_trial_stress, Real &scalar, std::stringstream *iter_output=nullptr)
Method called from within this class to perform the actual return mappping iterations.
const bool _internal_solve_full_iteration_history
Whether to output iteration information all the time (regardless of whether iterations converge) ...

◆ setQp()

void ConstitutiveModel::setQp ( unsigned int  qp)
inherited

Sets the value of the variable _qp for inheriting classes.

Definition at line 89 of file ConstitutiveModel.C.

Referenced by CombinedCreepPlasticity::computeStress().

90 {
91  _qp = qp;
92 }

◆ updateElasticityTensor()

virtual bool ConstitutiveModel::updateElasticityTensor ( SymmElasticityTensor )
inlinevirtualinherited

Definition at line 45 of file ConstitutiveModel.h.

45 { return false; }

Member Data Documentation

◆ _alpha

const Real ConstitutiveModel::_alpha
protectedinherited

Definition at line 53 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

◆ _alpha_function

Function* ConstitutiveModel::_alpha_function
protectedinherited

◆ _bracket_solution

bool SingleVariableReturnMappingSolution::_bracket_solution
protectedinherited

Whether to save upper and lower bounds of root for scalar, and set solution to the midpoint between those bounds if outside them.

Definition at line 126 of file SingleVariableReturnMappingSolution.h.

Referenced by SingleVariableReturnMappingSolution::internalSolve().

◆ _check_range

bool SingleVariableReturnMappingSolution::_check_range
protectedinherited

Whether to check to see whether iterative solution is within admissible range, and set within that range if outside.

Definition at line 119 of file SingleVariableReturnMappingSolution.h.

Referenced by SingleVariableReturnMappingSolution::internalSolve().

◆ _compute_matl_timestep_limit

const bool ReturnMappingModel::_compute_matl_timestep_limit
protectedinherited

Definition at line 101 of file ReturnMappingModel.h.

Referenced by ReturnMappingModel::computeStress().

◆ _effective_inelastic_strain

MaterialProperty<Real>& ReturnMappingModel::_effective_inelastic_strain
protectedinherited

◆ _effective_inelastic_strain_old

const MaterialProperty<Real>& ReturnMappingModel::_effective_inelastic_strain_old
protectedinherited

◆ _effective_strain_increment

Real ReturnMappingModel::_effective_strain_increment
protectedinherited

Definition at line 93 of file ReturnMappingModel.h.

Referenced by ReturnMappingModel::computeStress().

◆ _hardening_constant

const Real IsotropicPlasticity::_hardening_constant
protected

Definition at line 44 of file IsotropicPlasticity.h.

Referenced by computeHardeningDerivative().

◆ _hardening_function

PiecewiseLinear* const IsotropicPlasticity::_hardening_function
protected

◆ _hardening_slope

Real IsotropicPlasticity::_hardening_slope
protected

Definition at line 49 of file IsotropicPlasticity.h.

Referenced by computeDerivative(), computeHardeningValue(), and computeResidual().

◆ _hardening_variable

MaterialProperty<Real>& IsotropicPlasticity::_hardening_variable
protected

◆ _hardening_variable_old

const MaterialProperty<Real>& IsotropicPlasticity::_hardening_variable_old
protected

◆ _has_stress_free_temp

bool ConstitutiveModel::_has_stress_free_temp
protectedinherited

Definition at line 55 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

◆ _has_temp

const bool ConstitutiveModel::_has_temp
protectedinherited

◆ _line_search

bool SingleVariableReturnMappingSolution::_line_search
protectedinherited

Whether to use line searches to improve convergence.

Definition at line 122 of file SingleVariableReturnMappingSolution.h.

Referenced by SingleVariableReturnMappingSolution::internalSolve().

◆ _matl_timestep_limit

MaterialProperty<Real>* ReturnMappingModel::_matl_timestep_limit
protectedinherited

Definition at line 102 of file ReturnMappingModel.h.

◆ _max_inelastic_increment

Real ReturnMappingModel::_max_inelastic_increment
protectedinherited

Definition at line 100 of file ReturnMappingModel.h.

Referenced by ReturnMappingModel::computeTimeStepLimit().

◆ _mean_alpha_function

bool ConstitutiveModel::_mean_alpha_function
protectedinherited

◆ _plastic_strain

MaterialProperty<SymmTensor>& IsotropicPlasticity::_plastic_strain
protected

◆ _plastic_strain_old

const MaterialProperty<SymmTensor>& IsotropicPlasticity::_plastic_strain_old
protected

◆ _ref_temp

Real ConstitutiveModel::_ref_temp
protectedinherited

◆ _shear_modulus

Real IsotropicPlasticity::_shear_modulus
protected

◆ _step_one_cm

bool& ConstitutiveModel::_step_one_cm
protectedinherited

Definition at line 62 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

◆ _step_zero_cm

bool& ConstitutiveModel::_step_zero_cm
protectedinherited

Restartable data to check for the zeroth and first time steps.

Definition at line 61 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

◆ _stress_free_temp

Real ConstitutiveModel::_stress_free_temp
protectedinherited

Definition at line 56 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

◆ _temperature

const VariableValue& ConstitutiveModel::_temperature
protectedinherited

◆ _temperature_old

const VariableValue& ConstitutiveModel::_temperature_old
protectedinherited

Definition at line 52 of file ConstitutiveModel.h.

Referenced by ConstitutiveModel::applyThermalStrain().

◆ _three_shear_modulus

Real ReturnMappingModel::_three_shear_modulus
protectedinherited

3 * shear modulus

Definition at line 96 of file ReturnMappingModel.h.

Referenced by ReturnMappingModel::computeReferenceResidual(), and ReturnMappingModel::computeStress().

◆ _yield_condition

Real IsotropicPlasticity::_yield_condition
protected

◆ _yield_stress

Real IsotropicPlasticity::_yield_stress
protected

◆ _yield_stress_function

Function* IsotropicPlasticity::_yield_stress_function
protected

Definition at line 42 of file IsotropicPlasticity.h.

Referenced by computeYieldStress(), and IsotropicPlasticity().


The documentation for this class was generated from the following files: