Implicit sweeper. More...
#include <implicit_sweeper.hpp>
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... | |
![]() | |
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 |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
Controller< time > * | controller |
Backreference to the controller managing the sweeper instance. More... | |
Implicit sweeper.
time | precision type of the time dimension |
Definition at line 24 of file implicit_sweeper.hpp.
|
default |
|
virtualdefault |
|
overridevirtual |
Advance the end solution to start solution.
Reimplemented from pfasst::encap::EncapSweeper< time >.
Definition at line 181 of file implicit_sweeper_impl.hpp.
|
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.
[in,out] | f_impl_encap | Encapsulation to store the implicit function evaluation. |
[in] | u_encap | Encapsulation storing the solution state at which to evaluate the implicit part of the ODE. |
[in] | t | Time point of the evaluation. |
Definition at line 108 of file implicit_sweeper.hpp.
References UNUSED.
|
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) \).
[in,out] | f_encap | Encapsulation to store the evaluated implicit piece. |
[in,out] | u_encap | Encapsulation to store the solution of the backward-Euler sub-step. |
[in] | t | time point (of \( RHS \)). |
[in] | dt | sub-step size to the previous time point (\( \Delta t \)). |
[in] | rhs_encap | Encapsulation that stores \( RHS \). |
Definition at line 131 of file implicit_sweeper.hpp.
References UNUSED.
|
overridevirtual |
Integrates values of right hand side at all time nodes \( t \in [0,M-1] \) simultaneously.
[in] | dt | width of time interval to integrate over |
[in,out] | dst | integrated values; will get zeroed out beforehand |
Reimplemented from pfasst::encap::EncapSweeper< time >.
Definition at line 201 of file implicit_sweeper_impl.hpp.
|
overridevirtual |
Compute low-order provisional solution.
This performs forward/backward Euler steps across the nodes to compute a low-order provisional solution.
[in] | initial | if 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.
|
overridevirtual |
Reimplemented from pfasst::encap::EncapSweeper< time >.
Definition at line 187 of file implicit_sweeper_impl.hpp.
References plot::dt.
|
protected |
Definition at line 79 of file implicit_sweeper_impl.hpp.
|
overridevirtual |
Setup (allocate etc) the sweeper.
[in] | coarse | true 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.
|
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.
|
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.
|
protected |
Definition at line 41 of file implicit_sweeper.hpp.
|
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.