The base class of the trajectory-bundle condensing the quintessential characteristics of any trajectory. More...
#include <Trajectory.h>
Public Member Functions | |
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 | |
Getters | |
double | getTime () const |
actual time instant | |
double | getDtDid () const |
last perfomed timestep | |
Entire state i/o | |
cpputils::iarchive & | readState (cpputils::iarchive &iar) |
read from an archive | |
cpputils::oarchive & | writeState (cpputils::oarchive &oar) const |
write to an archive | |
Related Functions | |
(Note that these are not member functions.) | |
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... | |
The base class of the trajectory-bundle condensing the quintessential characteristics of any trajectory.
The i/o of the entire state is performed via Boost.Serialization, and is disabled if this library is not installed
Definition at line 194 of file Trajectory.h.
std::ostream& trajectory::Trajectory::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.
precision | the precision (number of digits) of display |
|
related |
Running in deltaT mode (displays in equal time intervals) for a certain time.
This function manifests all the basic features of Adaptive and the whole idea behind the trajectory bundle.
A Trajectory can
Furthermore, a Trajectory can
trajectory | the trajectory to run |
time | end time |
deltaT | time interval between two displays |
sdf | number of displays between two state displays |
ofn | name of the output file for displays — if empty, display to standard output; state displays into file named ofn.state |
initialFileName | name of file containing initial condition state for the run |
precision | governs the overall precision (number of digits) of outputs in displays |
displayInfo | governs whether a header is displayed at the top of the output |
firstStateDisplay | governs whether the state is displayed at time zero (important if state display is costly) |
autoStopEpsilon | relative precision for autostopping |
autoStopRepetition | number of displayed lines repeated within relative precision before autostopping – 0 means no autostopping |
|
related |
Same as above but runs for a certain number of time intervals deltaT.
Rationale: This version of run
exists to avoid the eventual tiny timestep at the end of the run that might occur with the above version. This is because e.g. in the case of deltaT=0.1
, time=1
, adding up 0.1
ten times numerically does not result in exactly 1
.
For a demonstration, compare the output of
examples/HarmonicOscillatorComplex --dc 0 --Dt 0.1 --T 1
with
examples/HarmonicOscillatorComplex --dc 0 --Dt 0.1 --NDt 10
nDt | the end time of the trajectory will be nDt*deltaT |
|
related |
Dispatcher.
Runs
p.NDt
is nonzero and