Base SDC/MLSDC/PFASST controller. More...
#include <interface.hpp>
Classes | |
class | LevelIter |
Level (MLSDC/PFASST) iterator. More... | |
Public Member Functions | |
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... | |
Protected Attributes | |
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... | |
Base SDC/MLSDC/PFASST controller.
Base controller (see also SDC, MLSDC, and PFASST controllers).
time | time precision; defaults to pfasst::time_precision |
Definition at line 31 of file interface.hpp.
pfasst::Controller< time >::Controller | ( | ) |
Definition at line 9 of file interface_impl.hpp.
|
virtual |
Definition at line 19 of file interface_impl.hpp.
|
virtual |
Adding a level to the controller.
[in] | sweeper | sweeper representing the level |
[in] | transfer | corresponding transfer operator for the level |
[in] | coarse | whether to add this level as a coarser one to the list of existing |
Definition at line 72 of file interface_impl.hpp.
Referenced by pfasst::examples::boris::run_boris_pfasst(), pfasst::examples::boris::run_boris_sdc(), pfasst::examples::advection_diffusion::run_mpi_pfasst(), pfasst::examples::scalar::run_scalar_sdc(), pfasst::examples::advection_diffusion::run_serial_mlsdc(), pfasst::examples::advection_diffusion::run_vanilla_sdc(), and pfasst::examples::vdp::run_vdp_sdc().
|
virtual |
Advance to the next iteration.
This method may or may not trigger additional post-iteration procedures.
Definition at line 147 of file interface_impl.hpp.
|
virtual |
Advance to a following time step.
[in] | nsteps | number of time steps to advance; 1 meaning the next step |
Definition at line 117 of file interface_impl.hpp.
|
virtual |
Convenience accessor to the coarsest level.
Definition at line 165 of file interface_impl.hpp.
Referenced by pfasst::examples::advection_diffusion::run_serial_mlsdc().
|
virtual |
Convenience accessor to the finest level.
Definition at line 159 of file interface_impl.hpp.
Referenced by pfasst::examples::advection_diffusion::run_serial_mlsdc().
|
inline |
Get coarsest level.
R | type of the level sweeper |
level=0
Definition at line 175 of file interface.hpp.
|
inline |
Get width of current time step (alias for get_step_size).
Definition at line 230 of file interface.hpp.
|
virtual |
Get end time point of last time step.
Definition at line 124 of file interface_impl.hpp.
|
inline |
Get coarsest level.
R | type of the level sweeper |
level=(Controller::nlevels() - 1)
Definition at line 163 of file interface.hpp.
Referenced by pfasst::examples::boris::run_boris_pfasst(), pfasst::examples::boris::run_boris_sdc(), pfasst::examples::advection_diffusion::run_mpi_pfasst(), and pfasst::examples::advection_diffusion::run_serial_mlsdc().
|
virtual |
Get current iteration index of current time step.
Definition at line 130 of file interface_impl.hpp.
|
inline |
Get sweeper for level with index level
.
R | type of the level sweeper |
R
for requested levelDefinition at line 149 of file interface.hpp.
|
virtual |
Get maximum number of allowed iterations per time step.
Definition at line 153 of file interface_impl.hpp.
|
virtual |
Get current time step index.
The time step number is zero-based, i.e. the first time step has index 0
.
Definition at line 92 of file interface_impl.hpp.
|
virtual |
Get width of current time step.
Definition at line 105 of file interface_impl.hpp.
References plot::dt.
|
inline |
Get start time point of current time step (alias for get_time).
Definition at line 244 of file interface.hpp.
|
virtual |
Get start time point of current time step.
Definition at line 111 of file interface_impl.hpp.
References plot::t.
|
inline |
Retreive transfer operator for level level
.
R | type of the requested transfer operator |
[in] | level | level index to retreive transfer operator for |
R
for desired levelDefinition at line 193 of file interface.hpp.
|
virtual |
Total number of levels controlled by this Controller.
Definition at line 86 of file interface_impl.hpp.
|
virtual |
Set basic time scope of the Controller.
[in] | t0 | time start point of the first time step |
[in] | tend | time end point of the last time step |
[in] | dt | width of one time step |
[in] | niters | maximum number of iterations per time step The total number of time steps will get computed internally if required. |
Definition at line 61 of file interface_impl.hpp.
References plot::dt, and plot::t.
Referenced by pfasst::examples::boris::run_boris_pfasst(), pfasst::examples::boris::run_boris_sdc(), pfasst::examples::advection_diffusion::run_mpi_pfasst(), pfasst::examples::scalar::run_scalar_sdc(), pfasst::examples::advection_diffusion::run_serial_mlsdc(), pfasst::examples::advection_diffusion::run_vanilla_sdc(), and pfasst::examples::vdp::run_vdp_sdc().
|
virtual |
Set current iteration of current time step.
[in] | iter | iteration index to set |
Definition at line 136 of file interface_impl.hpp.
|
virtual |
Set options from command line etc.
[in] | all_sweepers | if given also calls ISweeper::set_options for all already added levels |
Definition at line 30 of file interface_impl.hpp.
References plot::dt.
Referenced by pfasst::examples::boris::run_boris_pfasst(), pfasst::examples::advection_diffusion::run_mpi_pfasst(), pfasst::examples::advection_diffusion::run_serial_mlsdc(), and pfasst::examples::advection_diffusion::run_vanilla_sdc().
|
virtual |
Set current time step index.
[in] | n | index of new time step |
Definition at line 98 of file interface_impl.hpp.
|
virtual |
Basic setup routine for this controller.
Reimplemented in pfasst::MLSDC< time >.
Definition at line 52 of file interface_impl.hpp.
Referenced by pfasst::examples::scalar::run_scalar_sdc(), pfasst::examples::advection_diffusion::run_vanilla_sdc(), and pfasst::examples::vdp::run_vdp_sdc().
|
protected |
Width of current time step (\( \Delta t \)).
Definition at line 76 of file interface.hpp.
|
protected |
Current iteration index on current time step.
Definition at line 61 of file interface.hpp.
|
protected |
Ordered list of all levels.
A level is represented by a sweeper implementing the ISweeper interface.
0
) to finest. Definition at line 42 of file interface.hpp.
|
protected |
Maximum iterations per time step.
Definition at line 66 of file interface.hpp.
|
protected |
Current time step index.
Definition at line 56 of file interface.hpp.
|
protected |
\( t_0 \) of current time step.
Definition at line 71 of file interface.hpp.
|
protected |
\( T_{end} \) of last time step.
Definition at line 81 of file interface.hpp.
|
protected |
Ordered list of transfer operators for levels.
A transfer operator for a level must implement the ITransfer interface.
Definition at line 49 of file interface.hpp.