Vanilla SDC controller. More...
#include <sdc.hpp>
Public Member Functions | |
virtual void | run () |
Run vanilla SDC. More... | |
![]() | |
Controller () | |
virtual | ~Controller () |
virtual void | set_options (bool all_sweepers=true) |
Set options from command line etc. More... | |
virtual void | setup () |
Basic setup routine for this controller. More... | |
virtual void | set_duration (time t0, time tend, time dt, size_t niters) |
Set basic time scope of the Controller. More... | |
virtual void | add_level (shared_ptr< ISweeper< time >> sweeper, shared_ptr< ITransfer< time >> transfer=shared_ptr< ITransfer< time >>(nullptr), bool coarse=true) |
Adding a level to the controller. More... | |
virtual size_t | nlevels () |
Total number of levels controlled by this Controller. More... | |
template<typename R = ISweeper<time>> | |
shared_ptr< R > | get_level (size_t level) |
Get sweeper for level with index level . More... | |
template<typename R = ISweeper<time>> | |
shared_ptr< R > | get_finest () |
Get coarsest level. More... | |
template<typename R = ISweeper<time>> | |
shared_ptr< R > | get_coarsest () |
Get coarsest level. More... | |
template<typename R = ITransfer<time>> | |
shared_ptr< R > | get_transfer (size_t level) |
Retreive transfer operator for level level . More... | |
virtual size_t | get_step () |
Get current time step index. More... | |
virtual void | set_step (size_t n) |
Set current time step index. More... | |
virtual time | get_step_size () |
Get width of current time step. More... | |
time | get_dt () |
Get width of current time step (alias for get_step_size). More... | |
virtual time | get_time () |
Get start time point of current time step. More... | |
time | get_t () |
Get start time point of current time step (alias for get_time). More... | |
virtual void | advance_time (size_t nsteps=1) |
Advance to a following time step. More... | |
virtual time | get_end_time () |
Get end time point of last time step. More... | |
virtual size_t | get_iteration () |
Get current iteration index of current time step. More... | |
virtual void | set_iteration (size_t iter) |
Set current iteration of current time step. More... | |
virtual void | advance_iteration () |
Advance to the next iteration. More... | |
virtual size_t | get_max_iterations () |
Get maximum number of allowed iterations per time step. More... | |
virtual LevelIter | finest () |
Convenience accessor to the finest level. More... | |
virtual LevelIter | coarsest () |
Convenience accessor to the coarsest level. More... | |
Additional Inherited Members | |
![]() | |
deque< shared_ptr< ISweeper< time > > > | levels |
Ordered list of all levels. More... | |
deque< shared_ptr< ITransfer< time > > > | transfer |
Ordered list of transfer operators for levels. More... | |
size_t | step |
Current time step index. More... | |
size_t | iteration |
Current iteration index on current time step. More... | |
size_t | max_iterations |
Maximum iterations per time step. More... | |
time | t |
\( t_0 \) of current time step. More... | |
time | dt |
Width of current time step (\( \Delta t \)). More... | |
time | tend |
\( T_{end} \) of last time step. More... | |
Vanilla SDC controller.
time | time precision |
|
virtual |
Run vanilla SDC.
For each time step at most a total of Controller::get_max_iterations() iterations will be done on the configured sweeper (which happens to be the only in Controller::levels).
On the first iteration on a time step, ISweeper::predict() will get called and ISweeper::sweep() on all subsequent iterations on the same time step. After each ISweeper::post_predict() or ISweeper::post_sweep() call ISweeper::converged() will get checked to shortcut the iterations. The next iteration is introduced by Controller::advance_iteration().
Once the maximum number of iterations is reached (or the sweeper has converged before) that, the ISweeper::post_step() hook is triggered followed by ISweeper::advance() to complete the time step and advance to the next via Controller::advance_time() until Controller::get_time() is equal or greater Controller::get_end_time().
Definition at line 22 of file sdc_impl.hpp.
Referenced by pfasst::examples::scalar::run_scalar_sdc(), pfasst::examples::advection_diffusion::run_vanilla_sdc(), and pfasst::examples::vdp::run_vdp_sdc().