Class DensityGrid

Inheritance Relationships

Base Type

Class Documentation

class DensityGrid : public Density

Wrapper to use a Grid1f for a density.

The DensityGrid uses a given grid for the chosen density type. More than one type can be chosen to follow the same distribution. If no type is chosen a warning will be raised and all densities are 0.

Public Functions

DensityGrid(ref_ptr<Grid1f> grid, bool isForHI = false, bool isForHII = false, bool isForH2 = false)
virtual double getHIDensity(const Vector3d &position) const

Get HI density at a given position.

Parameters:

position – position in Galactic coordinates with Earth at (-8.5 kpc, 0, 0)

Returns:

Density of HI at given position in particles/m^3, sum up all HI densities from added densities

virtual double getHIIDensity(const Vector3d &position) const

Get HII density at a given position.

Parameters:

position – position in Galactic coordinates with Earth at (-8.5 kpc, 0, 0)

Returns:

Density of HII at given position in particles/m^3, sum up all HII densities from added densities

virtual double getH2Density(const Vector3d &position) const

Get H2 density at a given position.

Parameters:

position – position in Galactic coordinates with Earth at (-8.5 kpc, 0, 0)

Returns:

Density of H2 at given position in particles/m^3, sum up all H2 densities from added densities

virtual double getDensity(const Vector3d &position) const

Get density at a given position.

Parameters:

position – position in Galactic coordinates with Earth at (-8.5 kpc, 0, 0)

Returns:

Density in particles/m^3, sum up densities from added densities

virtual double getNucleonDensity(const Vector3d &position) const

Get the density of nucleons. This is the number of nucleons per volume, summed up all activated density and weight molecular hydrogyen twice

Parameters:

position – position in Galactic coordinates with Earth at (-8.5 kpc, 0, 0)

Returns:

Density of nucleons at given position in particles/m^3, sum up all nucleon densities from added densities

virtual bool getIsForHI()
virtual bool getIsForHII()
virtual bool getIsForH2()
void setIsForHI(bool b)
void setIsForHII(bool b)
void setIsForH2(bool b)
void setGrid(ref_ptr<Grid1f> grid)
virtual std::string getDescription()
inline size_t addReference() const
inline size_t removeReference() const
inline int removeReferenceNoDelete() const
inline size_t getReferenceCount() const

Protected Attributes

mutable size_t _referenceCount