PFASST++
pfasst::encap::ImplicitSweeper< time > Class Template Reference

Implicit sweeper. More...

#include <implicit_sweeper.hpp>

+ Inheritance diagram for pfasst::encap::ImplicitSweeper< time >:
+ Collaboration diagram for pfasst::encap::ImplicitSweeper< time >:

Public Member Functions

 ImplicitSweeper ()=default
 
virtual ~ImplicitSweeper ()=default
 
virtual void setup (bool coarse) override
 Setup (allocate etc) the sweeper. More...
 
virtual void predict (bool initial) override
 Compute low-order provisional solution. More...
 
virtual void sweep () override
 Perform one SDC sweep/iteration. More...
 
virtual void advance () override
 Advance the end solution to start solution. More...
 
virtual void reevaluate (bool initial_only) override
 
virtual void integrate (time dt, vector< shared_ptr< Encapsulation< time >>> dst) const override
 Integrates values of right hand side at all time nodes \( t \in [0,M-1] \) simultaneously. More...
 
virtual void f_impl_eval (shared_ptr< Encapsulation< time >> f_impl_encap, shared_ptr< Encapsulation< time >> u_encap, time t)
 Evaluate the implicit part of the ODE. More...
 
virtual void impl_solve (shared_ptr< Encapsulation< time >> f_encap, shared_ptr< Encapsulation< time >> u_encap, time t, time dt, shared_ptr< Encapsulation< time >> rhs_encap)
 Solve \( U - \Delta t F_{\rm impl}(U) = RHS \) for \( U \). More...
 
- Public Member Functions inherited from pfasst::encap::EncapSweeper< time >
 EncapSweeper ()
 
virtual shared_ptr< Encapsulation< time > > get_state (size_t m) const
 Retrieve solution values of current iteration at time node index m. More...
 
virtual shared_ptr< Encapsulation< time > > get_tau (size_t m) const
 Retrieve FAS correction of current iteration at time node index m. More...
 
virtual shared_ptr< Encapsulation< time > > get_saved_state (size_t m) const
 Retrieve solution values of previous iteration at time node index m. More...
 
virtual void set_options () override
 Set options from command line etc. More...
 
virtual void spread () override
 Initialize solution values at all time nodes with meaningful values. More...
 
virtual void save (bool initial_only) override
 Save states (and/or function values) at all nodes. More...
 
virtual void set_quadrature (shared_ptr< IQuadrature< time >> quadrature)
 
virtual shared_ptr< const IQuadrature< time > > get_quadrature () const
 
virtual const vector< time > get_nodes () const
 
virtual void set_factory (shared_ptr< EncapFactory< time >> factory)
 
virtual shared_ptr< EncapFactory< time > > get_factory () const
 
virtual shared_ptr< Encapsulation< time > > get_start_state () const
 
virtual shared_ptr< Encapsulation< time > > get_end_state ()
 
void set_residual_tolerances (time abs_residual_tol, time rel_residual_tol, int order=0)
 Set residual tolerances for convergence checking. More...
 
virtual void residual (time dt, vector< shared_ptr< Encapsulation< time >>> dst) const
 Compute residual at each SDC node (including FAS corrections). More...
 
virtual bool converged () override
 Return convergence status. More...
 
virtual void post (ICommunicator *comm, int tag) override
 
virtual void send (ICommunicator *comm, int tag, bool blocking) override
 
virtual void recv (ICommunicator *comm, int tag, bool blocking) override
 
virtual void broadcast (ICommunicator *comm) override
 
- Public Member Functions inherited from pfasst::ISweeper< time >
 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 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...
 

Protected Member Functions

void set_end_state ()
 

Protected Attributes

Matrix< time > q_tilde
 
vector< shared_ptr< Encapsulation< time > > > s_integrals
 Node-to-node integrals of \( F(t,u) \) at all time nodes of the current iteration. More...
 
vector< shared_ptr< Encapsulation< time > > > fs_impl
 Values of the implicit part of the right hand side \( F_{impl}(t,u) \) at all time nodes of the current iteration. More...
 
- Protected Attributes inherited from pfasst::encap::EncapSweeper< time >
string FORMAT_STR
 
shared_ptr< IQuadrature< time > > quadrature
 
shared_ptr< EncapFactory< time > > factory
 Encapsulation data structure factory. More...
 
shared_ptr< Encapsulation< time > > start_state
 Separate start state, i.e. initial condition for the sweeper's current time step. More...
 
shared_ptr< Encapsulation< time > > end_state
 Current solution at \( T_{end} \). More...
 
vector< shared_ptr< Encapsulation< time > > > residuals
 Place for the residuals at the different time nodes. More...
 
vector< shared_ptr< Encapsulation< time > > > state
 Solution values \( U \) at all time nodes of the current iteration. More...
 
vector< shared_ptr< Encapsulation< time > > > saved_state
 Solution values \( U \) at all time nodes of the previous iteration. More...
 
vector< shared_ptr< Encapsulation< time > > > fas_corrections
 FAS corrections \( \tau \) at all time nodes of the current iteration. More...
 
int residual_norm_order
 
time abs_residual_tol
 Tolerance for absolute residual. More...
 
time rel_residual_tol
 Tolerance for relative residual. More...
 
- Protected Attributes inherited from pfasst::ISweeper< time >
Controller< time > * controller
 Backreference to the controller managing the sweeper instance. More...
 

Detailed Description

template<typename time = time_precision>
class pfasst::encap::ImplicitSweeper< time >

Implicit sweeper.

Template Parameters
timeprecision type of the time dimension

Definition at line 24 of file implicit_sweeper.hpp.

Constructor & Destructor Documentation

