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

#include <DustSecondarySource.hpp>

Inheritance diagram for DustSecondarySource:
Inheritance graph
[legend]

Public Member Functions

void launch (PhotonPacket *pp, size_t historyIndex, double L) const override
 
double prepareLuminosities () override
 
void preparePacketMap (size_t firstIndex, size_t numIndices) override
 
 SecondarySource (SimulationItem *parent)
 
- Public Member Functions inherited from SecondarySource
 SecondarySource (SimulationItem *parent)
 
virtual void launch (PhotonPacket *pp, size_t historyIndex, double L) const =0
 
virtual double prepareLuminosities ()=0
 
virtual void preparePacketMap (size_t firstIndex, size_t numIndices)=0
 
- 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
 

Private Attributes

Configuration_config
 
vector< size_t > _Iv
 
Array _Lv
 
MediumSystem_ms
 
vector< int > _mv
 
vector< int > _nv
 
Random_random
 
Array _Wv
 

Additional Inherited Members

- 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 ()
 

Detailed Description

DustSecondarySource is a helper class that launches secondary emission photon packets from dust media. It handles the aggregated thermal emission from all dust components in the simulation. An instance of this class should be constructed only if the simulation configuration includes one or more dust medium components and secondary emission from dust is enabled.

For more information on the operation of this class, see the SecondarySourceSystem class.

Member Function Documentation

◆ launch()

void DustSecondarySource::launch ( PhotonPacket pp,
size_t  historyIndex,
double  L 
) const
overridevirtual

This function causes the photon packet pp to be launched from one of the cells in the spatial grid using the given history index.

Before it can randomly emit photon packets from a spatial cell, this function must calculate the normalized regular and cumulative dust emission spectrum for the cell from the radiation field and the dust properties held by the medium system, using the configured emission calculator (LTE or NLTE). Also, it must obtain the average bulk velocity of the material in the cell from the medium system. Especially the NLTE emission spectrum calculations can be very time-consuming, so it is important to perform them only once for each cell. On the other hand, pre-calculating and storing the spectra for all cells in advance requires a potentially large amount of memory (proportional to both the number of cells and to the number of wavelengths on which the emission is discretized). As described in the SecondarySourceSystem class header, photon packets launched from a given spatial cell are usually handled consecutively by the same execution thread, allowing this function to remember the information calculated for the "current" cell from one invocation to the next in a helper object allocated with thread-local storage scope. As a result, memory requirements are limited to storing the information for only a single cell per execution thread, and the calculation is still performed only once per cell.

Once the emission spectrum for the current cell is known, the function randomly generates a wavelength either from this emission spectrum or from the configured bias wavelength distribution, adjusting the launch weight with the proper bias factor. It then generates a random position uniformly within the spatial cell.

If the simulation includes aligned spheroidal grains, the function calculates the polarization profile for the emitted photon packet and draws a random direction from the corresponding anisotropic phase function. Otherwise, the emission is assumed to be unpolarized and isotropic, and a random direction is determined uniformly on the unit sphere.

Finally, the function actually initializes the photon packet with this information.

Implements SecondarySource.

◆ prepareLuminosities()

double DustSecondarySource::prepareLuminosities ( )
overridevirtual

This function calculates and stores the bolometric dust luminosities in each spatial cell of the simulation, and returns the total bolometric dust luminosity.

Implements SecondarySource.

◆ preparePacketMap()

void DustSecondarySource::preparePacketMap ( size_t  firstIndex,
size_t  numIndices 
)
overridevirtual

This function prepares the mapping of history indices to spatial cells, given the range of history indices allocated to this source.

Implements SecondarySource.

◆ SecondarySource()

SecondarySource::SecondarySource ( SimulationItem parent)
explicit

This constructor creates a SecondarySource subclass instance. 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).


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