C++QEDCore  2.100.2 (v2 Milestone 10 Development branch)
a framework for simulating open quantum dynamics – core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
trajectory::Adaptive< A > Class Template Referenceabstract

Adaptive is basically an evolved::Evolved wrapped into the Trajectory interface. More...

#include <Trajectory.h>

+ Inheritance diagram for trajectory::Adaptive< A >:
+ Collaboration diagram for trajectory::Adaptive< A >:

Public Types

typedef evolved::Evolved< A > Evolved
 

Public Member Functions

void step (double deltaT)
 corresponding to Evolved::step, it takes a single adaptive step More...
 
- Public Member Functions inherited from trajectory::AdaptiveIO< A >
 AdaptiveIO (Ptr)
 
cpputils::iarchivereadState (cpputils::iarchive &iar)
 Read in the EvolvedIO from a cpputils::iarchive. More...
 
cpputils::oarchivewriteState (cpputils::oarchive &oar) const
 Write the EvolvedIO to a cpputils::oarchive.
 
double getTime () const
 Returns the time of the underlying EvolvedIO.
 
- Public Member Functions inherited from trajectory::Trajectory
void evolve (double deltaT)
 Propagation for a time interval of exactly deltaT.
 
std::ostream & display (std::ostream &, int precision) const
 Displays a limited set of relevant physical and numerical information about the actual state of Trajectory at the actual time instant. More...
 
std::ostream & displayParameters (std::ostream &os) const
 print header
 
std::ostream & logOnEnd (std::ostream &os) const
 print a log at the end summarizing overall (e.g. time-averaged) physical and numerical data during the run
 
double getTime () const
 actual time instant
 
double getDtDid () const
 last perfomed timestep
 
cpputils::iarchivereadState (cpputils::iarchive &iar)
 read from an archive
 
cpputils::oarchivewriteState (cpputils::oarchive &oar) const
 write to an archive
 

Protected Types

typedef Evolved::ConstPtr ConstPtr
 
typedef Evolved::Ptr Ptr
 

Protected Member Functions

 Adaptive (A &, typename Evolved::Derivs, double, double, double, const A &, const evolved::Maker< A > &)
 Constructor taking the same parameters as needed to operate evolved::Maker.
 
 Adaptive (A &, typename Evolved::Derivs, double, const ParsEvolved &, const A &, const evolved::Maker< A > &)
 
const std::string trajectoryID () const
 redirected to a pure virtual, this is needed for serialization of trajectory metadata
 
std::ostream & displayParameters_v (std::ostream &) const override
 
virtual cpputils::iarchivereadStateMore_v (cpputils::iarchive &iar)
 hook into Trajectory::readState
 
virtual cpputils::oarchivewriteStateMore_v (cpputils::oarchive &oar) const
 hook into Trajectory::writeState
 
Getters
const ConstPtr getEvolved () const
 
const Ptr getEvolved ()
 
double getDtTry () const
 
- Protected Member Functions inherited from trajectory::AdaptiveIO< A >
const Ptr getEvolvedIO () const
 note: not the same const-correctness as in Adaptive
 

Related Functions

(Note that these are not member functions.)

template<typename A >
void run (Adaptive< A > &, double time, int dc, unsigned sdf, const std::string &ofn, const std::string &initialFileName, int precision, bool displayInfo, bool firstStateDisplay, double autoStopEpsilon, unsigned autoStopRepetition, const std::string &parsedCommandLine)
 Another version of run for running in dc-mode. More...
 
template<typename A >
void run (Adaptive< A > &, const ParsRun &)
 Dispatcher. More...
 

Additional Inherited Members

- Protected Attributes inherited from trajectory::AdaptiveIO< A >
SerializationMetadata meta_
 

Detailed Description

template<typename A>
class trajectory::Adaptive< A >

Adaptive is basically an evolved::Evolved wrapped into the Trajectory interface.

The class stores an evolved::Evolved instance by shared pointer

Definition at line 288 of file Trajectory.h.

Constructor & Destructor Documentation

template<typename A>
trajectory::Adaptive< A >::Adaptive ( A &  ,
typename Evolved::Derivs  ,
double  ,
const ParsEvolved ,
const A &  ,
const evolved::Maker< A > &   
)
protected

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Member Function Documentation

template<typename A>
void trajectory::Adaptive< A >::step ( double  deltaT)
inline

corresponding to Evolved::step, it takes a single adaptive step

It does not delegate directly to Evolved::step, as usually trajectories need to do more for a step than just propagating the ODE: instead, it is kept purely virtual

Parameters
deltaTmaximum length of the timestep

Definition at line 298 of file Trajectory.h.

Friends And Related Function Documentation

template<typename A >
void run ( Adaptive< A > &  ,
double  time,
int  dc,
unsigned  sdf,
const std::string &  ofn,
const std::string &  initialFileName,
int  precision,
bool  displayInfo,
bool  firstStateDisplay,
double  autoStopEpsilon,
unsigned  autoStopRepetition,
const std::string &  parsedCommandLine 
)
related

Another version of run for running in dc-mode.

Since in addition to the Trajectory interface, Adaptive has also the capability to be propagated over a single adaptive timestep, it is possible to count the individual ODE steps. Running in dc-mode means that a fixed number of adaptive steps are performed between each display. Hence, we get denser displays in time when the timestep is small, that is, when the important things are happening in the dynamics.

Parameters
dcnumber of adaptive timesteps taken between two displays
template<typename A >
void run ( Adaptive< A > &  ,
const ParsRun  
)
related

Dispatcher.

  • Runs run(Adaptive&, double, int, unsigned, const std::string&, const std::string&, int, bool, bool) if p.dc is nonzero (dc-mode)
  • delegates to run(Trajectory&, const ParsRun& p) otherwise (deltaT-mode)
Note
This means that ParsRun::dc takes precedence over ParsRun::Dt

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