template<typename time = time_precision>
pfasst::encap::ImplicitSweeper< time >::ImplicitSweeper ( )
default
template<typename time = time_precision>
virtual pfasst::encap::ImplicitSweeper< time >::~ImplicitSweeper ( )
virtualdefault

Member Function Documentation

template<typename time >
void pfasst::encap::ImplicitSweeper< time >::advance ( )
overridevirtual

Advance the end solution to start solution.

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

Definition at line 181 of file implicit_sweeper_impl.hpp.

template<typename time = time_precision>
virtual void pfasst::encap::ImplicitSweeper< time >::f_impl_eval ( shared_ptr< Encapsulation< time >>  f_impl_encap,
shared_ptr< Encapsulation< time >>  u_encap,
time  t 
)
inlinevirtual

Evaluate the implicit part of the ODE.

This is typically called to compute the implicit part of the right hand side at the first collocation node, and on all nodes after restriction or interpolation.

Parameters
[in,out]f_impl_encapEncapsulation to store the implicit function evaluation.
[in]u_encapEncapsulation storing the solution state at which to evaluate the implicit part of the ODE.
[in]tTime point of the evaluation.
Note
This method must be implemented in derived sweepers.

Definition at line 108 of file implicit_sweeper.hpp.

References UNUSED.

template<typename time = time_precision>
virtual void pfasst::encap::ImplicitSweeper< time >::impl_solve ( shared_ptr< Encapsulation< time >>  f_encap,
shared_ptr< Encapsulation< time >>  u_encap,
time  t,
time  dt,
shared_ptr< Encapsulation< time >>  rhs_encap 
)
inlinevirtual

Solve \( U - \Delta t F_{\rm impl}(U) = RHS \) for \( U \).

During an implicit SDC sweep, the correction equation is evolved using a backward-Euler stepper. This routine (implemented by the user) performs the solve required to perform one backward-Euler sub-step, and also returns \( F_{\rm impl}(U) \).

Parameters
[in,out]f_encapEncapsulation to store the evaluated implicit piece.
[in,out]u_encapEncapsulation to store the solution of the backward-Euler sub-step.
[in]ttime point (of \( RHS \)).
[in]dtsub-step size to the previous time point (\( \Delta t \)).
[in]rhs_encapEncapsulation that stores \( RHS \).
Note
This method must be implemented in derived sweepers.

Definition at line 131 of file implicit_sweeper.hpp.

References UNUSED.

template<typename time >
void pfasst::encap::ImplicitSweeper< time >::integrate ( time  dt,
vector< shared_ptr< Encapsulation< time >>>  dst 
) const
overridevirtual

Integrates values of right hand side at all time nodes \( t \in [0,M-1] \) simultaneously.

Parameters
[in]dtwidth of time interval to integrate over
[in,out]dstintegrated values; will get zeroed out beforehand

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

Definition at line 201 of file implicit_sweeper_impl.hpp.

template<typename time >
void pfasst::encap::ImplicitSweeper< time >::predict ( bool  initial)
overridevirtual

Compute low-order provisional solution.

This performs forward/backward Euler steps across the nodes to compute a low-order provisional solution.

Parameters
[in]initialif true the explicit and implicit part of the right hand side of the ODE get evaluated with the initial value

Implements pfasst::ISweeper< time >.

Definition at line 122 of file implicit_sweeper_impl.hpp.

References pfasst::encap::augment(), plot::dt, ML_CLOG, plot::t, and UNUSED.

+ Here is the call graph for this function:

template<typename time >
void pfasst::encap::ImplicitSweeper< time >::reevaluate ( bool  initial_only)
overridevirtual

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

Definition at line 187 of file implicit_sweeper_impl.hpp.

References plot::dt.

template<typename time >
void pfasst::encap::ImplicitSweeper< time >::set_end_state ( )
protected

Definition at line 79 of file implicit_sweeper_impl.hpp.

template<typename time >
void pfasst::encap::ImplicitSweeper< time >::setup ( bool  coarse)
overridevirtual

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 from pfasst::encap::EncapSweeper< time >.

Definition at line 91 of file implicit_sweeper_impl.hpp.

References pfasst::encap::function, pfasst::encap::lu_decomposition(), ML_CLOG, pfasst::encap::EncapSweeper< time >::setup(), and pfasst::encap::solution.

+ Here is the call graph for this function:

template<typename time >
void pfasst::encap::ImplicitSweeper< time >::sweep ( )
overridevirtual

Perform one SDC sweep/iteration.

This computes a high-order solution from the previous iteration's function values and corrects it using forward/backward Euler steps across the nodes.

Implements pfasst::ISweeper< time >.

Definition at line 142 of file implicit_sweeper_impl.hpp.

References pfasst::encap::augment(), plot::dt, ML_CLOG, pfasst::encap::solution, and plot::t.

+ Here is the call graph for this function:

Member Data Documentation

template<typename time = time_precision>
vector<shared_ptr<Encapsulation<time> > > pfasst::encap::ImplicitSweeper< time >::fs_impl
protected

Values of the implicit part of the right hand side \( F_{impl}(t,u) \) at all time nodes of the current iteration.

Definition at line 38 of file implicit_sweeper.hpp.

template<typename time = time_precision>
Matrix<time> pfasst::encap::ImplicitSweeper< time >::q_tilde
protected

Definition at line 41 of file implicit_sweeper.hpp.

template<typename time = time_precision>
vector<shared_ptr<Encapsulation<time> > > pfasst::encap::ImplicitSweeper< time >::s_integrals
protected

Node-to-node integrals of \( F(t,u) \) at all time nodes of the current iteration.

Definition at line 32 of file implicit_sweeper.hpp.


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