SMILE
v2.5
Schwarzschild Modelling Interactive expLoratory Environment
|
The collection of orbits. More...
#include <orbitlib.h>
Public Member Functions | |
COrbitLibrary () | |
Construct an empty orbit library. | |
~COrbitLibrary () | |
Destroy the orbit library and delete all orbit data. | |
void | assignInitialConditions (const CPointMassSet< float > *points, const COrbitLauncher *newLauncher, double intTimeInPeriods, double intTimeMaxAdaptive, double intTimeMinAbs) |
Assign or modify initial conditions for orbit list. More... | |
void | removeUnused () |
if integration of the whole library was aborted by user, delete unfinished orbits | |
void | rewind () |
reset the orbit integration state to OS_INITIALIZED and reset the counter of complete orbits | |
std::string | exportNbody (size_t numPoints, const CBasicOrbitFilteringFnc *massRefineFactor, CPointMassSet< float > **result, COrbitRuntimeTrajSampleCreator *trajSampleCreator) |
try to create Nbody model from orbit library (with trajectory sample data). More... | |
size_t | size () const |
return total number of orbits in the library (both completed and unstarted) | |
double | totalMass () const |
returns sum of all orbit weights (if they were assigned) | |
const COrbitLauncher * | getLauncher () const |
return pointer to the orbit launcher (why would it be necessary?) | |
const COrbitDesc * | getOrbitDesc (size_t index) const |
return a pointer to a particular orbit descriptor | |
COrbitDesc * | getOrbitDesc (size_t index) |
size_t | numComplete () const |
find how many orbits are already finished | |
std::string | getOrbitPopulation (const CBasicOrbitFilteringFnc *filter, const CBasicOrbitFilteringFnc *chaos, bool useWeight) const |
return statistics about the orbit library. More... | |
int | findUnstartedOrbit () |
find an orbit that hasn't been started yet. More... | |
void | setLauncher (const COrbitLauncher *_launcher) |
set new launcher | |
void | addOrbitDesc (COrbitDesc *const &od) |
append an orbit descriptor to the library (used in loading from a file) | |
void | runOrbit (size_t index) |
integrate the orbit with the given index | |
void | halt () |
stop all orbit integrations (call halt for all orbit descriptors) | |
Private Attributes | |
const COrbitLauncher * | launcher |
std::vector< COrbitDesc * > | OrbitList |
array of orbit descriptors | |
volatile int | nextOrbitInd |
The collection of orbits.
Contains the array of COrbitDesc objects, methods to generate initial conditions for the orbit library, to get the statistical information about the orbit ensemble, and to create an Nbody model from the orbit library.
void smile::COrbitLibrary::assignInitialConditions | ( | const CPointMassSet< float > * | points, |
const COrbitLauncher * | newLauncher, | ||
double | intTimeInPeriods, | ||
double | intTimeMaxAdaptive, | ||
double | intTimeMinAbs | ||
) |
Assign or modify initial conditions for orbit list.
points | array of points to be used as initial conditions; if NULL then retain the existing OrbitList |
newLauncher | pointer to the instance of orbit launcher (which contains potential, runtime fnc creator lib, and common parameters) |
intTimeInPeriods | integration time in units of dynamical time |
intTimeMaxAdaptive | maximal integration time (if 0, equal to the previous) |
intTimeMinAbs | minimum integration time in global time units (not energy-dependent units of dynamical time) |
std::string smile::COrbitLibrary::exportNbody | ( | size_t | numPoints, |
const CBasicOrbitFilteringFnc * | massRefineFactor, | ||
CPointMassSet< float > ** | result, | ||
COrbitRuntimeTrajSampleCreator * | trajSampleCreator | ||
) |
try to create Nbody model from orbit library (with trajectory sample data).
If number of sampling points was not enough for some orbits, put duplicate points in the output for orbits with insufficient sampling, mark those orbits as unstarted and return list of orbits for reintegration.
[in] | numPoints | is number of points to be created in the Nbody snapshot; |
[in] | massRefineFactor | may be used to generate a multimass model: the mass of points sampled from a given orbit is proportional to the number returned by this function for that orbit), if this parameter is NULL then just assign equal mass to all points. |
[in,out] | result | is a pointer to the point mass set that is created in this routine; if this parameter points to a NULL pointer then a new CPointMassSet* is allocated, otherwise the existing snapshot is replaced with the new points; |
[in,out] | trajSampleCreator | is a pointer to the runtime function creator that manages collection of sampling points from trajectories. If any of the orbit lacks enough sampling points, it will be added to the list of orbits for reintegration, and the runtime function will be informed of the required number of sampling points. |
int smile::COrbitLibrary::findUnstartedOrbit | ( | ) |
find an orbit that hasn't been started yet.
search for the first orbit with state=OS_INITIALIZED and set it to OS_PREPARING. Should be called with external mutex/lock in a multi-threaded environment.
std::string smile::COrbitLibrary::getOrbitPopulation | ( | const CBasicOrbitFilteringFnc * | filter, |
const CBasicOrbitFilteringFnc * | chaos, | ||
bool | useWeight | ||
) | const |
return statistics about the orbit library.
filter | if not NULL, select only orbits for which this function returns nonzero |
chaos | if not NULL, provide information separately for regular and chaotic orbits determined by this function |
useWeight | whether to use orbit weights in computing the fraction of orbits, or use equal weighting |