SMILE  v2.5
Schwarzschild Modelling Interactive expLoratory Environment
Public Member Functions | Private Attributes | List of all members
smile::COrbitLibrary Class Reference

The collection of orbits. More...

#include <orbitlib.h>

Collaboration diagram for smile::COrbitLibrary:
Collaboration graph
[legend]

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 COrbitLaunchergetLauncher () const
 return pointer to the orbit launcher (why would it be necessary?)
 
const COrbitDescgetOrbitDesc (size_t index) const
 return a pointer to a particular orbit descriptor
 
COrbitDescgetOrbitDesc (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 COrbitLauncherlauncher
 
std::vector< COrbitDesc * > OrbitList
 array of orbit descriptors
 
volatile int nextOrbitInd
 

Detailed Description

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.

Member Function Documentation

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.

Parameters
pointsarray of points to be used as initial conditions; if NULL then retain the existing OrbitList
newLauncherpointer to the instance of orbit launcher (which contains potential, runtime fnc creator lib, and common parameters)
intTimeInPeriodsintegration time in units of dynamical time
intTimeMaxAdaptivemaximal integration time (if 0, equal to the previous)
intTimeMinAbsminimum 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.

Parameters
[in]numPointsis number of points to be created in the Nbody snapshot;
[in]massRefineFactormay 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]resultis 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]trajSampleCreatoris 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.
Returns
some statistics about number of orbits and 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.

Returns
the index of this orbit or -1 if none was found.
std::string smile::COrbitLibrary::getOrbitPopulation ( const CBasicOrbitFilteringFnc filter,
const CBasicOrbitFilteringFnc chaos,
bool  useWeight 
) const

return statistics about the orbit library.

Returns
a string containing orbit population (5 most abundant orbit families with their combined number, possibly weighted).
Parameters
filterif not NULL, select only orbits for which this function returns nonzero
chaosif not NULL, provide information separately for regular and chaotic orbits determined by this function
useWeightwhether to use orbit weights in computing the fraction of orbits, or use equal weighting

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