PFASST++
pfasst::ISweeper< time > Class Template Referenceabstract

Abstract SDC sweeper. More...

#include <interfaces.hpp>

+ Inheritance diagram for pfasst::ISweeper< time >:
+ Collaboration diagram for pfasst::ISweeper< time >:

Public Member Functions

 ISweeper ()
 
virtual ~ISweeper ()
 
virtual void set_controller (Controller< time > *ctrl)
 Set the sweepers controller. More...
 
virtual Controller< time > * get_controller ()
 Accessor to the controller managing this sweeper. More...
 
virtual void set_options ()
 Set options from command line etc. More...
 
virtual void setup (bool coarse=false)
 Setup (allocate etc) the sweeper. More...
 
virtual void predict (bool initial)=0
 Perform a predictor sweep. More...
 
virtual void sweep ()=0
 Perform one SDC sweep/iteration. More...
 
virtual void advance ()=0
 Advance from one time step to the next. More...
 
virtual bool converged ()
 Return convergence status. More...
 
virtual void save (bool initial_only=false)
 Save states (and/or function values) at all nodes. More...
 
virtual void spread ()
 Initialize solution values at all time nodes with meaningful values. More...
 
virtual void post_sweep ()
 Hook automatically run after each completed sweep. More...
 
virtual void post_predict ()
 Hook automatically run after each completed predict. More...
 
virtual void post_step ()
 Hook automatically run after each completed time step. More...
 
virtual void post (ICommunicator *comm, int tag)
 
virtual void send (ICommunicator *comm, int tag, bool blocking)
 
virtual void recv (ICommunicator *comm, int tag, bool blocking)
 
virtual void broadcast (ICommunicator *comm)
 

Protected Attributes

Controller< time > * controller
 Backreference to the controller managing the sweeper instance. More...
 

Detailed Description

template<typename time = time_precision>
class pfasst::ISweeper< time >

Abstract SDC sweeper.

Template Parameters
timetime precision; defaults to pfasst::time_precision

Definition at line 164 of file interfaces.hpp.

Constructor & Destructor Documentation

template<typename time >
pfasst::ISweeper< time >::ISweeper ( )

Definition at line 91 of file interfaces_impl.hpp.

template<typename time >
pfasst::ISweeper< time >::~ISweeper ( )
virtual

Definition at line 96 of file interfaces_impl.hpp.

Member Function Documentation

template<typename time = time_precision>
virtual void pfasst::ISweeper< time >::advance ( )
pure virtual

Advance from one time step to the next.

Essentially this means copying the solution and function values from the last node to the first node.

Implemented in pfasst::examples::boris::BorisSweeper< scalar, time >, pfasst::encap::EncapSweeper< time >, pfasst::encap::IMEXSweeper< time >, and pfasst::encap::ImplicitSweeper< time >.

template<typename time >
void pfasst::ISweeper< time >::broadcast ( ICommunicator comm)
virtual
Exceptions
NotImplementedYetThis function is required by PFASST

Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >, and pfasst::encap::EncapSweeper< time >.

Definition at line 205 of file interfaces_impl.hpp.

References UNUSED.

template<typename time >
bool pfasst::ISweeper< time >::converged ( )
virtual

Return convergence status.

This is used by controllers to shortcircuit iterations.

Returns
Unless overwritten by implementations, this will always return false.

Reimplemented in pfasst::encap::EncapSweeper< time >.

Definition at line 139 of file interfaces_impl.hpp.

template<typename time >
Controller< time > * pfasst::ISweeper< time >::get_controller ( )
virtual

Accessor to the controller managing this sweeper.

Returns
controller managing this sweeper

Definition at line 114 of file interfaces_impl.hpp.

template<typename time >
void pfasst::ISweeper< time >::post ( ICommunicator comm,
int  tag 
)
virtual
template<typename time >
void pfasst::ISweeper< time >::post_predict ( )
virtual
template<typename time >
void pfasst::ISweeper< time >::post_step ( )
virtual

Hook automatically run after each completed time step.

Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >.

Definition at line 172 of file interfaces_impl.hpp.

