31 _min_fixed_point_its(getSharedExecutionerParam<unsigned
int>(
"fixed_point_min_its")),
32 _max_fixed_point_its(getSharedExecutionerParam<unsigned
int>(
"fixed_point_max_its")),
33 _has_fixed_point_norm(
34 !getSharedExecutionerParam<bool>(
"disable_fixed_point_residual_norm_check")),
35 _fixed_point_force_norms(getSharedExecutionerParam<bool>(
"fixed_point_force_norms")),
36 _accept_max_it(getSharedExecutionerParam<bool>(
"accept_on_max_fixed_point_iteration")),
37 _fixed_point_rel_tol(getSharedExecutionerParam<
Real>(
"fixed_point_rel_tol")),
38 _fixed_point_abs_tol(getSharedExecutionerParam<
Real>(
"fixed_point_abs_tol")),
39 _custom_pp_rel_tol(getSharedExecutionerParam<
Real>(
"custom_rel_tol")),
40 _custom_pp_abs_tol(getSharedExecutionerParam<
Real>(
"custom_abs_tol")),
41 _fixed_point_custom_pp(isParamValid(
"custom_pp") ? &getPostprocessorValue(
"custom_pp")
43 _fixed_point_custom_pp_old(isParamValid(
"custom_pp") ? &getPostprocessorValueOld(
"custom_pp")
48 _fe_problem(*getCheckedPointerParam<
FEProblemBase *>(
"_fe_problem_base")),
49 _fp_solve(getMooseApp().getExecutioner()->fixedPointSolve())
53 "The minimum number of fixed point iterations may not exceed the maximum.");
56 "disable_fixed_point_residual_norm_check",
57 "fixed_point_rel_tol will be ignored because the fixed point residual check is disabled.");
60 "disable_fixed_point_residual_norm_check",
61 "fixed_point_abs_tol will be ignored because the fixed point residual check is disabled.");
64 "fixed_point_force_norms will be ignored because the fixed point residual check " 83 "DefaultMultiAppFixedPointConvergence can only be used with MultiApp fixed point solves.");
102 _console << COLOR_MAGENTA <<
"Initial fixed point residual norm: " << COLOR_DEFAULT;
107 _console << COLOR_DEFAULT <<
"\n" << std::endl;
124 Real begin_norm_old =
216 _console << COLOR_MAGENTA <<
"Fixed point residual norm after " << execute_on_str
223 if (!getParam<bool>(
"direct_pp_value"))
226 if ((iter == 0 && getParam<bool>(
"direct_pp_value")) || !getParam<bool>(
"direct_pp_value"))
230 const auto pp_name = getParam<PostprocessorName>(
"custom_pp");
231 _pp_history << std::setw(2) << iter + 1 <<
" fixed point " << pp_name <<
" = "
const bool _fixed_point_force_norms
Whether or not we force evaluation of residual norms even without multiapps.
const auto MULTIAPP_FIXED_POINT
static InputParameters fixedPointDefaultConvergenceParams()
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
virtual void preExecute() override
Method that gets called in each iteration before the solve.
static InputParameters validParams()
Real _fixed_point_initial_norm
Initial residual norm.
Real _pp_current
Value of the custom convergence check postprocessor from current iteration.
virtual void initialize()
Method that gets called before each iteration loop.
const bool _has_fixed_point_norm
Whether or not to use residual norm to check the fixed point convergence.
Base class for default convergence criteria.
void setFixedPointStatus(MooseFixedPointConvergenceReason status)
Set fixed point status.
registerMooseObject("MooseApp", DefaultMultiAppFixedPointConvergence)
virtual void initialize() override
Method that gets called before each iteration loop.
Real _pp_scaling
Scaling of custom convergence check postprocessor (its initial value)
FEProblemBase & _fe_problem
FE Problem.
Real _pp_previous
Value of the custom convergence check postprocessor from previous iteration.
const Real _fixed_point_abs_tol
Absolute tolerance on residual norm.
FixedPointSolve & _fp_solve
Fixed point solve.
const ExecFlagType EXEC_TIMESTEP_END
const PostprocessorValue *const _fixed_point_custom_pp_old
Postprocessor value for user-defined fixed point convergence check from previous timestep.
unsigned int numFixedPointIts() const
Get the number of fixed point iterations performed Because this returns the number of fixed point ite...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
auto max(const L &left, const R &right)
FP converged according to Convergence object.
std::vector< Real > _fixed_point_timestep_end_norm
Full history of residual norm after evaluation of timestep_end.
const PostprocessorValue *const _fixed_point_custom_pp
Postprocessor value for user-defined fixed point convergence check.
virtual MooseConvergenceStatus checkConvergence(unsigned int iter) override
Returns convergence status.
const ExecFlagType EXEC_TIMESTEP_BEGIN
std::ostringstream _pp_history
Convergence history of the custom convergence check postprocessor.
unsigned int _min_fixed_point_its
Minimum fixed point iterations.
void computeCustomConvergencePostprocessor(unsigned int iter)
Computes and prints the user-specified postprocessor assessing convergence.
FP converged by absolute residual tolerance.
virtual void checkIterationType(IterationType) const
Perform checks related to the iteration type.
virtual void checkIterationType(IterationType it_type) const override
Perform checks related to the iteration type.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
FP converged by relative residual tolerance.
MooseConvergenceStatus
Status returned by calls to checkConvergence.
const bool _accept_max_it
Whether or not to treat reaching maximum number of fixed point iteration as converged.
PerfID _perfid_check_convergence
Performance ID for checkConvergence.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _custom_pp_rel_tol
Relative tolerance on postprocessor value.
Class for containing MooseEnum item information.
static std::string outputNorm(const Real &old_norm, const Real &norm, const unsigned int precision=6)
A helper function for outputting norms in color.
const Real _custom_pp_abs_tol
Absolute tolerance on postprocessor value.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
unsigned int _max_fixed_point_its
Maximum fixed point iterations.
const InputParameters & parameters() const
Get the parameters of the object.
std::vector< Real > _fixed_point_timestep_begin_norm
Full history of residual norm after evaluation of timestep_begin.
DefaultMultiAppFixedPointConvergence(const InputParameters ¶meters)
Main app nonlinear solve converged, FP unassessed.
void outputResidualNorm(const std::string &execute_on_str, Real old_norm, Real new_norm) const
Outputs residual norm to console.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
void paramWarning(const std::string ¶m, Args... args) const
Emits a warning prefixed with the file and line number of the given param (from the input file) along...
bool hasMultiApps() const
Returns whether or not the current simulation has any multiapps.
const Real _fixed_point_rel_tol
Relative tolerance on residual norm.
virtual void preExecute()
Method that gets called in each iteration before the solve.
void ErrorVector unsigned int
static InputParameters validParams()
FP converged by absolute or relative PP tolerance.
virtual void printFixedPointConvergenceHistory(Real initial_norm, const std::vector< Real > ×tep_begin_norms, const std::vector< Real > ×tep_end_norms) const =0
Print the convergence history of the coupling, at every fixed point iteration.
Default fixed point convergence criteria.
Real computeResidualL2Norm(NonlinearSystemBase &sys)
Computes the residual of a nonlinear system using whatever is sitting in the current solution vector ...