Swarm-NG  1.1
swarm::EnsembleBase< _CHUNK_SIZE, _NUM_BODY_ATTRIBUTES, _NUM_SYS_ATTRIBUTES >::SystemRef Class Reference

Reference to a system within an ensemble. More...

#include <ensemble.hpp>

Public Member Functions

GENERIC SystemRef (const int &nbod, const int &number, Body *body, Sys *sys)
 Only should be used by ensemble.
 
GENERIC Bodyoperator[] (const int &i) const
 Access a body within the system.
 
GENERIC Sys::attributes_tattributes () const
 Current attributes of the system.
 
GENERIC double & time () const
 Current time of the system.
 
GENERIC bool is_active () const
 Query if the system is active.
 
GENERIC bool is_inactive () const
 Query if the system is inactive.
 
GENERIC bool is_disabled () const
 Query if the system is disabled.
 
GENERIC bool is_enabled () const
 Query if the system is enabled.
 
GENERIC int & state () const
 Get the ActivationState of the system. c.f. ActivationStates.
 
GENERIC void set_active () const
 Mark the system as active.
 
GENERIC void set_inactive () const
 Mark the system as inactive.
 
GENERIC void set_disabled () const
 Mark the system as disabled.
 
GENERIC int & id () const
 Unique identifier of the system. More...
 
GENERIC const int & nbod () const
 Number of bodies in this system.
 
GENERIC const int & number () const
 Serial number of the system in the ensemble.
 
GENERIC double & attribute (const int &i) const
 extra attribute of the system
 
GENERIC double distance_between (const int &i, const int &j) const
 Distance between planet i and j in the system For a faster version c.f. distance_squared_between(i,j)
 
GENERIC double distance_squared_between (const int &i, const int &j) const
 Distance squared between planet i and j in the system.
 
GENERIC void copyTo (const SystemRef &s)
 This is a really bad way to copy this but I really don't know any other way. If someone adds another property to the system should change this copy function too. This sucks.
 
GENERIC double calc_total_energy () const
 Total energy (potential+kinetic) of a system.
 

Detailed Description

template<int _CHUNK_SIZE, int _NUM_BODY_ATTRIBUTES = NUM_PLANET_ATTRIBUTES, int _NUM_SYS_ATTRIBUTES = NUM_SYSTEM_ATTRIBUTES>
class swarm::EnsembleBase< _CHUNK_SIZE, _NUM_BODY_ATTRIBUTES, _NUM_SYS_ATTRIBUTES >::SystemRef

Reference to a system within an ensemble.

The real system is the Sys data structure. Since we want to keep the Sys data structure simple and use it only for memory layout. We will use this class for referencing a Sys. This class is solely used for the accessors and it only contains pointers to the ensemble and the system. Usage: SystemRef s = ens[i];

Definition at line 287 of file ensemble.hpp.

Member Function Documentation

template<int _CHUNK_SIZE, int _NUM_BODY_ATTRIBUTES = NUM_PLANET_ATTRIBUTES, int _NUM_SYS_ATTRIBUTES = NUM_SYSTEM_ATTRIBUTES>
GENERIC int& swarm::EnsembleBase< _CHUNK_SIZE, _NUM_BODY_ATTRIBUTES, _NUM_SYS_ATTRIBUTES >::SystemRef::id ( ) const
inline

Unique identifier of the system.

The identifier is generated by any tool that generates the ensemble and is preserved during integration and reshuffling of the systems. It is used to match systems after integration with their initial conditions It is different from number, which is the array index of the system in the current ensemble.

Definition at line 347 of file ensemble.hpp.

Referenced by swarm::EnsembleBase< _CHUNK_SIZE, _NUM_BODY_ATTRIBUTES, _NUM_SYS_ATTRIBUTES >::SystemRef::copyTo().


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