#include <CUtilities.hpp>
Public Member Functions | |
CUnits () | |
void | computeDerivedUnits () |
void | setLength (const double &length) |
void | setVelocity (const double &velocity) |
void | setMass (const double &mass) |
void | setTime (const double &time) |
void | setHubbleParameter (const double &h) |
double | velocity () const |
double | time () const |
double | mass () const |
double | length () const |
double | hubbleParameter () const |
Public Attributes | |
double | density |
double | energy |
double | specificEnergy |
double | lengthInKpc |
double | massInSolarMass |
double | timeInGyr |
double | kpcInCm |
double | solarMassInG |
double | yrInS |
double | gyrInS |
double | gamma |
Private Attributes | |
double | _length |
double | _velocity |
double | _time |
double | _mass |
double | _hubbleParameter |
Class for printing info when constructing/destroying.
Contains two static routines with content depending on an ifdef. If VERBOSE_CONSDESTR is defined the class outputs some info to the terminal. If not the class just silently keeps track of the number of allocated and destroyed objects (which is also done in the verbose case).
CUnits::CUnits | ( | ) |
Constructor
void CUnits::computeDerivedUnits | ( | ) |
Compute derived units
void CUnits::setLength | ( | const double & | length | ) |
getters and setters
double CUnits::_hubbleParameter [private] |
Hubble parameter h (with H0 = 100 * h km/s/Mpc)
double CUnits::_length [private] |
unit of length (in cm)
double CUnits::_mass [private] |
unit of mass (in g)
double CUnits::_time [private] |
unit of time (in s)
double CUnits::_velocity [private] |
unit of velocity (in cm/s)
double CUnits::density |
unit of density (in g/cm^3)
double CUnits::energy |
unit of energy (in g cm^2 / s^2)
double CUnits::gamma |
gas stuff constant (default: 5/3)
double CUnits::gyrInS |
one gigayear in s (i.e. seconds/Gyr)
double CUnits::kpcInCm |
one kiloparsec in cm
double CUnits::lengthInKpc |
unit of length in kpc
double CUnits::massInSolarMass |
unit of mass in solar masses
double CUnits::solarMassInG |
one solar mass in g
double CUnits::specificEnergy |
unit of specific energy (in cm^2 / s^2)
double CUnits::timeInGyr |
unit of time in Gyr
double CUnits::yrInS |
one year in s