An ensemble of Averageable trajectories providing services for ensemble averaging and evolving the element trajectories serially. More...
#include <StochasticTrajectory.h>
Public Types | |
typedef Averageable< T_ELEM > | Elem |
typedef boost::ptr_vector< Elem > | Impl |
The storage of the element trajectories is through a pointer-vector More... | |
typedef T | ToBeAveragedType |
Public Member Functions | |
const ToBeAveragedType | averageInRange (size_t begin, size_t n) const |
Averages only in a range begin..begin+n-1 More... | |
Public Member Functions inherited from trajectory::Averageable< T > | |
const T | toBeAveraged () const |
returns the set of quantities condensed in a variable of type T that are “to be averaged” | |
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::iarchive & | readState (cpputils::iarchive &iar) |
read from an archive | |
cpputils::oarchive & | writeState (cpputils::oarchive &oar) const |
write to an archive | |
Protected Types | |
typedef std::auto_ptr< Impl > | Ptr |
Protected Member Functions | |
Ensemble (Ptr trajs, bool displayProgress) | |
Generic constructor. More... | |
const Impl & | getTrajectories () const |
Getter. | |
Serialization | |
virtual cpputils::iarchive & | readState_v (cpputils::iarchive &ios) final |
virtual cpputils::oarchive & | writeState_v (cpputils::oarchive &ios) const final |
Additional Inherited Members | |
Related Functions inherited from trajectory::Trajectory | |
void | run (Trajectory &trajectory, double time, double deltaT, unsigned sdf, const std::string &ofn, const std::string &initialFileName, int precision, bool displayInfo, bool firstStateDisplay, double autoStopEpsilon, unsigned autoStopRepetition, const std::string &parsedCommandLine) |
Running in deltaT mode (displays in equal time intervals) for a certain time. More... | |
void | run (Trajectory &, long nDt, double deltaT, unsigned sdf, const std::string &ofn, const std::string &initialFileName, int precision, bool displayInfo, bool firstStateDisplay, double autoStopEpsilon, unsigned autoStopRepetition, const std::string &parsedCommandLine) |
Same as above but runs for a certain number of time intervals deltaT. More... | |
void | run (Trajectory &, const ParsRun &p) |
Dispatcher. More... | |
An ensemble of Averageable trajectories providing services for ensemble averaging and evolving the element trajectories serially.
The design is recursive: since Ensemble itself inherits from Averageable, it can act as an element in a larger Ensemble.
The elements do not need to have the same type, they only need to have a common Averageable type as a base.
T | The type condensing the quantities to be averaged for Ensemble in its function as an Averageable |
T_ELEM | Same for the Averageables |
At the level of Ensemble, no implicit interface is assumed for T
and T_ELEM
since Ensemble treats variables of these types only via ensemble::Traits. It is important that the way the averaged T
will be calculated from the sequence of T_ELEM
s can be tailored because it might happen that the application cannot afford to store temporaries of T
(for such an example, cf. quantumtrajectory::EnsembleMCWF)
Definition at line 131 of file StochasticTrajectory.h.
typedef boost::ptr_vector<Elem> trajectory::Ensemble< T, T_ELEM >::Impl |
The storage of the element trajectories is through a pointer-vector
This correctly handles the elements’s eventual polymorphy and allows for random access to individual trajectories (cf. averageInRange())
Definition at line 141 of file StochasticTrajectory.h.
|
inlineprotected |
Generic constructor.
trajs | the sequence of elements owned by the ptr_vector |
displayProgress | when true, a display of progress through the element trajectories will show up on cerr at each step of time evolution |
Definition at line 155 of file StochasticTrajectory.h.
const ToBeAveragedType trajectory::Ensemble< T, T_ELEM >::averageInRange | ( | size_t | begin, |
size_t | n | ||
) | const |
Averages only in a range begin..begin+n-1
It could be called toBeAveraged
as well, but it is not good to redefine an inherited non-virtual function.