https://mooseframework.inl.gov
FixedPointSolve.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "FixedPointSolve.h"
11 
12 #include "FEProblem.h"
13 #include "Executioner.h"
14 #include "MooseMesh.h"
15 #include "NonlinearSystem.h"
16 #include "AuxiliarySystem.h"
18 #include "Console.h"
19 #include "EigenExecutionerBase.h"
20 #include "Convergence.h"
22 #include "MooseUtils.h"
23 
26 {
28 
29  params.addParam<unsigned int>(
30  "fixed_point_min_its", 1, "Specifies the minimum number of fixed point iterations.");
31  params.addParam<unsigned int>(
32  "fixed_point_max_its", 1, "Specifies the maximum number of fixed point iterations.");
33  params.addParam<bool>("disable_fixed_point_residual_norm_check",
34  false,
35  "Disable the residual norm evaluation thus the three parameters "
36  "fixed_point_rel_tol, fixed_point_abs_tol and fixed_point_force_norms.");
37  params.addParam<bool>(
38  "fixed_point_force_norms",
39  false,
40  "Force the evaluation of both the TIMESTEP_BEGIN and TIMESTEP_END norms regardless of the "
41  "existence of active MultiApps with those execute_on flags, default: false.");
42  params.addParam<bool>(
43  "accept_on_max_fixed_point_iteration",
44  false,
45  "True to treat reaching the maximum number of fixed point iterations as converged.");
46  params.addRangeCheckedParam<Real>("fixed_point_rel_tol",
47  1e-8,
48  "fixed_point_rel_tol>0",
49  "The relative nonlinear residual drop to shoot for "
50  "during fixed point iterations. This check is "
51  "performed based on the main app's nonlinear "
52  "residual.");
53  params.addRangeCheckedParam<Real>("fixed_point_abs_tol",
54  1e-50,
55  "fixed_point_abs_tol>0",
56  "The absolute nonlinear residual to shoot for "
57  "during fixed point iterations. This check is "
58  "performed based on the main app's nonlinear "
59  "residual.");
60 
61  params.addParam<PostprocessorName>("custom_pp",
62  "Postprocessor for custom fixed point convergence check.");
63  params.addParam<bool>("direct_pp_value",
64  false,
65  "True to use direct postprocessor value "
66  "(scaled by value on first iteration). "
67  "False (default) to use difference in postprocessor "
68  "value between fixed point iterations.");
69  params.addRangeCheckedParam<Real>("custom_rel_tol",
70  1e-8,
71  "custom_rel_tol>0",
72  "The relative nonlinear residual drop to shoot for "
73  "during fixed point iterations. This check is "
74  "performed based on the postprocessor defined by "
75  "custom_pp residual.");
76  params.addRangeCheckedParam<Real>("custom_abs_tol",
77  1e-50,
78  "custom_abs_tol>0",
79  "The absolute nonlinear residual to shoot for "
80  "during fixed point iterations. This check is "
81  "performed based on postprocessor defined by "
82  "the custom_pp residual.");
83 
84  params.addParamNamesToGroup(
85  "fixed_point_min_its fixed_point_max_its disable_fixed_point_residual_norm_check "
86  "accept_on_max_fixed_point_iteration fixed_point_rel_tol fixed_point_abs_tol "
87  "fixed_point_force_norms custom_pp direct_pp_value custom_abs_tol custom_rel_tol",
88  "MultiApp fixed point iterations");
89 
90  return params;
91 }
92 
95 {
98 
99  params.addParam<ConvergenceName>(
100  "multiapp_fixed_point_convergence",
101  "Name of the Convergence object to use to assess convergence of the "
102  "MultiApp fixed point solve. If not provided, a default Convergence "
103  "will be constructed internally from the executioner parameters.");
104 
105  // Parameters for relaxing the fixed point process
106  params.addRangeCheckedParam<Real>("relaxation_factor",
107  1.0,
108  "relaxation_factor>0 & relaxation_factor<2",
109  "Fraction of newly computed value to keep."
110  "Set between 0 and 2.");
111  params.addParam<std::vector<std::string>>(
112  "transformed_variables",
113  std::vector<std::string>(),
114  "List of main app variables to transform during fixed point iterations");
115  params.addParam<std::vector<PostprocessorName>>(
116  "transformed_postprocessors",
117  std::vector<PostprocessorName>(),
118  "List of main app postprocessors to transform during fixed point iterations");
119  params.addDeprecatedParam<std::vector<std::string>>(
120  "relaxed_variables",
121  std::vector<std::string>(),
122  "List of main app variables to relax during fixed point iterations",
123  "Relaxed variables is deprecated, use transformed_variables instead.");
124 
125  params.addParam<bool>("auto_advance",
126  "Whether to automatically advance sub-applications regardless of whether "
127  "their solve converges, for transient executioners only.");
128 
129  params.addParamNamesToGroup(
130  "multiapp_fixed_point_convergence "
131  "relaxation_factor transformed_variables transformed_postprocessors auto_advance",
132  "Fixed point iterations");
133 
134  params.addParam<unsigned int>(
135  "max_xfem_update",
137  "Maximum number of times to update XFEM crack topology in a step due to evolving cracks");
138  params.addParam<bool>("update_xfem_at_timestep_begin",
139  false,
140  "Should XFEM update the mesh at the beginning of the timestep");
141 
142  params.addParamNamesToGroup("max_xfem_update update_xfem_at_timestep_begin",
143  "XFEM fixed point iterations");
144 
145  return params;
146 }
147 
149  : SolveObject(ex),
150  _has_fixed_point_its(getParam<unsigned int>("fixed_point_max_its") > 1 ||
151  getParam<unsigned int>("fixed_point_min_its") > 1 ||
152  isParamSetByUser("multiapp_fixed_point_convergence")),
153  _relax_factor(getParam<Real>("relaxation_factor")),
154  _transformed_vars(getParam<std::vector<std::string>>("transformed_variables")),
155  _transformed_pps(getParam<std::vector<PostprocessorName>>("transformed_postprocessors")),
156  _transformed_sys(nullptr),
157  // this value will be set by MultiApp
158  _secondary_relaxation_factor(1.0),
159  _fixed_point_it(0),
160  _fixed_point_status(MooseFixedPointConvergenceReason::UNSOLVED),
161  _max_xfem_update(getParam<unsigned int>("max_xfem_update")),
162  _update_xfem_at_timestep_begin(getParam<bool>("update_xfem_at_timestep_begin")),
163  _xfem_update_count(0),
164  _xfem_repeat_step(false),
165  _old_entering_time(_problem.time() - 1),
166  _fail_step(false),
167  _auto_advance_set_by_user(isParamValid("auto_advance")),
168  _auto_advance_user_value(_auto_advance_set_by_user ? getParam<bool>("auto_advance") : true)
169 {
170  // Handle deprecated parameters
171  if (!parameters().isParamSetByAddParam("relaxed_variables"))
172  _transformed_vars = getParam<std::vector<std::string>>("relaxed_variables");
173 
174  if (_transformed_vars.size() > 0 && _transformed_pps.size() > 0)
175  mooseWarning(
176  "Both variable and postprocessor transformation are active. If the two share dofs, the "
177  "transformation will not be correct.");
178  if (_relax_factor != 1 && _transformed_vars.empty() && _transformed_pps.empty())
179  paramError("relaxation_factor",
180  "Relaxation factor must act on at least one 'transformed_variables' or one "
181  "'transformed_postprocessors'");
182 
183  // Fixed point was not detected, and yet some parameters are passed
184  if (!_has_fixed_point_its &&
185  (getParam<Real>("relaxation_factor") != 1 ||
186  getParam<std::vector<std::string>>("transformed_variables").size() ||
187  getParam<std::vector<PostprocessorName>>("transformed_postprocessors").size()))
188  paramError("fixed_point_min_its",
189  std::string("Parameter(s) ") +
190  ((getParam<Real>("relaxation_factor") != 1) ? "'relaxation_factor', " : "") +
191  (getParam<std::vector<std::string>>("transformed_variables").size()
192  ? "'transformed_variables', "
193  : "") +
194  (getParam<std::vector<std::string>>("transformed_postprocessors").size()
195  ? "'transformed_postprocessors', "
196  : "") +
197  " were passed to the Executioner for multiapp fixed point iterations, but fixed "
198  "point iterations are only activiated if 'fixed_point_min_its', "
199  "'fixed_point_max_its' or 'multiapp_fixed_point_convergence' are passed");
200 
201  if (!_app.isUltimateMaster())
202  {
206  // TODO: use paramError by retrieving parent app's MultiApp
209  mooseError(
210  "Secondary relaxation factor, specified in the MultiApps block, must act on at least one "
211  "'secondary_transformed_variables' or one 'secondary_transformed_postprocessors'. "
212  "See parent application MultiApp parameters");
213  }
214 
215  if (isParamValid("multiapp_fixed_point_convergence"))
217  getParam<ConvergenceName>("multiapp_fixed_point_convergence"));
218  else
220 }
221 
222 void
224 {
226 
227  allocateStorage(true);
228 
229  // Add to the systems to copy if requested in the Problem
230  for (const auto i : make_range(_problem.numSolverSystems()))
235 
237  {
240  }
241 }
242 
243 bool
245 {
246  TIME_SECTION("PicardSolve", 1);
247 
248  Real current_dt = _problem.dt();
249 
250  bool converged = true;
251 
252  // need to back up multi-apps even when not doing fixed point iteration for recovering from failed
253  // multiapp solve
258 
259  // Prepare to relax variables as a main app
260  std::set<dof_id_type> transformed_dofs;
261  if ((_relax_factor != 1.0 || !dynamic_cast<PicardSolve *>(this)) && _transformed_vars.size() > 0)
262  {
263  // Snag all of the local dof indices for all of these variables
266  Threads::parallel_reduce(elem_range, aldit);
267 
268  transformed_dofs = aldit.getDofIndices();
269  }
270 
271  // Prepare to relax variables as a subapp
272  std::set<dof_id_type> secondary_transformed_dofs;
273  if (_secondary_relaxation_factor != 1.0 || !dynamic_cast<PicardSolve *>(this))
274  {
275  if (_secondary_transformed_variables.size() > 0)
276  {
277  // Snag all of the local dof indices for all of these variables
280  Threads::parallel_reduce(elem_range, aldit);
281 
282  secondary_transformed_dofs = aldit.getDofIndices();
283  }
284 
285  // To detect a new time step
286  if (_old_entering_time == _problem.time() &&
288  {
289  // Keep track of the iteration number of the main app
291 
292  // Save variable values before the solve. Solving will provide new values
294  saveVariableValues(/*is parent app of this iteration=*/false);
295  }
296  else
298  }
299 
301  {
303  convergence.initialize();
304  }
305 
306  _fixed_point_it = 0;
307  while (true)
308  {
310  {
311  if (_fixed_point_it != 0)
312  {
313  // For every iteration other than the first, we need to restore the state of the MultiApps
316  }
317 
318  _console << COLOR_MAGENTA << "Beginning fixed point iteration " << _fixed_point_it
319  << COLOR_DEFAULT << std::endl
320  << std::endl;
321  }
322 
323  // Solve a single application for one time step
324  const bool solve_converged = solveStep(transformed_dofs);
325 
326  if (solve_converged)
327  {
329  {
331 
332  // Examine convergence metrics & properties and set the convergence reason
333  bool break_out = examineFixedPointConvergence(converged);
334 
335  if (break_out)
336  {
337  // Except DefaultMultiAppFixedPointConvergence, convergence objects will not
338  // update _fixed_point_status, so we give those cases generic values:
340  {
341  if (converged)
343  else
345  }
346 
347  break;
348  }
349  }
350  }
351  else
352  {
353  // If the last solve didn't converge then we need to exit this step completely (even in the
354  // case of coupling). So we can retry...
355  converged = false;
356  break;
357  }
358 
359  _problem.dt() =
360  current_dt; // _dt might be smaller than this at this point for multistep methods
361 
362  _fixed_point_it++;
363 
365  break;
366  }
367 
368  if (converged)
369  {
370  // Fixed point iteration loop ends right above
374  {
376  return false;
377  }
379  }
380 
381  // Save postprocessors after the solve and their potential timestep_end execution
382  // The postprocessors could be overwritten at timestep_begin, which is why they are saved
383  // after the solve. They could also be saved right after the transfers.
386 
387  if (converged)
388  {
389  // Update the subapp using the fixed point algorithm
390  if (_secondary_transformed_variables.size() > 0 &&
392  transformVariables(secondary_transformed_dofs, false);
393 
394  // Update the entering time, used to detect failed solves
396  }
397 
400 
401  return converged;
402 }
403 
404 void
406 {
407  if (_transformed_sys)
408  saveVariableValues(primary);
409  savePostprocessorValues(primary);
410 }
411 
412 bool
413 FixedPointSolve::solveStep(const std::set<dof_id_type> & transformed_dofs)
414 {
415  bool auto_advance = autoAdvance();
416 
417  // Start new TIMESTEP_BEGIN section for solution invalidity
420 
423 
424  if (_fixed_point_it == 0)
425  {
429  {
431  return false;
432  }
434  }
435 
436  if (!_problem.execMultiApps(EXEC_TIMESTEP_BEGIN, auto_advance))
437  {
439  return false;
440  }
441 
444 
446 
447  // Transform the fixed point postprocessors before solving, but after the timestep_begin transfers
448  // have been received
454 
456  {
458  convergence.preExecute();
459  }
460 
461  // Keep track of the solution warnings from the TIMESTEP_BEGIN phase before:
462  // - the count reset at the beginning of each iteration of the solve
463  // - the output on TIMESTEP_BEGIN
466 
467  // Perform output for timestep begin
469 
470  // Update warehouse active objects
472 
473  // Save the current values of variables and postprocessors, before the solve
474  saveAllValues(true);
475 
476  // Save the previous fixed point iteration solution and aux variables if requested
477  for (auto * sys : _systems_to_copy_previous_solutions_for)
478  sys->copyPreviousFixedPointSolutions();
479 
481  _console << COLOR_MAGENTA << "\nMain app solve:" << COLOR_DEFAULT << std::endl;
482  if (!_inner_solve->solve())
483  {
485 
486  // Keep track of the solution warnings from the solve
488 
489  // Perform the output of the current, failed time step (this only occurs if desired)
491  return false;
492  }
493  else
495 
496  // Use the fixed point algorithm if the conditions (availability of values, etc) are met
498  transformVariables(transformed_dofs, true);
499 
501  {
502  _console << "\nRepeating step due to XFEM mesh modification" << std::endl;
503  _xfem_repeat_step = true;
505  }
506  else
507  {
508  if (_problem.haveXFEM())
509  {
510  _xfem_repeat_step = false;
511  _xfem_update_count = 0;
512  }
513 
514  // Start new TIMESTEP_END section for solution invalidity
515  // We have to restart the current iteration count to avoid double counting
517 
520 
522  if (!_problem.execMultiApps(EXEC_TIMESTEP_END, auto_advance))
524 
525  // Keep track of the solution warnings from the TIMESTEP_END phase
529  }
530 
532  return false;
533  if (_fail_step)
534  {
535  _fail_step = false;
536  return false;
537  }
538 
540 
541  return true;
542 }
543 
544 bool
546 {
548 
550  const auto status = convergence.checkConvergence(_fixed_point_it);
551  switch (status)
552  {
554  converged = true;
555  return true;
557  converged = false;
558  return true;
560  converged = false;
561  return false;
562  default:
563  mooseError("Should not reach here");
564  }
565 }
566 
567 void
569 {
570  _console << "Fixed point convergence reason: ";
571  switch (_fixed_point_status)
572  {
574  _console << "CONVERGED_ABS";
575  break;
577  _console << "CONVERGED_RELATIVE";
578  break;
580  _console << "CONVERGED_PP";
581  break;
583  _console << "REACH_MAX_ITS";
584  break;
586  _console << "CONVERGED_OBJECT (see Convergence object)";
587  break;
589  _console << "DIVERGED_MAX_ITS";
590  break;
592  _console << "DIVERGED_NONLINEAR";
593  break;
595  _console << "DIVERGED_FAILED_MULTIAPP";
596  break;
598  _console << "DIVERGED_OBJECT (see Convergence object)";
599  break;
600  default:
601  // UNSOLVED and CONVERGED_NONLINEAR should not be hit when coupling
602  // iteration is not on here
603  mooseError("Internal error: wrong fixed point status!");
604  break;
605  }
606  _console << std::endl;
607 }
608 
609 bool
611 {
612  bool auto_advance = !(_has_fixed_point_its && _problem.isTransient());
613 
614  if (dynamic_cast<EigenExecutionerBase *>(&_executioner) && _has_fixed_point_its)
615  auto_advance = true;
616 
618  auto_advance = _auto_advance_user_value;
619 
620  return auto_advance;
621 }
622 
623 bool
624 FixedPointSolve::performingRelaxation(const bool primary) const
625 {
626  if (primary)
627  return !MooseUtils::absoluteFuzzyEqual(_relax_factor, 1.0);
628  else
629  return !MooseUtils::absoluteFuzzyEqual(_secondary_relaxation_factor, 1.0);
630 }
631 
632 void
634 {
635  // Find the system for the transformed variables. They must all belong to the same system
636  const auto & transformed_vars = primary ? _transformed_vars : _secondary_transformed_variables;
637  if (!transformed_vars.empty())
638  {
639  if (_problem.hasAuxiliaryVariable(transformed_vars[0]))
641  else
643  }
644 
645  for (const auto & var_name : transformed_vars)
646  if (!_transformed_sys->hasVariable(var_name))
647  {
648  if (primary)
649  paramError("transformed_variables",
650  "Transformed variables must all belong to the same system. Auxiliary and each "
651  "solver system cannot be mixed");
652  else
653  mooseError("Secondary transformed variables must all belong to the same system. Auxiliary "
654  "and each solver system cannot be mixed");
655  }
656 
657  if (primary && _transformed_sys == &_aux)
658  mooseInfo("Transformation of auxiliary variables is only supported for auxiliary variables "
659  "that are only transferred from the child application");
660 
661  if (_transformed_sys)
663 }
void mooseInfo(Args &&... args) const
Definition: MooseBase.h:344
static InputParameters fixedPointDefaultConvergenceParams()
FEProblemBase & _problem
Reference to FEProblem.
Definition: SolveObject.h:47
const ExecFlagType EXEC_FAILED
Definition: Moose.C:48
libMesh::ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:1261
std::vector< std::string > sub_transformed_vars
The names of variables to transform for fixed point solve algorithms (e.g. secant, etc.).
Definition: MooseApp.h:130
void accumulateTimeStepIntoTotalOccurences(const unsigned int timestep_index)
Pass the number of solution invalid occurrences from current timestep to cumulative timestep counter ...
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
Definition: MooseApp.h:840
virtual Real & time() const
FixedPointSolve(Executioner &ex)
std::vector< PostprocessorName > sub_transformed_pps
The names of postprocessors to transform for fixed point solve algorithms (e.g. secant, etc.).
Definition: MooseApp.h:132
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
virtual void saveVariableValues(const bool primary)=0
Saves the current values of the variables, and update the old(er) vectors.
void setNeedToAddDefaultMultiAppFixedPointConvergence()
Sets _need_to_add_default_multiapp_fixed_point_convergence to true.
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition: MooseBase.h:467
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: MooseBase.h:416
bool examineFixedPointConvergence(bool &converged)
Examine the various convergence metrics.
virtual void initialize()
Method that gets called before each iteration loop.
Definition: Convergence.h:53
void needsPreviousMultiAppFixedPointIterationSolution(bool needed, const unsigned int solver_sys_num)
Set a flag that indicated that user required values for the previous multiapp fixed point iterate for...
void accumulateIterationIntoTimeStepOccurences()
Pass the number of solution invalid occurrences from current iteration to cumulative counters...
std::set< SystemBase * > _systems_to_copy_previous_solutions_for
All the systems that should save their previous solutions.
virtual void allocateStorage(const bool primary)=0
Allocate storage for the fixed point algorithm.
virtual void preSolve()
Override this for actions that should take place before execution, called by FixedPointSolve.
Definition: Executioner.h:83
virtual MooseConvergenceStatus checkConvergence(unsigned int iter)=0
Returns convergence status.
FixedPointConfig & fixedPointConfig()
This info is stored here because we need a "globalish" place to put it in order to allow communicatio...
Definition: MooseApp.h:391
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
virtual void updateActiveObjects()
Update the active objects in the warehouses.
AuxiliarySystem & _aux
Reference to auxiliary system for faster access.
Definition: SolveObject.h:57
virtual bool solve() override
Iteratively solves the FEProblem.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_END
Definition: Moose.C:40
virtual void onTimestepEnd() override
bool haveXFEM()
Find out whether the current analysis is using XFEM.
const ExecFlagType EXEC_TIMESTEP_END
Definition: Moose.C:36
MooseFixedPointConvergenceReason
Enumeration for fixed point convergence reasons.
virtual void initialSetup()
Method that should be executed once, before any solve calls.
Definition: SolveObject.h:32
virtual void saveAllValues(const bool primary)
Save both the variable and postprocessor values.
bool _fail_step
force the current step to fail, triggering are repeat with a cut dt
virtual void transformPostprocessors(const bool primary)=0
Use the fixed point algorithm to transform the postprocessors.
InputParameters emptyInputParameters()
const std::set< dof_id_type > & getDofIndices() const
std::vector< PostprocessorName > _secondary_transformed_pps
Postprocessors to be relaxed outside of fixed point iteration (used as a subapp)
auto max(const L &left, const R &right)
const std::vector< PostprocessorName > _transformed_pps
The postprocessors (transferred or not) that are going to be relaxed.
FP converged according to Convergence object.
virtual void savePostprocessorValues(const bool primary)=0
Saves the current values of the postprocessors, and update the old(er) vectors.
void resetIterationOccurences()
Reset the number of solution invalid occurrences back to zero.
Grab all the (possibly semi)local dof indices for the variables passed in, in the system passed in...
MPI_Status status
unsigned int _xfem_update_count
Counter for number of xfem updates that have been performed in the current step.
void mooseWarning(Args &&... args) const
virtual void execute(const ExecFlagType &exec_type)
Convenience function for performing execution of MOOSE systems.
void syncIteration()
Sync iteration counts to main processor Sum across all processors.
Executioner & _executioner
Executioner used to construct this.
Definition: SolveObject.h:45
const Real _relax_factor
Relaxation factor for fixed point Iteration.
MooseFixedPointConvergenceReason _fixed_point_status
Status of fixed point solve.
virtual Convergence & getConvergence(const std::string &name, const THREAD_ID tid=0) const
Gets a Convergence object.
void setMultiAppFixedPointConvergenceName(const ConvergenceName &convergence_name)
Sets the MultiApp fixed point convergence object name if there is one.
const ConvergenceName & getMultiAppFixedPointConvergenceName() const
Gets the MultiApp fixed point convergence object name.
const ExecFlagType EXEC_TIMESTEP_BEGIN
Definition: Moose.C:37
SolutionInvalidity & solutionInvalidity()
Get the SolutionInvalidity for this app.
Definition: MooseApp.h:184
SolveObject * _inner_solve
SolveObject wrapped by this solve object.
Definition: SolveObject.h:59
virtual void transformVariables(const std::set< dof_id_type > &transformed_dofs, const bool primary)=0
Use the fixed point algorithm to transform the variables.
virtual bool updateMeshXFEM()
Update the mesh due to changing XFEM cuts.
Executioners are objects that do the actual work of solving your problem.
Definition: Executioner.h:30
virtual void checkIterationType(IterationType) const
Perform checks related to the iteration type.
Definition: Convergence.h:48
Real _secondary_relaxation_factor
Relaxation factor outside of fixed point iteration (used as a subapp)
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:385
FP converged by relative residual tolerance.
virtual bool hasVariable(const std::string &var_name) const
Query a system for a variable.
Definition: SystemBase.C:852
void backupMultiApps(ExecFlagType type)
Backup the MultiApps associated with the ExecFlagType.
virtual int & timeStep() const
unsigned int _fixed_point_it
SystemBase & _solver_sys
Reference to a system for creating vectors as needed for the solve, etc.
Definition: SolveObject.h:55
static InputParameters validParams()
virtual bool useFixedPointAlgorithmUpdateInsteadOfPicard(const bool primary)=0
Use the fixed point algorithm transform instead of simply using the Picard update This routine can be...
Real sub_relaxation_factor
relaxation factor to be used for a MultiApp&#39;s subapps.
Definition: MooseApp.h:128
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void postSolve()
Override this for actions that should take place after execution, called by FixedPointSolve.
Definition: Executioner.h:88
const bool _auto_advance_set_by_user
Whether the user has set the auto_advance parameter for handling advancement of sub-applications in m...
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_BEGIN
Definition: Moose.C:42
void restoreMultiApps(ExecFlagType type, bool force=false)
Restore the MultiApps associated with the ExecFlagType.
std::vector< std::string > _secondary_transformed_variables
Variables to be relaxed outside of fixed point iteration (used as a subapp)
bool autoAdvance() const
Whether sub-applications are automatically advanced no matter what happens during their solves...
SystemBase * _transformed_sys
System holding the transformed variables.
void needsPreviousMultiAppFixedPointIterationAuxiliary(bool state)
Set a flag that indicated that user required values for the previous multiapp fixed point iterate for...
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_ITERATION_END
Definition: Moose.C:38
IntRange< T > make_range(T beg, T end)
virtual MooseMesh & mesh() override
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition: MooseBase.h:281
bool _xfem_repeat_step
Whether step should be repeated due to xfem modifying the mesh.
SolverSystem & getSolverSystem(unsigned int sys_num)
Get non-constant reference to a solver system.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
Real _old_entering_time
Time of previous fixed point solve as a subapp.
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
Main app nonlinear solve converged, FP unassessed.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Definition: MooseBase.h:209
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
void resetTimeStepOccurences()
Reset the number of solution invalid occurrences back to zero for the current time step...
bool execMultiApps(ExecFlagType type, bool auto_advance=true)
Execute the MultiApps associated with the ExecFlagType.
const unsigned int _max_xfem_update
Maximum number of xfem updates per step.
bool performingRelaxation(const bool primary) const
Returns true if there is relaxation.
virtual bool isTransient() const override
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_CONVERGENCE
Definition: Moose.C:44
void printFixedPointConvergenceReason()
Print information about the fixed point convergence.
FP converged by hitting max iterations and accepting.
virtual void initialSetup() override
Method that should be executed once, before any solve calls.
const bool _has_fixed_point_its
Whether or not we activate fixed point iteration.
void findTransformedSystem(const bool primary)
Find the system holding the variables to be transformed (accelerated or relaxed)
virtual bool solve()=0
Solve routine provided by this object.
virtual std::size_t numSolverSystems() const override
virtual Real & dt() const
virtual bool solveStep(const std::set< dof_id_type > &transformed_dofs)
Perform one fixed point iteration or a full solve.
virtual void preExecute()
Method that gets called in each iteration before the solve.
Definition: Convergence.h:58
const bool _auto_advance_user_value
The value of auto_advance set by the user for handling advancement of sub-applications in multi-app c...
void ErrorVector unsigned int
unsigned int _main_fixed_point_it
fixed point iteration counter for the main app
FP converged by absolute or relative PP tolerance.
virtual void outputStep(ExecFlagType type)
Output the current step.
const bool _update_xfem_at_timestep_begin
Controls whether xfem should update the mesh at the beginning of the time step.
virtual bool hasAuxiliaryVariable(const std::string &var_name) const
Whether or not this problem has this auxiliary variable.
Definition: SubProblem.C:812
void execTransfers(ExecFlagType type)
Execute the Transfers associated with the ExecFlagType.
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
This method takes a space delimited list of parameter names and adds them to the specified group name...
std::vector< std::string > _transformed_vars
The variables (transferred or not) that are going to be relaxed.