The SKIRT project
advanced radiative transfer for astrophysics
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Attributes | Friends | List of all members
GrainPopulation Class Reference

#include <GrainPopulation.hpp>

Inheritance diagram for GrainPopulation:
Inheritance graph
[legend]

Public Types

enum class  NormalizationType : int { DustMassPerHydrogenAtom , DustMassPerHydrogenMass , FactorOnSizeDistribution }
 

Public Member Functions

 GrainPopulation (SimulationItem *parent, GrainComposition *composition, GrainSizeDistribution *sizeDistribution, int numSizes, NormalizationType normType, double normValue)
 
GrainCompositioncomposition () const
 
double dustMassPerHydrogenAtom () const
 
double dustMassPerHydrogenMass () const
 
double factorOnSizeDistribution () const
 
NormalizationType normalizationType () const
 
int numSizes () const
 
GrainSizeDistributionsizeDistribution () const
 
- Public Member Functions inherited from SimulationItem
template<class T >
T * find (bool setup=true) const
 
template<class T >
T * interface (int levels=-999999, bool setup=true) const
 
virtual string itemName () const
 
void setup ()
 
string typeAndName () const
 
- Public Member Functions inherited from Item
 Item (const Item &)=delete
 
virtual ~Item ()
 
void addChild (Item *child)
 
const vector< Item * > & children () const
 
virtual void clearItemListProperty (const PropertyDef *property)
 
void destroyChild (Item *child)
 
virtual bool getBoolProperty (const PropertyDef *property) const
 
virtual vector< double > getDoubleListProperty (const PropertyDef *property) const
 
virtual double getDoubleProperty (const PropertyDef *property) const
 
virtual string getEnumProperty (const PropertyDef *property) const
 
virtual int getIntProperty (const PropertyDef *property) const
 
virtual vector< Item * > getItemListProperty (const PropertyDef *property) const
 
virtual ItemgetItemProperty (const PropertyDef *property) const
 
virtual string getStringProperty (const PropertyDef *property) const
 
int getUtilityProperty (string name) const
 
virtual void insertIntoItemListProperty (const PropertyDef *property, int index, Item *item)
 
Itemoperator= (const Item &)=delete
 
Itemparent () const
 
virtual void removeFromItemListProperty (const PropertyDef *property, int index)
 
virtual void setBoolProperty (const PropertyDef *property, bool value)
 
virtual void setDoubleListProperty (const PropertyDef *property, vector< double > value)
 
virtual void setDoubleProperty (const PropertyDef *property, double value)
 
virtual void setEnumProperty (const PropertyDef *property, string value)
 
virtual void setIntProperty (const PropertyDef *property, int value)
 
virtual void setItemProperty (const PropertyDef *property, Item *item)
 
virtual void setStringProperty (const PropertyDef *property, string value)
 
void setUtilityProperty (string name, int value)
 
virtual string type () const
 

Protected Member Functions

 GrainPopulation ()
 
- Protected Member Functions inherited from SimulationItem
 SimulationItem ()
 
virtual bool offersInterface (const std::type_info &interfaceTypeInfo) const
 
virtual void setupSelfAfter ()
 
virtual void setupSelfBefore ()
 
- Protected Member Functions inherited from Item
 Item ()
 

Private Types

using BaseType = SimulationItem
 
using ItemType = GrainPopulation
 

Private Attributes

GrainComposition_composition
 
double _dustMassPerHydrogenAtom
 
double _dustMassPerHydrogenMass
 
double _factorOnSizeDistribution
 
NormalizationType _normalizationType
 
int _numSizes
 
GrainSizeDistribution_sizeDistribution
 

Friends

class ItemRegistry
 

Detailed Description

GrainPopulation is simple class that represents a particular dust grain population. A grain population is essentially defined by the combination of a grain composition (an instance of a GrainComposition subclass) providing the optical and calorimetric properties of the grain material, and a grain size distribution (an instance of a GrainSizeDistribution subclass). In addition, the amount of dust contained in the population is specified, in one of three ways: as an absolute dust mass per hydrogen atom, as a ratio of dust mass per hydrogen mass, or by using a given proportionality factor on the size distribution (which in that case should have some known normalization).

