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

#include <ContGasSecondarySource.hpp>

Inheritance diagram for ContGasSecondarySource:
Inheritance graph
[legend]

Public Member Functions

 ContGasSecondarySource (SimulationItem *parent, int h)
 
void launch (PhotonPacket *pp, size_t historyIndex, double L) const override
 
double prepareLuminosities () override
 
void preparePacketMap (size_t firstIndex, size_t numIndices) override
 
- 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
 
int _h
 
vector< size_t > _Iv
 
Array _Lv
 
const EmittingGasMix_mix
 
MediumSystem_ms
 
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

ContGasSecondarySource is a helper class that launches secondary emission photon packets from continuum emission for a given gas medium component. An instance of this class should be constructed only if secondary emission from gas is enabled for the simulation.

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

Constructor & Destructor Documentation

◆ ContGasSecondarySource()

ContGasSecondarySource::ContGasSecondarySource ( SimulationItem parent,
int  h 
)
explicit

This constructor creates a ContGasSecondarySource instance for the medium component with the specified index. This medium component must have a material mix that derives from the abstract EmittingGasMix class. 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).

Member Function Documentation

◆ launch()

void ContGasSecondarySource::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. Because photon packets launched from a given spatial cell are usually handled consecutively by the same execution thread, this function can and does calculate the emission spectrum for a given cell only once. It preserves the relevant information from one invocation of the function 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. The function obtains the bulk velocity of the cell for application of the appropriate macroscopic Doppler shift; other than this the emission is assumed to be unpolarized and isotropic in the comoving frame.

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

Implements SecondarySource.

◆ prepareLuminosities()

double ContGasSecondarySource::prepareLuminosities ( )
overridevirtual

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

Implements SecondarySource.

◆ preparePacketMap()

void ContGasSecondarySource::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.


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