Base class that provides capability for Newton return mapping iterations on a single variable. More...
#include <SingleVariableReturnMappingSolution.h>
Public Member Functions | |
SingleVariableReturnMappingSolutionTempl (const InputParameters ¶meters) | |
virtual | ~SingleVariableReturnMappingSolutionTempl () |
Static Public Member Functions | |
static InputParameters | validParams () |
Protected Member Functions | |
void | returnMappingSolve (const GenericReal< is_ad > &effective_trial_stress, GenericReal< is_ad > &scalar, const ConsoleStream &console) |
Perform the return mapping iterations. More... | |
virtual GenericReal< is_ad > | minimumPermissibleValue (const GenericReal< is_ad > &effective_trial_stress) const |
Compute the minimum permissible value of the scalar. More... | |
virtual GenericReal< is_ad > | maximumPermissibleValue (const GenericReal< is_ad > &effective_trial_stress) const |
Compute the maximum permissible value of the scalar. More... | |
virtual GenericReal< is_ad > | initialGuess (const GenericReal< is_ad > &) |
Compute an initial guess for the value of the scalar. More... | |
virtual GenericReal< is_ad > | computeResidual (const GenericReal< is_ad > &, const GenericReal< is_ad > &)=0 |
Compute the residual for a predicted value of the scalar. More... | |
virtual GenericReal< is_ad > | computeDerivative (const GenericReal< is_ad > &, const GenericReal< is_ad > &)=0 |
Compute the derivative of the residual as a function of the scalar variable. More... | |
virtual GenericChainedReal< is_ad > | computeResidualAndDerivative (const GenericReal< is_ad > &, const GenericChainedReal< is_ad > &) |
Compute the residual and the derivative for a predicted value of the scalar. More... | |
virtual Real | computeReferenceResidual (const GenericReal< is_ad > &effective_trial_stress, const GenericReal< is_ad > &scalar)=0 |
Compute a reference quantity to be used for checking relative convergence. More... | |
virtual void | preStep (const GenericReal< is_ad > &, const GenericReal< is_ad > &, const GenericReal< is_ad > &) |
This method is called before taking a step in the return mapping algorithm. More... | |
virtual void | iterationFinalize (const GenericReal< is_ad > &) |
Finalize internal state variables for a model for a given iteration. More... | |
virtual void | outputIterationSummary (std::stringstream *iter_output, const unsigned int total_it) |
Output summary information for the convergence history of the model. More... | |
virtual void | outputIterationStep (std::stringstream *iter_output, const GenericReal< is_ad > &effective_trial_stress, const GenericReal< is_ad > &scalar, const Real reference_residual) |
Output information for a single iteration step to build the convergence history of the model. More... | |
bool | converged (const GenericReal< is_ad > &residual, const Real reference) |
Check to see whether the residual is within the convergence limits. More... | |
Protected Attributes | |
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... | |
Private Member Functions | |
void | computeResidualAndDerivativeHelper (const GenericReal< is_ad > &effective_trial_stress, const GenericReal< is_ad > &scalar) |
Helper function to compute and set the _residual and _derivative. More... | |
SolveState | internalSolve (const GenericReal< is_ad > effective_trial_stress, GenericReal< is_ad > &scalar, std::stringstream *iter_output=nullptr) |
Method called from within this class to perform the actual return mappping iterations. More... | |
bool | convergedAcceptable (const unsigned int it, const Real reference) |
Check to see whether the residual is within acceptable convergence limits. More... | |
void | checkPermissibleRange (GenericReal< is_ad > &scalar, GenericReal< is_ad > &scalar_increment, const GenericReal< is_ad > &scalar_old, const GenericReal< is_ad > min_permissible_scalar, const GenericReal< is_ad > max_permissible_scalar, std::stringstream *iter_output) |
Check to see whether solution is within admissible range, and set it within that range if it is not. More... | |
void | updateBounds (const GenericReal< is_ad > &scalar, const GenericReal< is_ad > &residual, const Real init_resid_sign, GenericReal< is_ad > &scalar_upper_bound, GenericReal< is_ad > &scalar_lower_bound, std::stringstream *iter_output) |
Update the upper and lower bounds of the root for the effective inelastic strain. More... | |
Private Attributes | |
enum SingleVariableReturnMappingSolutionTempl::InternalSolveOutput | _internal_solve_output_on |
const unsigned int | _max_its |
Maximum number of return mapping iterations. More... | |
const bool | _internal_solve_full_iteration_history |
Whether to output iteration information all the time (regardless of whether iterations converge) More... | |
Real | _relative_tolerance |
Relative convergence tolerance. More... | |
Real | _absolute_tolerance |
Absolute convergence tolerance. More... | |
Real | _acceptable_multiplier |
Multiplier applied to relative and absolute tolerances for acceptable convergence. More... | |
const bool | _ad_derivative |
const std::size_t | _num_resids |
Number of residuals to be stored in history. More... | |
std::vector< Real > | _residual_history |
History of residuals used to check whether progress is still being made on decreasing the residual. More... | |
unsigned int | _iteration |
iteration number More... | |
GenericReal< is_ad > | _derivative |
Derivative of the residual. More... | |
const std::string | _svrms_name |
MOOSE input name of the object performing the solve. More... | |
GenericReal< is_ad > | _initial_residual |
Residual values, kept as members to retain solver state for summary outputting. More... | |
GenericReal< is_ad > | _residual |
Base class that provides capability for Newton return mapping iterations on a single variable.
Definition at line 24 of file SingleVariableReturnMappingSolution.h.
|
strongprivate |
Enumerator | |
---|---|
NEVER | |
ON_ERROR | |
ALWAYS |
Definition at line 172 of file SingleVariableReturnMappingSolution.h.
|
strongprivate |
Enumerator | |
---|---|
SUCCESS | |
NAN_INF | |
EXCEEDED_ITERATIONS |
Definition at line 179 of file SingleVariableReturnMappingSolution.h.
SingleVariableReturnMappingSolutionTempl< is_ad >::SingleVariableReturnMappingSolutionTempl | ( | const InputParameters & | parameters | ) |
Definition at line 59 of file SingleVariableReturnMappingSolution.C.
|
inlinevirtual |
Definition at line 30 of file SingleVariableReturnMappingSolution.h.
|
private |
Check to see whether solution is within admissible range, and set it within that range if it is not.
scalar | Current value of the inelastic strain increment |
scalar_increment | Incremental change in scalar from the previous iteration |
scalar_old | Previous value of scalar |
min_permissible_scalar | Minimum permissible value of scalar |
max_permissible_scalar | Maximum permissible value of scalar |
iter_output | Output stream |
Definition at line 359 of file SingleVariableReturnMappingSolution.C.
|
protectedpure virtual |
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.
effective_trial_stress | Effective trial stress |
scalar | Inelastic strain increment magnitude being solved for |
Implemented in LAROMANCEStressUpdateBaseTempl< is_ad >, CompositePowerLawCreepStressUpdateTempl< is_ad >, IsotropicPlasticityStressUpdateTempl< is_ad >, PowerLawCreepStressUpdateTempl< is_ad >, PowerLawCreepTestTempl< is_ad >, and CombinedNonlinearHardeningPlasticityTempl< is_ad >.
|
protectedpure virtual |
Compute a reference quantity to be used for checking relative convergence.
This should be in strain increment units for all models for consistency.
effective_trial_stress | Effective trial stress |
scalar | Inelastic strain increment magnitude being solved for |
Implemented in RadialReturnStressUpdateTempl< is_ad >.
|
protectedpure virtual |
Compute the residual for a predicted value of the scalar.
This residual should be in strain increment units for all models for consistency.
effective_trial_stress | Effective trial stress |
scalar | Inelastic strain increment magnitude being solved for |
Implemented in LAROMANCEStressUpdateBaseTempl< is_ad >, IsotropicPlasticityStressUpdateTempl< is_ad >, CompositePowerLawCreepStressUpdateTempl< is_ad >, PowerLawCreepStressUpdateTempl< is_ad >, PowerLawCreepTestTempl< is_ad >, and CombinedNonlinearHardeningPlasticityTempl< is_ad >.
|
inlineprotectedvirtual |
Compute the residual and the derivative for a predicted value of the scalar.
This residual should be in strain increment units for all models for consistency.
effective_trial_stress | Effective trial stress |
scalar | Inelastic strain increment magnitude being solved for |
Reimplemented in CompositePowerLawCreepStressUpdateTempl< is_ad >, and PowerLawCreepStressUpdateTempl< is_ad >.
Definition at line 97 of file SingleVariableReturnMappingSolution.h.
|
private |
Helper function to compute and set the _residual and _derivative.
Definition at line 307 of file SingleVariableReturnMappingSolution.C.
|
protected |
Check to see whether the residual is within the convergence limits.
residual | Current value of the residual |
reference | Current value of the reference quantity |
Definition at line 326 of file SingleVariableReturnMappingSolution.C.
|
private |
Check to see whether the residual is within acceptable convergence limits.
This will only return true if it has been determined that progress is no longer being made and that the residual is within the acceptable limits.
residual | Current iteration count |
residual | Current value of the residual |
reference | Current value of the reference quantity |
Definition at line 336 of file SingleVariableReturnMappingSolution.C.
|
inlineprotectedvirtual |
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.
effective_trial_stress | Effective trial stress |
Reimplemented in PowerLawCreepTestTempl< is_ad >.
Definition at line 66 of file SingleVariableReturnMappingSolution.h.
|
private |
Method called from within this class to perform the actual return mappping iterations.
effective_trial_stress | Effective trial stress |
scalar | Inelastic strain increment magnitude being solved for |
iter_output | Output stream – if null, no output is produced |
Definition at line 163 of file SingleVariableReturnMappingSolution.C.
|
inlineprotectedvirtual |
Finalize internal state variables for a model for a given iteration.
scalar | Inelastic strain increment magnitude being solved for |
Reimplemented in IsotropicPlasticityStressUpdateTempl< is_ad >, and CombinedNonlinearHardeningPlasticityTempl< is_ad >.
Definition at line 128 of file SingleVariableReturnMappingSolution.h.
|
protectedvirtual |
Compute the maximum permissible value of the scalar.
For some models, the magnitude of this may be known.
effective_trial_stress | Effective trial stress |
Reimplemented in RadialReturnStressUpdateTempl< is_ad >, LAROMANCEStressUpdateBaseTempl< is_ad >, and PowerLawCreepTestTempl< is_ad >.
Definition at line 92 of file SingleVariableReturnMappingSolution.C.
|
protectedvirtual |
Compute the minimum permissible value of the scalar.
For some models, the magnitude of this may be known.
effective_trial_stress | Effective trial stress |
Reimplemented in RadialReturnStressUpdateTempl< is_ad >, and PowerLawCreepTestTempl< is_ad >.
Definition at line 84 of file SingleVariableReturnMappingSolution.C.
|
protectedvirtual |
Output information for a single iteration step to build the convergence history of the model.
iter_output | Output stream |
effective_trial_stress | Effective trial stress |
residual | Current value of the residual |
reference | Current value of the reference quantity |
Reimplemented in LAROMANCEStressUpdateBaseTempl< is_ad >.
Definition at line 419 of file SingleVariableReturnMappingSolution.C.
Referenced by LAROMANCEStressUpdateBaseTempl< is_ad >::outputIterationStep().
|
protectedvirtual |
Output summary information for the convergence history of the model.
iter_output | Output stream |
total_it | Total iteration count |
Reimplemented in RadialReturnStressUpdateTempl< is_ad >, LAROMANCEStressUpdateBaseTempl< is_ad >, and ADViscoplasticityStressUpdate.
Definition at line 442 of file SingleVariableReturnMappingSolution.C.
Referenced by ADViscoplasticityStressUpdate::outputIterationSummary(), LAROMANCEStressUpdateBaseTempl< is_ad >::outputIterationSummary(), and RadialReturnStressUpdateTempl< is_ad >::outputIterationSummary().
|
inlineprotectedvirtual |
This method is called before taking a step in the return mapping algorithm.
A typical use case is to accumulate the exact algorithmic tangent during return mapping.
Definition at line 118 of file SingleVariableReturnMappingSolution.h.
|
protected |
Perform the return mapping iterations.
effective_trial_stress | Effective trial stress |
scalar | Inelastic strain increment magnitude being solved for |
console | Console output |
Definition at line 100 of file SingleVariableReturnMappingSolution.C.
Referenced by ADViscoplasticityStressUpdate::computeInelasticStrainIncrement(), and ComputeSimoHughesJ2PlasticityStress::computeQpPK1Stress().
|
private |
Update the upper and lower bounds of the root for the effective inelastic strain.
scalar | Current value of the inelastic strain increment |
residual | Current value of the residual |
init_resid_sign | Sign of the initial value of the residual |
scalar_upper_bound | Upper bound value of scalar |
scalar_lower_bound | Lower bound value of scalar |
iter_output | Output stream |
Definition at line 390 of file SingleVariableReturnMappingSolution.C.
|
static |
Definition at line 26 of file SingleVariableReturnMappingSolution.C.
Referenced by ADViscoplasticityStressUpdate::validParams(), ComputeSimoHughesJ2PlasticityStress::validParams(), and RadialReturnStressUpdateTempl< is_ad >::validParams().
|
private |
Absolute convergence tolerance.
Definition at line 197 of file SingleVariableReturnMappingSolution.h.
|
private |
Multiplier applied to relative and absolute tolerances for acceptable convergence.
Definition at line 200 of file SingleVariableReturnMappingSolution.h.
|
private |
Definition at line 205 of file SingleVariableReturnMappingSolution.h.
|
protected |
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 145 of file SingleVariableReturnMappingSolution.h.
|
protected |
Whether to check to see whether iterative solution is within admissible range, and set within that range if outside.
Definition at line 138 of file SingleVariableReturnMappingSolution.h.
Referenced by ADViscoplasticityStressUpdate::ADViscoplasticityStressUpdate(), LAROMANCEStressUpdateBaseTempl< is_ad >::LAROMANCEStressUpdateBaseTempl(), and PowerLawCreepTestTempl< is_ad >::PowerLawCreepTestTempl().
|
private |
Derivative of the residual.
Definition at line 222 of file SingleVariableReturnMappingSolution.h.
|
private |
Residual values, kept as members to retain solver state for summary outputting.
Definition at line 217 of file SingleVariableReturnMappingSolution.h.
|
private |
Whether to output iteration information all the time (regardless of whether iterations converge)
Definition at line 191 of file SingleVariableReturnMappingSolution.h.
|
private |
|
private |
iteration number
Definition at line 214 of file SingleVariableReturnMappingSolution.h.
|
protected |
Whether to use line searches to improve convergence.
Definition at line 141 of file SingleVariableReturnMappingSolution.h.
|
private |
Maximum number of return mapping iterations.
This exists only to avoid an infinite loop, and is is intended to be a large number that is not settable by the user.
Definition at line 188 of file SingleVariableReturnMappingSolution.h.
|
private |
Number of residuals to be stored in history.
Definition at line 208 of file SingleVariableReturnMappingSolution.h.
|
private |
Relative convergence tolerance.
Definition at line 194 of file SingleVariableReturnMappingSolution.h.
|
private |
Definition at line 218 of file SingleVariableReturnMappingSolution.h.
|
private |
History of residuals used to check whether progress is still being made on decreasing the residual.
Definition at line 211 of file SingleVariableReturnMappingSolution.h.
|
private |
MOOSE input name of the object performing the solve.
Definition at line 225 of file SingleVariableReturnMappingSolution.h.