Finally, a grain population specifies the number of grain size bins (on a logarithmic scale) that should be used when calculating emission spectra for the grain population. Because the emissivity is nonlinear as a function of grain size, the calculation is performed for a representative grain in each bin. A larger number of bins results in higher accuracy. On the other hand, the required computation time and memory consumption increase roughly linearly with the number of bins.

Member Enumeration Documentation

◆ NormalizationType

enum class GrainPopulation::NormalizationType : int
strong

The enumeration type indicating the mechanism for specifying the amount of dust in the population.

DustMassPerHydrogenAtom : "an absolute dust mass per hydrogen atom" .

DustMassPerHydrogenMass : "a ratio of dust mass per hydrogen mass" .

FactorOnSizeDistribution : "a proportionality factor on the size distribution" .

Constructor & Destructor Documentation

◆ GrainPopulation() [1/2]

GrainPopulation::GrainPopulation ( )
inlineprotected

Default constructor for concrete Item subclass GrainPopulation : "a dust grain population" .

◆ GrainPopulation() [2/2]

GrainPopulation::GrainPopulation ( SimulationItem parent,
GrainComposition composition,
GrainSizeDistribution sizeDistribution,
int  numSizes,
NormalizationType  normType,
double  normValue 
)
explicit

This constructor can be invoked by classes that wish to hard-code the creation of a new grain population object (as opposed to creation through the ski file). Before the constructor returns, the newly created object is hooked up as a child to the specified parent in the simulation hierarchy (so it will automatically be deleted), its properties have been set to the values specified in the constructor, and its setup() function has been called. The caller must guarantee that the lifetime of the specified composition and size distribution objects is as least as long as the lifetime of the newly created grain population object.

The normValue argument specifies the normalization value corresponding to the specified normalization type, i.e. dustMassPerHydrogenAtom (in kg), dustMassPerHydrogenMass (dimensionless ratio), or factorOnSizeDistribution (dimensionless factor).

Member Function Documentation

◆ composition()

GrainPopulation::composition ( ) const
inline

This function returns the value of the discoverable item property composition : "the dust grain composition" .

The default value for this property is given by the conditional value expression "DraineGraphiteGrainComposition" .

◆ dustMassPerHydrogenAtom()

GrainPopulation::dustMassPerHydrogenAtom ( ) const
inline

This function returns the value of the discoverable double property dustMassPerHydrogenAtom : "the dust mass per hydrogen atom" .

This property represents a physical quantity of type "mass" .

The minimum value for this property is "[0" .

This property is relevant only if the Boolean expression "normalizationTypeDustMassPerHydrogenAtom" evaluates to true after replacing the names by true or false depending on their presence.

◆ dustMassPerHydrogenMass()

GrainPopulation::dustMassPerHydrogenMass ( ) const
inline

This function returns the value of the discoverable double property dustMassPerHydrogenMass : "the dust mass per hydrogen mass" .

The minimum value for this property is "[0" .

The maximum value for this property is "1[" .

This property is relevant only if the Boolean expression "normalizationTypeDustMassPerHydrogenMass" evaluates to true after replacing the names by true or false depending on their presence.

◆ factorOnSizeDistribution()

GrainPopulation::factorOnSizeDistribution ( ) const
inline

This function returns the value of the discoverable double property factorOnSizeDistribution : "the proportionality factor on the size distribution" .

The minimum value for this property is "[0" .

The default value for this property is given by the conditional value expression "1" .

This property is relevant only if the Boolean expression "normalizationTypeFactorOnSizeDistribution" evaluates to true after replacing the names by true or false depending on their presence.

◆ normalizationType()

GrainPopulation::normalizationType ( ) const
inline

This function returns the value of the discoverable NormalizationType enumeration property normalizationType : "the mechanism for specifying the amount of dust in the population" .

The default value for this property is given by the conditional value expression "DustMassPerHydrogenMass" .

◆ numSizes()

GrainPopulation::numSizes ( ) const
inline

This function returns the value of the discoverable integer property numSizes : "the number of grain size bins" .

The minimum value for this property is "1" .

The maximum value for this property is "1000" .

The default value for this property is given by the conditional value expression "8" .

◆ sizeDistribution()

GrainPopulation::sizeDistribution ( ) const
inline

This function returns the value of the discoverable item property sizeDistribution : "the dust grain size distribution" .

The default value for this property is given by the conditional value expression "PowerLawGrainSizeDistribution" .


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