template<typename time >
void pfasst::ISweeper< time >::post_sweep ( )
virtual
template<typename time = time_precision>
virtual void pfasst::ISweeper< time >::predict ( bool  initial)
pure virtual

Perform a predictor sweep.

Compute a provisional solution from the initial condition. This is typically very similar to a regular SDC sweep, except that integral terms based on previous iterations don't exist yet.

Parameters
[in]initialtrue if function values at the first node need to be computed. false if functions values at the first node already exist (usually this is the case when advancing from one time step to the next).

Implemented in pfasst::examples::boris::BorisSweeper< scalar, time >, pfasst::encap::IMEXSweeper< time >, and pfasst::encap::ImplicitSweeper< time >.

template<typename time >
void pfasst::ISweeper< time >::recv ( ICommunicator comm,
int  tag,
bool  blocking 
)
virtual
Exceptions
NotImplementedYetThis function is required by PFASST

Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >, and pfasst::encap::EncapSweeper< time >.

Definition at line 195 of file interfaces_impl.hpp.

References UNUSED.

template<typename time >
void pfasst::ISweeper< time >::save ( bool  initial_only = false)
virtual

Save states (and/or function values) at all nodes.

This is typically done in MLSDC/PFASST immediately after a call to restrict. The saved states are used to compute deltas during interpolation.

Parameters
[in]initial_onlyflag indicating whether only the initial state should be saved
Note
This method must be implemented in derived sweepers.
Exceptions
NotImplementedYetThis function is required by MLSDC and PFASST

Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >, and pfasst::encap::EncapSweeper< time >.

Definition at line 148 of file interfaces_impl.hpp.

References UNUSED.

template<typename time >
void pfasst::ISweeper< time >::send ( ICommunicator comm,
int  tag,
bool  blocking 
)
virtual
Exceptions
NotImplementedYetThis function is required by PFASST

Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >, and pfasst::encap::EncapSweeper< time >.

Definition at line 185 of file interfaces_impl.hpp.

References UNUSED.

template<typename time >
void pfasst::ISweeper< time >::set_controller ( Controller< time > *  ctrl)
virtual

Set the sweepers controller.

Parameters
[in]ctrlnew controller to manage this sweeper
Todo:
Consider asserting presence of the given pointer to the controller.

Definition at line 103 of file interfaces_impl.hpp.

template<typename time >
void pfasst::ISweeper< time >::set_options ( )
virtual

Set options from command line etc.

Reimplemented in pfasst::encap::EncapSweeper< time >.

Definition at line 126 of file interfaces_impl.hpp.

template<typename time >
void pfasst::ISweeper< time >::setup ( bool  coarse = false)
virtual

Setup (allocate etc) the sweeper.

Parameters
[in]coarsetrue if this sweeper exists on a coarsened MLSDC or PFASST level. This implies that space for an FAS correction and "saved" solutions are necessary.

Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >, pfasst::encap::EncapSweeper< time >, pfasst::encap::IMEXSweeper< time >, and pfasst::encap::ImplicitSweeper< time >.

Definition at line 130 of file interfaces_impl.hpp.

References UNUSED.

template<typename time >
void pfasst::ISweeper< time >::spread ( )
virtual

Initialize solution values at all time nodes with meaningful values.

Exceptions
NotImplementedYetThis function is required by PFASST

Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >, and pfasst::encap::EncapSweeper< time >.

Definition at line 158 of file interfaces_impl.hpp.

template<typename time = time_precision>
virtual void pfasst::ISweeper< time >::sweep ( )
pure virtual

Perform one SDC sweep/iteration.

Compute a correction and update solution values. Note that this function can assume that valid function values exist from a previous pfasst::ISweeper::sweep() or pfasst::ISweeper::predict().

Implemented in pfasst::examples::boris::BorisSweeper< scalar, time >, pfasst::encap::IMEXSweeper< time >, and pfasst::encap::ImplicitSweeper< time >.

Member Data Documentation

template<typename time = time_precision>
Controller<time>* pfasst::ISweeper< time >::controller
protected

Backreference to the controller managing the sweeper instance.

Definition at line 170 of file interfaces.hpp.


The documentation for this class was generated from the following files: