Host based encapsulated base sweeper. More...
#include <encap_sweeper.hpp>
Public Member Functions | |
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 | setup (bool coarse) override |
Setup (allocate etc) the sweeper. 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 () |
virtual void | advance () override |
Advance from one time step to the next. More... | |
virtual void | reevaluate (bool initial_only=false) |
Re-evaluate function values. More... | |
virtual void | integrate (time dt, vector< shared_ptr< Encapsulation< time >>> dst) const |
Integrates values of right hand side at all time nodes \( t \in [0,M-1] \) simultaneously. More... | |
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 | predict (bool initial)=0 |
Perform a predictor sweep. More... | |
virtual void | sweep ()=0 |
Perform one SDC sweep/iteration. 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 Attributes | |
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... | |
Host based encapsulated base sweeper.
time | time precision; defaults to pfasst::time_precision |
Definition at line 30 of file encap_sweeper.hpp.
pfasst::encap::EncapSweeper< time >::EncapSweeper | ( | ) |
Definition at line 16 of file encap_sweeper_impl.hpp.
|
overridevirtual |
Advance from one time step to the next.
NotImplementedYet | This function is required by EncapSweeper |
Implements pfasst::ISweeper< time >.
Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >, pfasst::encap::IMEXSweeper< time >, and pfasst::encap::ImplicitSweeper< time >.
Definition at line 161 of file encap_sweeper_impl.hpp.
|
overridevirtual |
Reimplemented from pfasst::ISweeper< time >.
Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >.
Definition at line 263 of file encap_sweeper_impl.hpp.
References pfasst::ICommunicator::rank(), and pfasst::ICommunicator::size().
|
overridevirtual |
Return convergence status.
Reimplemented from pfasst::ISweeper< time >.
Definition at line 218 of file encap_sweeper_impl.hpp.
References pfasst::examples::boris::norm0(), and pfasst::encap::solution.
|
virtual |
Definition at line 152 of file encap_sweeper_impl.hpp.
|
virtual |
Definition at line 146 of file encap_sweeper_impl.hpp.
|
virtual |
Definition at line 134 of file encap_sweeper_impl.hpp.
Referenced by pfasst::encap::IMEXSweeper< time >::sweep_with_left(), and pfasst::encap::IMEXSweeper< time >::sweep_without_left().
|
virtual |
Definition at line 122 of file encap_sweeper_impl.hpp.
|
virtual |
Retrieve solution values of previous iteration at time node index m
.
[in] | m | 0-based index of time node |
Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >.
Definition at line 35 of file encap_sweeper_impl.hpp.
|
virtual |
Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >.
Definition at line 128 of file encap_sweeper_impl.hpp.
Referenced by pfasst::examples::advection_diffusion::run_serial_mlsdc().
|
virtual |
Retrieve solution values of current iteration at time node index m
.
[in] | m | 0-based index of time node |
Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >.
Definition at line 23 of file encap_sweeper_impl.hpp.
|
virtual |
Retrieve FAS correction of current iteration at time node index m
.
[in] | m | 0-based index of time node |
Definition at line 29 of file encap_sweeper_impl.hpp.
|
virtual |
Integrates values of right hand side at all time nodes \( t \in [0,M-1] \) simultaneously.
[in] | dt | width of the time interval to integrate |
[in,out] | dst | integrated values |
NotImplementedYet | This function is required by EncapSweeper |
Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >, pfasst::encap::IMEXSweeper< time >, and pfasst::encap::ImplicitSweeper< time >.
Definition at line 180 of file encap_sweeper_impl.hpp.
References UNUSED.
|
overridevirtual |
Reimplemented from pfasst::ISweeper< time >.
Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >.
Definition at line 242 of file encap_sweeper_impl.hpp.
|
overridevirtual |
Reimplemented from pfasst::ISweeper< time >.
Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >.
Definition at line 254 of file encap_sweeper_impl.hpp.
|
virtual |
Re-evaluate function values.
[in] | initial_only | whether the right hand side should only be evaluated at the initial time point |
NotImplementedYet | This function is required by EncapSweeper |
Reimplemented in pfasst::encap::IMEXSweeper< time >, and pfasst::encap::ImplicitSweeper< time >.
Definition at line 170 of file encap_sweeper_impl.hpp.
References UNUSED.
|
virtual |
Compute residual at each SDC node (including FAS corrections).
[in] | dt | width of the time interval to compute the residual for |
[in,out] | dst | place to store the residuals at time nodes |
NotImplementedYet | This function is required by EncapSweeper for residual computation |
Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >, and pfasst::encap::IMEXSweeper< time >.
Definition at line 199 of file encap_sweeper_impl.hpp.
References UNUSED.
|
overridevirtual |
Save states (and/or function values) at all nodes.
Reimplemented from pfasst::ISweeper< time >.
Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >.
Definition at line 103 of file encap_sweeper_impl.hpp.
|
overridevirtual |
Reimplemented from pfasst::ISweeper< time >.
Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >.
Definition at line 248 of file encap_sweeper_impl.hpp.
|
virtual |
Definition at line 140 of file encap_sweeper_impl.hpp.
|
overridevirtual |
Set options from command line etc.
Reimplemented from pfasst::ISweeper< time >.
Definition at line 53 of file encap_sweeper_impl.hpp.
|
virtual |
Definition at line 116 of file encap_sweeper_impl.hpp.
void pfasst::encap::EncapSweeper< time >::set_residual_tolerances | ( | time | abs_residual_tol, |
time | rel_residual_tol, | ||
int | order = 0 |
||
) |
Set residual tolerances for convergence checking.
[in] | abs_residual_tol | tolerance for the absolute residual |
[in] | rel_residual_tol | tolerance for the relative residual |
[in] | order |
Definition at line 187 of file encap_sweeper_impl.hpp.
|
overridevirtual |
Setup (allocate etc) the sweeper.
Reimplemented from pfasst::ISweeper< time >.
Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >, pfasst::encap::IMEXSweeper< time >, and pfasst::encap::ImplicitSweeper< time >.
Definition at line 68 of file encap_sweeper_impl.hpp.
References pfasst::encap::solution.
Referenced by pfasst::encap::ImplicitSweeper< time >::setup(), pfasst::encap::IMEXSweeper< time >::setup(), and pfasst::examples::boris::BorisSweeper< scalar, time >::setup().
|
overridevirtual |
Initialize solution values at all time nodes with meaningful values.
This implementation simply copies the initial value (see EncapSweeper::get_start_state()) to all time nodes.
Reimplemented from pfasst::ISweeper< time >.
Reimplemented in pfasst::examples::boris::BorisSweeper< scalar, time >.
Definition at line 95 of file encap_sweeper_impl.hpp.
|
protected |
Tolerance for absolute residual.
The absolute residual is the residual between the very first iteration and the current state.
Definition at line 92 of file encap_sweeper.hpp.
|
protected |
Current solution at \( T_{end} \).
Definition at line 45 of file encap_sweeper.hpp.
|
protected |
Encapsulation data structure factory.
Definition at line 39 of file encap_sweeper.hpp.
|
protected |
FAS corrections \( \tau \) at all time nodes of the current iteration.
The index of the vector corresponds to the index of the quadrature nodes, i.e. fas_corrections.size() == quadrature->get_num_nodes()
.
Definition at line 79 of file encap_sweeper.hpp.
|
protected |
Definition at line 102 of file encap_sweeper.hpp.
|
protected |
Quadrature rule used by this sweeper.
Definition at line 36 of file encap_sweeper.hpp.
|
protected |
Tolerance for relative residual.
The relative residual is the residual between the previous iteration and current state.
Definition at line 99 of file encap_sweeper.hpp.
|
protected |
Definition at line 84 of file encap_sweeper.hpp.
|
protected |
Place for the residuals at the different time nodes.
The index of the vector corresponds to the index of the quadrature nodes, i.e. residuals.size() == quadrature->get_num_nodes()
.
Definition at line 53 of file encap_sweeper.hpp.
|
protected |
Solution values \( U \) at all time nodes of the previous iteration.
The index of the vector corresponds to the index of the quadrature nodes, i.e. saved_state.size() == quadrature->get_num_nodes()
.
Definition at line 71 of file encap_sweeper.hpp.
|
protected |
Separate start state, i.e. initial condition for the sweeper's current time step.
Definition at line 42 of file encap_sweeper.hpp.
|
protected |
Solution values \( U \) at all time nodes of the current iteration.
The index of the vector corresponds to the index of the quadrature nodes, i.e. state.size() == quadrature->get_num_nodes()
.
Definition at line 63 of file encap_sweeper.hpp.