Go to the documentation of this file.
12 #include "MooseTypes.h"
13 #include "InputParameters.h"
15 #define usingSingleVariableReturnMappingSolutionMembers \
16 using ADSingleVariableReturnMappingSolution<compute_stage>::returnMappingSolve; \
17 using ADSingleVariableReturnMappingSolution<compute_stage>::minimumPermissibleValue; \
18 using ADSingleVariableReturnMappingSolution<compute_stage>::maximumPermissibleValue; \
19 using ADSingleVariableReturnMappingSolution<compute_stage>::initialGuess; \
20 using ADSingleVariableReturnMappingSolution<compute_stage>::computeResidual; \
21 using ADSingleVariableReturnMappingSolution<compute_stage>::computeDerivative; \
22 using ADSingleVariableReturnMappingSolution<compute_stage>::computeReferenceResidual; \
23 using ADSingleVariableReturnMappingSolution<compute_stage>::iterationFinalize; \
24 using ADSingleVariableReturnMappingSolution<compute_stage>::outputIterationSummary; \
25 using ADSingleVariableReturnMappingSolution<compute_stage>::_check_range; \
26 using ADSingleVariableReturnMappingSolution<compute_stage>::_line_search; \
27 using ADSingleVariableReturnMappingSolution<compute_stage>::_bracket_solution; \
28 using ADSingleVariableReturnMappingSolution<compute_stage>::converged
31 template <ComputeStage>
41 template <ComputeStage compute_stage>
59 const ConsoleStream & console);
90 virtual ADReal
computeResidual(
const ADReal & effective_trial_stress,
const ADReal & scalar) = 0;
99 const ADReal & scalar) = 0;
108 const ADReal & scalar) = 0;
143 const ADReal & effective_trial_stress,
144 const ADReal & scalar,
145 const Real reference_residual);
153 bool converged(
const ADReal & residual,
const Real reference);
212 std::stringstream * iter_output =
nullptr);
236 ADReal & scalar_increment,
237 const ADReal & scalar_old,
238 const ADReal min_permissible_scalar,
239 const ADReal max_permissible_scalar,
240 std::stringstream * iter_output);
252 const ADReal & residual,
253 const Real init_resid_sign,
254 ADReal & scalar_upper_bound,
255 ADReal & scalar_lower_bound,
256 std::stringstream * iter_output);
virtual ADReal initialGuess(const ADReal &)
Compute an initial guess for the value of the scalar.
virtual ~ADSingleVariableReturnMappingSolution()
const bool _internal_solve_full_iteration_history
Whether to output iteration information all the time (regardless of whether iterations converge)
void returnMappingSolve(const ADReal &effective_trial_stress, ADReal &scalar, const ConsoleStream &console)
Perform the return mapping iterations.
bool _bracket_solution
Whether to save upper and lower bounds of root for scalar, and set solution to the midpoint between t...
virtual void outputIterationStep(std::stringstream *iter_output, const ADReal &effective_trial_stress, const ADReal &scalar, const Real reference_residual)
Output information for a single iteration step to build the convergence history of the model.
unsigned int _iteration
iteration number
ADReal _initial_residual
Residual values, kept as members to retain solver state for summary outputting.
bool convergedAcceptable(const unsigned int it, const Real reference)
Check to see whether the residual is within acceptable convergence limits.
std::vector< Real > _residual_history
History of residuals used to check whether progress is still being made on decreasing the residual.
virtual ADReal maximumPermissibleValue(const ADReal &effective_trial_stress) const
Compute the maximum permissible value of the scalar.
static InputParameters validParams()
Real _relative_tolerance
Relative convergence tolerance.
enum ADSingleVariableReturnMappingSolution::InternalSolveOutput _internal_solve_output_on
Real _acceptable_multiplier
Multiplier applied to relative and absolute tolerances for acceptable convergence.
bool converged(const ADReal &residual, const Real reference)
Check to see whether the residual is within the convergence limits.
declareADValidParams(ADSingleVariableReturnMappingSolution)
void updateBounds(const ADReal &scalar, const ADReal &residual, const Real init_resid_sign, ADReal &scalar_upper_bound, ADReal &scalar_lower_bound, std::stringstream *iter_output)
Update the upper and lower bounds of the root for the effective inelastic strain.
const unsigned int _max_its
Maximum number of return mapping iterations.
const std::string _svrms_name
MOOSE input name of the object performing the solve.
void checkPermissibleRange(ADReal &scalar, ADReal &scalar_increment, const ADReal &scalar_old, const ADReal min_permissible_scalar, const ADReal 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.
virtual void iterationFinalize(ADReal)
Finalize internal state variables for a model for a given iteration.
virtual ADReal minimumPermissibleValue(const ADReal &effective_trial_stress) const
Compute the minimum permissible value of the scalar.
bool _check_range
Whether to check to see whether iterative solution is within admissible range, and set within that ra...
ADSingleVariableReturnMappingSolution(const InputParameters ¶meters)
const std::size_t _num_resids
Number of residuals to be stored in history.
Real _absolute_tolerance
Absolute convergence tolerance.
bool _line_search
Whether to use line searches to improve convergence.
virtual ADReal computeResidual(const ADReal &effective_trial_stress, const ADReal &scalar)=0
Compute the residual for a predicted value of the scalar.
virtual void outputIterationSummary(std::stringstream *iter_output, const unsigned int total_it)
Output summary information for the convergence history of the model.
SolveState internalSolve(const ADReal effective_trial_stress, ADReal &scalar, std::stringstream *iter_output=nullptr)
Method called from within this class to perform the actual return mappping iterations.
Base class that provides capability for Newton return mapping iterations on a single variable.
virtual ADReal computeDerivative(const ADReal &effective_trial_stress, const ADReal &scalar)=0
Compute the derivative of the residual as a function of the scalar variable.
virtual Real computeReferenceResidual(const ADReal &effective_trial_stress, const ADReal &scalar)=0
Compute a reference quantity to be used for checking relative convergence.