![]() |
OGS
|
|
Time loop capable of time-integrating several processes at once.
Definition at line 32 of file TimeLoop.h.
#include <TimeLoop.h>
Public Member Functions | |
| TimeLoop (std::vector< Output > &&outputs, std::vector< std::unique_ptr< ProcessData > > &&per_process_data, std::unique_ptr< NumLib::StaggeredCoupling > &&staggered_coupling, const NumLib::Time &start_time, const NumLib::Time &end_time) | |
| void | initialize () |
| initialize output, convergence criterion, etc. | |
| void | outputLastTimeStep () const |
| ~TimeLoop () | |
| bool | executeTimeStep () |
| bool | calculateNextTimeStep () |
| NumLib::Time | endTime () const |
| NumLib::Time | currentTime () const |
Public Attributes | |
| bool | successful_time_step = true |
Private Types | |
| using | TimeStepConstraintCallback |
Private Member Functions | |
| bool | preTsNonlinearSolvePostTs (NumLib::Time const &t, double const dt, std::size_t const timesteps) |
| NumLib::NonlinearSolverStatus | solveUncoupledEquationSystems (const NumLib::Time &t, const double dt, const std::size_t timestep_id) |
| Member to solver non coupled systems of equations, which can be a single system of equations, or several systems of equations without any dependency among the different systems. | |
| NumLib::NonlinearSolverStatus | solveCoupledEquationSystemsByStaggeredScheme (const NumLib::Time &t, const double dt, const std::size_t timestep_id) |
| Member to solver coupled systems of equations by the staggered scheme. | |
| std::pair< NumLib::TimeIncrement, bool > | computeTimeStepping (const double prev_dt, NumLib::Time &t, std::size_t &accepted_steps, std::size_t &rejected_steps, std::vector< TimeStepConstraintCallback > const &time_step_constraints) |
| template<typename OutputClassMember> | |
| void | outputSolutions (unsigned timestep, const double t, OutputClassMember output_class_member) const |
| std::vector< TimeStepConstraintCallback > | generateOutputTimeStepConstraints (std::vector< double > &&fixed_times) const |
| void | preOutputInitialConditions (NumLib::Time const &t, const double dt) const |
Private Attributes | |
| std::vector< GlobalVector * > | _process_solutions |
| std::vector< GlobalVector * > | _process_solutions_prev |
| std::vector< Output > | _outputs |
| std::vector< std::unique_ptr< ProcessData > > | _per_process_data |
| const NumLib::Time | _start_time |
| const NumLib::Time | _end_time |
| NumLib::Time | _current_time = _start_time |
| std::size_t | _accepted_steps = 0 |
| std::size_t | _rejected_steps = 0 |
| NumLib::TimeIncrement | _dt {0.} |
| int | _repeating_times_of_rejected_step = 0 |
| bool | _previous_step_rejected = false |
| int | _global_coupling_number_iterations = 0 |
| std::unique_ptr< NumLib::StaggeredCoupling > | _staggered_coupling |
|
private |
Definition at line 91 of file TimeLoop.h.
| ProcessLib::TimeLoop::TimeLoop | ( | std::vector< Output > && | outputs, |
| std::vector< std::unique_ptr< ProcessData > > && | per_process_data, | ||
| std::unique_ptr< NumLib::StaggeredCoupling > && | staggered_coupling, | ||
| const NumLib::Time & | start_time, | ||
| const NumLib::Time & | end_time ) |
Definition at line 263 of file TimeLoop.cpp.
References _end_time, _outputs, _per_process_data, _staggered_coupling, and _start_time.
| ProcessLib::TimeLoop::~TimeLoop | ( | ) |
Definition at line 754 of file TimeLoop.cpp.
References _process_solutions, _process_solutions_prev, and NumLib::GlobalVectorProvider::provider.
| bool ProcessLib::TimeLoop::calculateNextTimeStep | ( | ) |
Computes and sets the next timestep.
Definition at line 541 of file TimeLoop.cpp.
References _accepted_steps, _current_time, _dt, _end_time, _outputs, _previous_step_rejected, _rejected_steps, ProcessLib::calculateUniqueFixedTimesForAllOutputs(), computeTimeStepping(), DBUG(), ProcessLib::Output::doOutput(), ERR(), generateOutputTimeStepConstraints(), and outputSolutions().
|
private |
Find the minimum time step size among the predicted step sizes of processes and step it as common time step size.
| prev_dt | Previous time step size. |
| t | Current time. |
| accepted_steps | Accepted time steps that are counted in this function. |
| rejected_steps | Rejected time steps that are counted in this function. |
| time_step_constraints | Functions that are evaluate to influence the time step size (for instance a fixed output time) |
Definition at line 289 of file TimeLoop.cpp.
References _end_time, _global_coupling_number_iterations, _per_process_data, _process_solutions, _process_solutions_prev, _repeating_times_of_rejected_step, _staggered_coupling, ProcessLib::computationOfChangeNeeded(), MathLib::LinAlg::computeRelativeNorm(), MathLib::LinAlg::copy(), DBUG(), MathLib::NORM2, OGS_FATAL, NumLib::updateTimeSteps(), and WARN().
Referenced by calculateNextTimeStep(), and initialize().
|
inline |
|
inline |
| bool ProcessLib::TimeLoop::executeTimeStep | ( | ) |
Definition at line 520 of file TimeLoop.cpp.
References _accepted_steps, _current_time, _dt, _per_process_data, BaseLib::RunTime::elapsed(), INFO(), preTsNonlinearSolvePostTs(), BaseLib::RunTime::start(), and successful_time_step.
|
private |
Definition at line 453 of file TimeLoop.cpp.
References _end_time, and NumLib::possiblyClampDtToNextFixedTime().
Referenced by calculateNextTimeStep(), and initialize().
| void ProcessLib::TimeLoop::initialize | ( | ) |
initialize output, convergence criterion, etc.
Definition at line 471 of file TimeLoop.cpp.
References _accepted_steps, _current_time, _dt, _outputs, _per_process_data, _previous_step_rejected, _process_solutions, _process_solutions_prev, _rejected_steps, _staggered_coupling, _start_time, ProcessLib::calculateNonEquilibriumInitialResiduum(), ProcessLib::calculateUniqueFixedTimesForAllOutputs(), computeTimeStepping(), ProcessLib::Output::doOutput(), generateOutputTimeStepConstraints(), outputSolutions(), preOutputInitialConditions(), ProcessLib::setInitialConditions(), and ProcessLib::setTimeDiscretizedODESystem().
| void ProcessLib::TimeLoop::outputLastTimeStep | ( | ) | const |
Definition at line 584 of file TimeLoop.cpp.
References _accepted_steps, _current_time, _rejected_steps, ProcessLib::Output::doOutputLastTimestep(), INFO(), outputSolutions(), and successful_time_step.
|
private |
Definition at line 728 of file TimeLoop.cpp.
References _outputs, _per_process_data, and _process_solutions.
Referenced by calculateNextTimeStep(), initialize(), and outputLastTimeStep().
|
private |
Definition at line 766 of file TimeLoop.cpp.
References _per_process_data, _process_solutions, _process_solutions_prev, and _start_time.
Referenced by initialize().
|
private |
Definition at line 599 of file TimeLoop.cpp.
References _end_time, _outputs, _per_process_data, _process_solutions, _process_solutions_prev, _staggered_coupling, NumLib::NonlinearSolverStatus::error_norms_met, ProcessLib::postTimestepForAllProcesses(), ProcessLib::preTimestepForAllProcesses(), solveCoupledEquationSystemsByStaggeredScheme(), and solveUncoupledEquationSystems().
Referenced by executeTimeStep().
|
private |
Member to solver coupled systems of equations by the staggered scheme.
| t | Current time |
| dt | Time step size |
| timestep_id | Index of the time step |
Definition at line 702 of file TimeLoop.cpp.
References _global_coupling_number_iterations, _outputs, _per_process_data, _previous_step_rejected, _process_solutions, _process_solutions_prev, _staggered_coupling, and ProcessLib::solveOneTimeStepOneProcess().
Referenced by preTsNonlinearSolvePostTs().
|
private |
Member to solver non coupled systems of equations, which can be a single system of equations, or several systems of equations without any dependency among the different systems.
| t | Current time |
| dt | Time step size |
| timestep_id | Index of the time step |
Definition at line 659 of file TimeLoop.cpp.
References _outputs, _per_process_data, _process_solutions, _process_solutions_prev, ERR(), NumLib::NonlinearSolverStatus::error_norms_met, OGS_FATAL, ProcessLib::solveMonolithicProcess(), and ProcessLib::timestepper_cannot_reduce_dt.
Referenced by preTsNonlinearSolvePostTs().
|
private |
Definition at line 131 of file TimeLoop.h.
Referenced by calculateNextTimeStep(), executeTimeStep(), initialize(), and outputLastTimeStep().
|
private |
Definition at line 130 of file TimeLoop.h.
Referenced by calculateNextTimeStep(), currentTime(), executeTimeStep(), initialize(), and outputLastTimeStep().
|
private |
Definition at line 133 of file TimeLoop.h.
Referenced by calculateNextTimeStep(), executeTimeStep(), and initialize().
|
private |
Definition at line 129 of file TimeLoop.h.
Referenced by TimeLoop(), calculateNextTimeStep(), computeTimeStepping(), endTime(), generateOutputTimeStepConstraints(), and preTsNonlinearSolvePostTs().
|
private |
Number of global coupling iterations of the previous time step in the staggered scheme. It drives the time step size control of all processes.
Definition at line 139 of file TimeLoop.h.
Referenced by computeTimeStepping(), and solveCoupledEquationSystemsByStaggeredScheme().
|
private |
Definition at line 125 of file TimeLoop.h.
Referenced by TimeLoop(), calculateNextTimeStep(), initialize(), outputSolutions(), preTsNonlinearSolvePostTs(), solveCoupledEquationSystemsByStaggeredScheme(), and solveUncoupledEquationSystems().
|
private |
Definition at line 126 of file TimeLoop.h.
Referenced by TimeLoop(), computeTimeStepping(), executeTimeStep(), initialize(), outputSolutions(), preOutputInitialConditions(), preTsNonlinearSolvePostTs(), solveCoupledEquationSystemsByStaggeredScheme(), and solveUncoupledEquationSystems().
|
private |
Definition at line 135 of file TimeLoop.h.
Referenced by calculateNextTimeStep(), initialize(), and solveCoupledEquationSystemsByStaggeredScheme().
|
private |
Definition at line 123 of file TimeLoop.h.
Referenced by ~TimeLoop(), computeTimeStepping(), initialize(), outputSolutions(), preOutputInitialConditions(), preTsNonlinearSolvePostTs(), solveCoupledEquationSystemsByStaggeredScheme(), and solveUncoupledEquationSystems().
|
private |
Definition at line 124 of file TimeLoop.h.
Referenced by ~TimeLoop(), computeTimeStepping(), initialize(), preOutputInitialConditions(), preTsNonlinearSolvePostTs(), solveCoupledEquationSystemsByStaggeredScheme(), and solveUncoupledEquationSystems().
|
private |
Definition at line 132 of file TimeLoop.h.
Referenced by calculateNextTimeStep(), initialize(), and outputLastTimeStep().
|
private |
Definition at line 134 of file TimeLoop.h.
Referenced by computeTimeStepping().
|
private |
Definition at line 141 of file TimeLoop.h.
Referenced by TimeLoop(), computeTimeStepping(), initialize(), preTsNonlinearSolvePostTs(), and solveCoupledEquationSystemsByStaggeredScheme().
|
private |
Definition at line 128 of file TimeLoop.h.
Referenced by TimeLoop(), initialize(), and preOutputInitialConditions().
| bool ProcessLib::TimeLoop::successful_time_step = true |
Definition at line 58 of file TimeLoop.h.
Referenced by executeTimeStep(), and outputLastTimeStep().