www.mooseframework.org
Transient.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "Transient.h"
11 
12 // MOOSE includes
13 #include "Factory.h"
14 #include "SubProblem.h"
15 #include "TimeStepper.h"
16 #include "MooseApp.h"
17 #include "Conversion.h"
18 #include "FEProblem.h"
19 #include "NonlinearSystem.h"
20 #include "Control.h"
21 #include "TimePeriod.h"
22 #include "MooseMesh.h"
23 #include "TimeIntegrator.h"
24 #include "Console.h"
25 #include "AuxiliarySystem.h"
26 
27 #include "libmesh/implicit_system.h"
28 #include "libmesh/nonlinear_implicit_system.h"
29 #include "libmesh/transient_system.h"
30 #include "libmesh/numeric_vector.h"
31 
32 // C++ Includes
33 #include <iomanip>
34 #include <iostream>
35 #include <fstream>
36 #include <sstream>
37 #include <iomanip>
38 
39 registerMooseObject("MooseApp", Transient);
40 
43 {
45  params.addClassDescription("Executioner for time varying simulations.");
46 
47  params += FEProblemSolve::validParams();
48 
49  std::vector<Real> sync_times(1);
50  sync_times[0] = -std::numeric_limits<Real>::max();
51 
57  MooseEnum schemes("implicit-euler explicit-euler crank-nicolson bdf2 explicit-midpoint dirk "
58  "explicit-tvd-rk-2 newmark-beta",
59  "implicit-euler");
60 
61  params.addParam<Real>("start_time", 0.0, "The start time of the simulation");
62  params.addParam<Real>("end_time", 1.0e30, "The end time of the simulation");
63  params.addParam<Real>("dt", 1., "The timestep size between solves");
64  params.addParam<Real>("dtmin", 1.0e-12, "The minimum timestep size in an adaptive run");
65  params.addParam<Real>("dtmax", 1.0e30, "The maximum timestep size in an adaptive run");
66  params.addParam<bool>(
67  "reset_dt", false, "Use when restarting a calculation to force a change in dt.");
68  params.addParam<unsigned int>("num_steps",
70  "The number of timesteps in a transient run");
71  params.addParam<int>("n_startup_steps", 0, "The number of timesteps during startup");
72 
73  params.addDeprecatedParam<bool>("trans_ss_check",
74  false,
75  "Whether or not to check for steady state conditions",
76  "Use steady_state_detection instead");
77  params.addDeprecatedParam<Real>("ss_check_tol",
78  1.0e-08,
79  "Whenever the relative residual changes by less "
80  "than this the solution will be considered to be "
81  "at steady state.",
82  "Use steady_state_tolerance instead");
83  params.addDeprecatedParam<Real>(
84  "ss_tmin",
85  0.0,
86  "Minimum amount of time to run before checking for steady state conditions.",
87  "Use steady_state_start_time instead");
88 
89  params.addParam<bool>(
90  "steady_state_detection", false, "Whether or not to check for steady state conditions");
91  params.addParam<Real>("steady_state_tolerance",
92  1.0e-08,
93  "Whenever the relative residual changes by less "
94  "than this the solution will be considered to be "
95  "at steady state.");
96  params.addParam<Real>(
97  "steady_state_start_time",
98  0.0,
99  "Minimum amount of time to run before checking for steady state conditions.");
100  params.addParam<bool>(
101  "normalize_solution_diff_norm_by_dt",
102  true,
103  "Whether to divide the solution difference norm by dt. If taking 'small' "
104  "time steps you probably want this to be true. If taking very 'large' timesteps in an "
105  "attempt to *reach* a steady-state, you probably want this parameter to be false.");
106 
107  params.addParam<std::vector<std::string>>("time_periods", "The names of periods");
108  params.addParam<std::vector<Real>>("time_period_starts", "The start times of time periods");
109  params.addParam<std::vector<Real>>("time_period_ends", "The end times of time periods");
110  params.addParam<bool>(
111  "abort_on_solve_fail", false, "abort if solve not converged rather than cut timestep");
112  params.addParam<bool>(
113  "error_on_dtmin",
114  true,
115  "Throw error when timestep is less than dtmin instead of just aborting solve.");
116  params.addParam<MooseEnum>("scheme", schemes, "Time integration scheme used.");
117  params.addParam<Real>("timestep_tolerance",
118  1.0e-12,
119  "the tolerance setting for final timestep size and sync times");
120 
121  params.addParam<bool>("use_multiapp_dt",
122  false,
123  "If true then the dt for the simulation will be "
124  "chosen by the MultiApps. If false (the "
125  "default) then the minimum over the master dt "
126  "and the MultiApps is used");
127 
128  params.addParam<bool>("check_aux",
129  false,
130  "Whether to check the auxiliary system for convergence to steady-state. If "
131  "false, then the nonlinear system is used.");
132 
133  params.addParamNamesToGroup(
134  "steady_state_detection steady_state_tolerance steady_state_start_time check_aux",
135  "Steady State Detection");
136 
137  params.addParamNamesToGroup("start_time dtmin dtmax n_startup_steps trans_ss_check ss_check_tol "
138  "ss_tmin abort_on_solve_fail timestep_tolerance use_multiapp_dt",
139  "Advanced");
140 
141  params.addParamNamesToGroup("time_periods time_period_starts time_period_ends", "Time Periods");
142 
143  return params;
144 }
145 
147  : Executioner(parameters),
148  _problem(_fe_problem),
149  _feproblem_solve(*this),
150  _nl(_fe_problem.getNonlinearSystemBase(/*nl_sys=*/0)),
151  _aux(_fe_problem.getAuxiliarySystem()),
152  _check_aux(getParam<bool>("check_aux")),
153  _time_scheme(getParam<MooseEnum>("scheme").getEnum<Moose::TimeIntegratorType>()),
154  _time_stepper(nullptr),
155  _t_step(_problem.timeStep()),
156  _time(_problem.time()),
157  _time_old(_problem.timeOld()),
158  _dt(_problem.dt()),
159  _dt_old(_problem.dtOld()),
160  _unconstrained_dt(declareRecoverableData<Real>("unconstrained_dt", -1)),
161  _at_sync_point(declareRecoverableData<bool>("at_sync_point", false)),
162  _last_solve_converged(declareRecoverableData<bool>("last_solve_converged", true)),
163  _xfem_repeat_step(false),
164  _end_time(getParam<Real>("end_time")),
165  _dtmin(getParam<Real>("dtmin")),
166  _dtmax(getParam<Real>("dtmax")),
167  _num_steps(getParam<unsigned int>("num_steps")),
168  _n_startup_steps(getParam<int>("n_startup_steps")),
169  _steady_state_detection(getParam<bool>("steady_state_detection")),
170  _steady_state_tolerance(getParam<Real>("steady_state_tolerance")),
171  _steady_state_start_time(getParam<Real>("steady_state_start_time")),
172  _sync_times(_app.getOutputWarehouse().getSyncTimes()),
173  _abort(getParam<bool>("abort_on_solve_fail")),
174  _error_on_dtmin(getParam<bool>("error_on_dtmin")),
175  _time_interval(declareRecoverableData<bool>("time_interval", false)),
176  _start_time(getParam<Real>("start_time")),
177  _timestep_tolerance(getParam<Real>("timestep_tolerance")),
178  _target_time(declareRecoverableData<Real>("target_time", -std::numeric_limits<Real>::max())),
179  _use_multiapp_dt(getParam<bool>("use_multiapp_dt")),
180  _solution_change_norm(declareRecoverableData<Real>("solution_change_norm", 0.0)),
181  _normalize_solution_diff_norm_by_dt(getParam<bool>("normalize_solution_diff_norm_by_dt"))
182 {
183  _fixed_point_solve->setInnerSolve(_feproblem_solve);
184 
185  // Handle deprecated parameters
186  if (!parameters.isParamSetByAddParam("trans_ss_check"))
187  _steady_state_detection = getParam<bool>("trans_ss_check");
188 
189  if (!parameters.isParamSetByAddParam("ss_check_tol"))
190  _steady_state_tolerance = getParam<Real>("ss_check_tol");
191 
192  if (!parameters.isParamSetByAddParam("ss_tmin"))
193  _steady_state_start_time = getParam<Real>("ss_tmin");
194 
195  _t_step = 0;
196  _dt = 0;
198 
199  // Either a start_time has been forced on us, or we want to tell the App about what our start time
200  // is (in case anyone else is interested.
201  if (_app.hasStartTime())
203  else if (parameters.isParamSetByUser("start_time"))
205 
207  _problem.transient(true);
208 
210 
211  if (_app.testCheckpointHalfTransient()) // Cut timesteps and end_time in half...
212  {
213  _end_time = (_start_time + _end_time) / 2.0;
214  _num_steps /= 2.0;
215 
216  if (_num_steps == 0) // Always do one step in the first half
217  _num_steps = 1;
218  }
219 }
220 
221 void
223 {
226 
227  mooseAssert(getTimeStepper(), "No time stepper was set");
228 
229  _time_stepper->init();
230 
231  if (_app.isRecovering()) // Recover case
232  {
233  if (_t_step == 0)
234  mooseError("Internal error in Transient executioner: _t_step is equal to 0 while recovering "
235  "in init().");
236 
237  _dt_old = _dt;
238  }
239 }
240 
241 void
243 {
245 
246  if (!_app.isRecovering())
247  {
248  _t_step = 0;
249  _dt = 0;
251  if (!_app.isRestarting())
253 
255 
256  computeDT();
257  _dt = getDT();
258  if (_dt == 0)
259  mooseError("Time stepper computed zero time step size on initial which is not allowed.\n"
260  "1. If you are using an existing time stepper, double check the values in your "
261  "input file or report an error.\n"
262  "2. If you are developing a new time stepper, make sure that initial time step "
263  "size in your code is computed correctly.");
265  }
266 }
267 
268 void
270 {
272 }
273 
274 void
276 {
278 }
279 
280 void
282 {
283  preExecute();
284 
285  // Start time loop...
286  while (keepGoing())
287  {
289  preStep();
290  computeDT();
291  takeStep();
292  endStep();
293  postStep();
294  }
295 
296  if (lastSolveConverged())
297  {
298  _t_step++;
299 
300  /*
301  * Call the multi-app executioners endStep and
302  * postStep methods when doing Picard or when not automatically advancing sub-applications for
303  * some other reason. We do not perform these calls for loose-coupling/auto-advancement
304  * problems because Transient::endStep and Transient::postStep get called from
305  * TransientMultiApp::solveStep in that case.
306  */
307  if (!_fixed_point_solve->autoAdvance())
308  {
310  /*recurse_through_multiapp_levels=*/true);
311  _problem.finishMultiAppStep(EXEC_TIMESTEP_BEGIN, /*recurse_through_multiapp_levels=*/true);
312  _problem.finishMultiAppStep(EXEC_TIMESTEP_END, /*recurse_through_multiapp_levels=*/true);
314  /*recurse_through_multiapp_levels=*/true);
315  }
316  }
317 
319  {
320  TIME_SECTION("final", 1, "Executing Final Objects");
325  }
326 
327  // This method is to finalize anything else we want to do on the problem side.
329 
330  // This method can be overridden for user defined activities in the Executioner.
331  postExecute();
332 }
333 
334 void
336 {
337  _time_stepper->computeStep(); // This is actually when DT gets computed
338 }
339 
340 void
342 {
343  if (lastSolveConverged())
344  {
345  if (!_xfem_repeat_step)
346  {
347 #ifdef LIBMESH_ENABLE_AMR
348  if (_t_step != 0)
350 #endif
351 
352  _time_old = _time;
353  _t_step++;
354 
356 
357  if (_t_step == 1)
358  return;
359 
360  /*
361  * Call the multi-app executioners endStep and
362  * postStep methods when doing Picard or when not automatically advancing sub-applications for
363  * some other reason. We do not perform these calls for loose-coupling/auto-advancement
364  * problems because Transient::endStep and Transient::postStep get called from
365  * TransientMultiApp::solveStep in that case.
366  */
367  if (!_fixed_point_solve->autoAdvance())
368  {
373  }
374 
375  /*
376  * Ensure that we increment the sub-application time steps so that
377  * when dt selection is made in the master application, we are using
378  * the correct time step information
379  */
384  }
385  }
386  else
387  {
393  _time = _time_old;
394  }
395 }
396 
397 void
398 Transient::takeStep(Real input_dt)
399 {
400  _dt_old = _dt;
401 
402  if (input_dt == -1.0)
404  else
405  _dt = input_dt;
406 
408 
409  // Increment time
410  _time = _time_old + _dt;
411 
413 
415 
416  _time_stepper->step();
417  _xfem_repeat_step = _fixed_point_solve->XFEMRepeatStep();
418 
420 
421  if (!lastSolveConverged())
422  {
423  _console << "Aborting as solve did not converge" << std::endl;
424  return;
425  }
426 
427  if (!(_problem.haveXFEM() && _fixed_point_solve->XFEMRepeatStep()))
428  {
429  if (lastSolveConverged())
431  else
433  }
434 
435  _time = _time_old;
436 
438 
441 
442  return;
443 }
444 
445 void
446 Transient::endStep(Real input_time)
447 {
448  if (input_time == -1.0)
449  _time = _time_old + _dt;
450  else
451  _time = input_time;
452 
453  if (lastSolveConverged())
454  {
455  if (_xfem_repeat_step)
456  _time = _time_old;
457  else
458  {
460 
461  // Compute the Error Indicators and Markers
464 
465  // Perform the output of the current time step
467 
468  // output
471  }
472  }
473 }
474 
475 Real
477 {
478  // // If start up steps are needed
479  // if (_t_step == 1 && _n_startup_steps > 1)
480  // _dt = _input_dt/(double)(_n_startup_steps);
481  // else if (_t_step == 1+_n_startup_steps && _n_startup_steps > 1)
482  // _dt = _input_dt;
483 
484  Real dt_cur = _dt;
485  std::ostringstream diag;
486 
487  // After startup steps, compute new dt
489  dt_cur = getDT();
490 
491  else
492  {
493  diag << "Timestep < n_startup_steps, using old dt: " << std::setw(9) << std::setprecision(6)
494  << std::setfill('0') << std::showpoint << std::left << _dt << " tstep: " << _t_step
495  << " n_startup_steps: " << _n_startup_steps << std::endl;
496  }
497  _unconstrained_dt = dt_cur;
498 
499  if (_verbose)
500  _console << diag.str();
501 
502  diag.str("");
503  diag.clear();
504 
505  // Allow the time stepper to limit the time step
507 
508  // Don't let time go beyond next time interval output if specified
510  {
512  _at_sync_point = true;
513 
514  diag << "Limiting dt for time interval output at time: " << std::setw(9) << std::setprecision(6)
515  << std::setfill('0') << std::showpoint << std::left << _next_interval_output_time
516  << " dt: " << std::setw(9) << std::setprecision(6) << std::setfill('0') << std::showpoint
517  << std::left << dt_cur << std::endl;
518  }
519 
520  // If a target time is set and the current dt would exceed it, limit dt to match the target
522  _time + dt_cur + _timestep_tolerance >= _target_time)
523  {
524  dt_cur = _target_time - _time;
525  _at_sync_point = true;
526 
527  diag << "Limiting dt for target time: " << std::setw(9) << std::setprecision(6)
528  << std::setfill('0') << std::showpoint << std::left << _next_interval_output_time
529  << " dt: " << std::setw(9) << std::setprecision(6) << std::setfill('0') << std::showpoint
530  << std::left << dt_cur << std::endl;
531  }
532 
533  // Constrain by what the multi apps are doing
538 
539  if (_verbose)
540  _console << diag.str();
541 
542  return dt_cur;
543 }
544 
545 void
547  std::ostringstream & diag,
548  const ExecFlagType & execute_on) const
549 {
550  Real multi_app_dt = _problem.computeMultiAppsDT(execute_on);
551  if (_use_multiapp_dt || multi_app_dt < dt_cur)
552  {
553  dt_cur = multi_app_dt;
554  _at_sync_point = false;
555  diag << "Limiting dt for MultiApps on " << execute_on.name() << ": " << std::setw(9)
556  << std::setprecision(6) << std::setfill('0') << std::showpoint << std::left << dt_cur
557  << std::endl;
558  }
559 }
560 
561 Real
563 {
564  return _time_stepper->getCurrentDT();
565 }
566 
567 bool
569 {
570  bool keep_going = !_problem.isSolveTerminationRequested();
571 
572  // Check for stop condition based upon steady-state check flag:
573  if (lastSolveConverged())
574  {
575  if (!_xfem_repeat_step)
576  {
578  {
579  // Check solution difference relative norm against steady-state tolerance
581  {
582  _console << "Steady-State Solution Achieved at time: " << _time << std::endl;
583  // Output last solve if not output previously by forcing it
584  keep_going = false;
585  }
586  else // Keep going
587  {
588  // Print steady-state relative error norm
589  _console << "Steady-State Relative Differential Norm: " << _solution_change_norm
590  << std::endl;
591  }
592  }
593 
594  // Check for stop condition based upon number of simulation steps and/or solution end time:
595  if (static_cast<unsigned int>(_t_step) >= _num_steps)
596  keep_going = false;
597 
598  if ((_time >= _end_time) || (fabs(_time - _end_time) <= _timestep_tolerance))
599  keep_going = false;
600  }
601  }
602  else if (_abort)
603  {
604  _console << "Aborting as solve did not converge and input selected to abort" << std::endl;
605  keep_going = false;
606  }
607  else if (!_error_on_dtmin && _dt <= _dtmin)
608  {
609  _console << "Aborting as timestep already at or below dtmin" << std::endl;
610  keep_going = false;
611  }
612 
613  return keep_going;
614 }
615 
616 void
618 {
619 }
620 
621 bool
623 {
624  return _last_solve_converged;
625 }
626 
627 void
629 {
631 }
632 
633 void
634 Transient::setTargetTime(Real target_time)
635 {
636  _target_time = target_time;
637 }
638 
639 Real
641 {
642  return _solution_change_norm;
643 }
644 
645 void
647 {
649  mooseError("You cannot specify time_scheme in the Executioner and independently add a "
650  "TimeIntegrator to the system at the same time");
651 
653  {
654  // backwards compatibility
655  std::string ti_str;
656  using namespace Moose;
657 
658  switch (_time_scheme)
659  {
660  case TI_IMPLICIT_EULER:
661  ti_str = "ImplicitEuler";
662  break;
663  case TI_EXPLICIT_EULER:
664  ti_str = "ExplicitEuler";
665  break;
666  case TI_CRANK_NICOLSON:
667  ti_str = "CrankNicolson";
668  break;
669  case TI_BDF2:
670  ti_str = "BDF2";
671  break;
673  ti_str = "ExplicitMidpoint";
674  break;
675  case TI_LSTABLE_DIRK2:
676  ti_str = "LStableDirk2";
677  break;
679  ti_str = "ExplicitTVDRK2";
680  break;
681  case TI_NEWMARK_BETA:
682  ti_str = "NewmarkBeta";
683  break;
684  default:
685  mooseError("Unknown scheme: ", _time_scheme);
686  break;
687  }
688 
689  InputParameters params = _app.getFactory().getValidParams(ti_str);
690  _problem.addTimeIntegrator(ti_str, ti_str, params);
691  }
692 }
693 
694 std::string
696 {
697  if (_time_stepper)
698  {
699  TimeStepper & ts = *_time_stepper;
700  return demangle(typeid(ts).name());
701  }
702  else
703  return std::string();
704 }
705 
706 std::string
708 {
709  const auto * ti = _nl.getTimeIntegrator();
710  if (ti)
711  return ti->type();
712  else
713  mooseError("Time integrator has not been built yet so we can't retrieve its name");
714 }
715 
716 Real
718 {
719  const NumericVector<Number> & current_solution =
721  const NumericVector<Number> & old_solution = _check_aux ? _aux.solutionOld() : _nl.solutionOld();
722 
723  return current_solution.l2_norm_diff(old_solution) / current_solution.l2_norm();
724 }
725 
726 void
728 {
729  mooseAssert(!_time_stepper, "Already set");
730  _time_stepper = &ts;
731 }
void finalizeMultiApps()
Moose::TimeIntegratorType _time_scheme
Definition: Transient.h:241
void timestepSetup() override
virtual Real getDT()
Definition: Transient.C:562
Transient executioners usually loop through a number of timesteps...
Definition: Transient.h:26
virtual std::string getTimeIntegratorName() const override
Get the name of the time integrator (time integration scheme) used.
Definition: Transient.C:707
Real & _unconstrained_dt
Definition: Transient.h:254
const bool _normalize_solution_diff_norm_by_dt
Whether to divide the solution difference norm by dt.
Definition: Transient.h:301
void constrainDTFromMultiApp(Real &dt_cur, std::ostringstream &diag, const ExecFlagType &execute_on) const
Constrain the timestep dt_cur by looking at the timesteps for the MultiApps on execute_on.
Definition: Transient.C:546
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
const std::string & name() const
Definition: MooseEnumItem.h:35
NumericVector< Number > & solution()
Definition: SystemBase.h:176
virtual void setTargetTime(Real target_time)
Can be used to set the next "target time" which is a time to nail perfectly.
Definition: Transient.C:634
const bool _check_aux
Whether to use the auxiliary system solution to determine steady-states.
Definition: Transient.h:239
virtual void postExecute()
Method called at the end of the simulation.
virtual void postStep()
Callback to the TimeIntegrator called at the very end of time step.
void computeStep()
Called before a new step is started.
Definition: TimeStepper.C:78
virtual void computeDT()
Definition: Transient.C:335
FEProblemBase & _problem
Here for backward compatibility.
Definition: Transient.h:227
virtual void preStep()
Definition: TimeStepper.h:39
virtual void computeMarkers()
int _n_startup_steps
Definition: Transient.h:267
virtual void init() override
Initialize the executioner.
Definition: Transient.C:222
TimeIntegrator * getTimeIntegrator()
Definition: SystemBase.h:869
const bool & _verbose
True if printing out additional information.
Definition: Executioner.h:175
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
Definition: Factory.C:67
Base class for time stepping.
Definition: TimeStepper.h:22
virtual void execute() override
Pure virtual execute function MUST be overridden by children classes.
Definition: Transient.C:281
virtual void endStep(Real input_time=-1.0)
Definition: Transient.C:446
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void preSolve()
Definition: TimeStepper.h:36
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_END
Definition: Moose.C:34
void finishMultiAppStep(ExecFlagType type, bool recurse_through_multiapp_levels=false)
Finish the MultiApp time step (endStep, postStep) associated with the ExecFlagType.
virtual void postExecute()
Definition: TimeStepper.h:38
virtual bool constrainStep(Real &dt)
Called after computeStep() is called.
Definition: TimeStepper.C:102
virtual void postExecute() override
Override this for actions that should take place after execution.
Definition: Transient.C:628
bool haveXFEM()
Find out whether the current analysis is using XFEM.
const ExecFlagType EXEC_TIMESTEP_END
Definition: Moose.C:32
Real getStartTime() const
Definition: MooseApp.h:295
virtual bool converged() const
If the time step converged.
Definition: TimeStepper.C:197
bool isRestarting() const
Whether or not this is a "restart" calculation.
Definition: MooseApp.C:1173
virtual void init()
Called only before the very first timestep (t_step = 0) Never called again (not even during recover/r...
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:56
bool _xfem_repeat_step
Whether step should be repeated due to xfem modifying the mesh.
Definition: Transient.h:261
bool _steady_state_detection
Steady state detection variables:
Definition: Transient.h:272
Real computeMultiAppsDT(ExecFlagType type)
Find the smallest timestep over all MultiApps.
Factory & getFactory()
Retrieve a writable reference to the Factory associated with this App.
Definition: MooseApp.h:408
auto max(const L &left, const R &right)
virtual bool isSolveTerminationRequested() const
Check of termination has been requested.
Definition: Problem.h:43
Real l2_norm_diff(const NumericVector< Number > &other_vec) const
Real _dtmin
Definition: Transient.h:264
Real & _time_old
Previous time.
Definition: Transient.h:249
virtual void advanceState()
Advance all of the state holding vectors / datastructures so that we can move to the next timestep...
bool & _time_interval
if to use time interval output
Definition: Transient.h:285
virtual void execute(const ExecFlagType &exec_type)
Convenience function for performing execution of MOOSE systems.
bool isParamSetByAddParam(const std::string &name) const
Returns whether or not the parameter was set due to addParam.
virtual void takeStep(Real input_dt=-1.0)
Do whatever is necessary to advance one step.
Definition: Transient.C:398
Transient(const InputParameters &parameters)
Definition: Transient.C:146
TimeStepper * _time_stepper
Definition: Transient.h:242
unsigned int _num_steps
Definition: Transient.h:266
virtual Real l2_norm() const =0
virtual void acceptStep()
This gets called when time step is accepted.
Definition: TimeStepper.C:175
static InputParameters validParams()
Definition: Executioner.C:26
virtual Real computeConstrainedDT()
Definition: Transient.C:476
virtual bool lastSolveConverged() const override
Whether or not the last solve converged.
Definition: Transient.C:622
NonlinearSystemBase & _nl
Reference to nonlinear system base for faster access.
Definition: Transient.h:233
TimeStepper * getTimeStepper()
Pointer to the TimeStepper.
Definition: Transient.h:122
const ExecFlagType EXEC_TIMESTEP_BEGIN
Definition: Moose.C:33
const ExecFlagType EXEC_PRE_MULTIAPP_SETUP
Definition: Moose.C:46
bool hasTimeIntegrator() const
Returns whether or not this Problem has a TimeIntegrator.
virtual void computeIndicators()
bool _use_multiapp_dt
Definition: Transient.h:292
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:50
virtual std::string getTimeStepperName() const override
Get the name of the timestepper.
Definition: Transient.C:695
void initialSetup() override
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:31
Executioners are objects that do the actual work of solving your problem.
Definition: Executioner.h:30
virtual void addTimeIntegrator(const std::string &type, const std::string &name, InputParameters &parameters)
bool testCheckpointHalfTransient() const
Whether or not this simulation should only run half its transient (useful for testing recovery) ...
Definition: MooseApp.h:522
Real & _target_time
Definition: Transient.h:291
Real _steady_state_tolerance
Definition: Transient.h:273
void setupTimeIntegrator()
Definition: Transient.C:646
Real _start_time
Definition: Transient.h:289
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:69
virtual void incrementStepOrReject()
This is where the solve step is actually incremented.
Definition: Transient.C:341
static InputParameters validParams()
virtual void estimateTimeError()
Definition: Transient.C:617
std::string demangle(const char *name)
Real _timestep_tolerance
Definition: Transient.h:290
const bool _error_on_dtmin
This parameter controls how the system will deal with _dt <= _dtmin If true, the time stepper is expe...
Definition: Transient.h:282
bool _abort
Definition: Transient.h:278
const NumericVector< Number > *const & currentSolution() const override
The solution vector that is currently being operated on.
Real & _dt
Current delta t... or timestep size.
Definition: Transient.h:251
Real & _dt_old
Definition: Transient.h:252
virtual void preExecute() override
Override this for actions that should take place before execution.
Definition: Transient.C:242
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was by the user.
Real _time_interval_output_interval
Definition: Transient.h:287
bool & _at_sync_point
Definition: Transient.h:255
Real & _time
Current time.
Definition: Transient.h:247
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:18
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_BEGIN
Definition: Moose.C:36
Real _steady_state_start_time
Definition: Transient.h:274
void restoreMultiApps(ExecFlagType type, bool force=false)
Restore the MultiApps associated with the ExecFlagType.
void setTimeStepper(TimeStepper &ts)
Set the timestepper to use.
Definition: Transient.C:727
bool hasStartTime() const
Definition: MooseApp.h:290
virtual void onTimestepBegin() override
virtual Real relativeSolutionDifferenceNorm()
The relative L2 norm of the difference between solution and old solution vector.
Definition: Transient.C:717
virtual void preExecute()
Definition: TimeStepper.C:70
virtual void rejectStep()
This gets called when time step is rejected.
Definition: TimeStepper.C:185
void incrementMultiAppTStep(ExecFlagType type)
Advance the MultiApps t_step (incrementStepOrReject) associated with the ExecFlagType.
virtual void transient(bool trans)
TimeIntegratorType
Time integrators.
Definition: MooseTypes.h:815
virtual void postSolve()
Definition: TimeStepper.h:37
virtual void preStep()
Definition: Transient.C:269
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
virtual bool keepGoing()
Transient loop will continue as long as this keeps returning true.
Definition: Transient.C:568
virtual void step()
Take a time step.
Definition: TimeStepper.C:166
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
const InputParameters & parameters() const
Get the parameters of the object.
static InputParameters validParams()
Constructor.
Definition: Transient.C:42
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
virtual void postStep()
Definition: TimeStepper.h:40
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
Real _end_time
Definition: Transient.h:263
bool execMultiApps(ExecFlagType type, bool auto_advance=true)
Execute the MultiApps associated with the ExecFlagType.
virtual void postStep()
Definition: Transient.C:275
NumericVector< Number > & solutionOld()
Definition: SystemBase.h:177
AuxiliarySystem & _aux
Reference to auxiliary system base for faster access.
Definition: Transient.h:236
Real & _solution_change_norm
Definition: Transient.h:294
bool isRecovering() const
Whether or not this is a "recover" calculation.
Definition: MooseApp.C:1167
virtual void init()
Initialize the time stepper.
Definition: TimeStepper.C:65
Real _next_interval_output_time
Definition: Transient.h:286
const ExecFlagType EXEC_FINAL
Definition: Moose.C:38
registerMooseObject("MooseApp", Transient)
int & _t_step
Current timestep.
Definition: Transient.h:245
Real getCurrentDT()
Get the current_dt.
Definition: TimeStepper.h:85
void ErrorVector unsigned int
std::unique_ptr< FixedPointSolve > _fixed_point_solve
Definition: Executioner.h:169
virtual void outputStep(ExecFlagType type)
Output the current step.
Real getSolutionChangeNorm()
Get the Relative L2 norm of the change in the solution.
Definition: Transient.C:640
void setStartTime(Real time)
Set the starting time for the simulation.
Definition: MooseApp.C:1759
FEProblemSolve _feproblem_solve
inner-most solve object to perform Newton solve with PETSc on every time step
Definition: Transient.h:230
virtual bool adaptMesh()
bool & _last_solve_converged
Whether or not the last solve converged.
Definition: Transient.h:258
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...
const ExecFlagType EXEC_INITIAL
Definition: Moose.C:28