25 "Default convergence criteria for steady-state detection in a transient simulation.");
33 _steady_state_tolerance(getSharedExecutionerParam<Real>(
"steady_state_tolerance")),
34 _check_aux(getSharedExecutionerParam<bool>(
"check_aux")),
35 _normalize_norm_by_dt(getSharedExecutionerParam<bool>(
"normalize_solution_diff_norm_by_dt")),
37 _fe_problem(*getCheckedPointerParam<
FEProblemBase *>(
"_fe_problem_base")),
38 _transient_executioner(dynamic_cast<
TransientBase * const>(getMooseApp().getExecutioner())),
39 _aux_system(_fe_problem.getAuxiliarySystem())
42 mooseError(
"DefaultSteadyStateConvergence can only be used for Executioners derived from "
52 mooseError(
"DefaultSteadyStateConvergence can only be used with steady-state detection.");
63 std::vector<Number> aux_var_diff_norms;
65 for (
auto & aux_var_diff_norm : aux_var_diff_norms)
68 norm = *std::max_element(aux_var_diff_norms.begin(), aux_var_diff_norms.end());
73 _console <<
"Steady-State Relative Differential Norm: " << norm << std::endl;
registerMooseObject("MooseApp", DefaultSteadyStateConvergence)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
void variableWiseRelativeSolutionDifferenceNorm(std::vector< Number > &var_diffs) const
Computes and stores ||current - old|| / ||current|| for each variable in the given vector.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
PerfID _perfid_check_convergence
Performance ID for checkConvergence.
MooseConvergenceStatus
Status returned by calls to checkConvergence.
virtual void checkIterationType(IterationType) const
Perform checks related to the iteration type.
Base class for default convergence criteria.
static InputParameters validParams()
Default convergence criteria for steady-state detection in a transient simulation.
TransientBase *const _transient_executioner
Transient executioner.
const bool _check_aux
Whether to use the auxiliary system solution to determine steady-state.
static InputParameters validParams()
FEProblemBase & _fe_problem
FE problem.
AuxiliarySystem & _aux_system
Aux system.
DefaultSteadyStateConvergence(const InputParameters ¶meters)
virtual MooseConvergenceStatus checkConvergence(unsigned int n_iter) override
Returns convergence status.
virtual void checkIterationType(IterationType it_type) const override
Perform checks related to the iteration type.
const Real _steady_state_tolerance
Steady-state tolerance for the solution variables or aux variables.
const bool _normalize_norm_by_dt
Whether to normalize solution norm by time step size.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual Real & dt() const
Class for containing MooseEnum item information.
Base class for transient executioners that use a FixedPointSolve solve object for multiapp-main app i...
static InputParameters defaultSteadyStateConvergenceParams()
Real computeSolutionChangeNorm(bool check_aux, bool normalize_by_dt) const
Compute the relative L2 norm of the change in the solution.