https://mooseframework.inl.gov
Loading...
Searching...
No Matches
TimeSequenceStepperBase.h
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#pragma once
11
12#include "TimeStepper.h"
13
19{
20public:
22
24
25 void setupSequence(const std::vector<Real> & times);
26 void updateSequence(const std::vector<Real> & times);
27
28 // Clear the time sequence array, usually used when the time sequence needs to be updated during
29 // the simulation
30 void resetSequence();
31
32 // Increase the current step count by one
34
36 virtual Real getNextTimeInSequence();
37
45 bool advanceToFutureTime(Real time, Real tolerance, Real & next_time);
46
47 virtual void init() override {}
48 virtual void acceptStep() override;
49
50protected:
51 virtual Real computeInitialDT() override;
52 virtual Real computeDT() override;
53
62 virtual void refreshSequence() {}
63
65 std::vector<Real> buildSequence(const std::vector<Real> & times) const;
66
68 std::vector<Real>::const_iterator findFirstFutureTime(Real time, Real tolerance) const;
69
77 void synchronizeCurrentStep(Real time, Real tolerance);
78
81
83 unsigned int & _current_step;
84
86 std::vector<Real> & _time_sequence;
87
89 const bool _set_end_time;
90};
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Solves the PDEs at a sequence of given time points.
bool advanceToFutureTime(Real time, Real tolerance, Real &next_time)
Return the first sequence time that has not yet been reached, if any.
virtual void init() override
Initialize the time stepper.
std::vector< Real >::const_iterator findFirstFutureTime(Real time, Real tolerance) const
Find the first sequence time greater than time by more than tolerance.
void updateSequence(const std::vector< Real > &times)
virtual void acceptStep() override
This gets called when time step is accepted.
virtual void refreshSequence()
Re-read a time sequence source that can change during the simulation.
void setupSequence(const std::vector< Real > &times)
virtual Real computeInitialDT() override
Computes time step size for the initial time step.
const bool _set_end_time
Whether to use the last t in sequence as Executioner end_time.
unsigned int & _current_step
the step that the time stepper is currently at
virtual Real computeDT() override
Computes time step size after the initial time step.
static InputParameters validParams()
void synchronizeCurrentStep(Real time, Real tolerance)
Set the current sequence position from time.
std::vector< Real > & _time_sequence
stores the sequence of time points
const bool _use_last_dt_after_last_t
Whether to use the final dt past the last t in sequence.
std::vector< Real > buildSequence(const std::vector< Real > &times) const
Build the canonical time sequence for the current start and end times.
virtual Real getNextTimeInSequence()
Get the next time in the input time sequence.
Base class for time stepping.
Definition TimeStepper.h:23