#include <DustSecondarySource.hpp>
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) | |
![]() | |
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 |
![]() | |
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 |
![]() | |
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 Item * | getItemProperty (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) |
Item & | operator= (const Item &)=delete |
Item * | parent () 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 | |
![]() | |
SimulationItem () | |
virtual bool | offersInterface (const std::type_info &interfaceTypeInfo) const |
virtual void | setupSelfAfter () |
virtual void | setupSelfBefore () |
![]() | |
Item () | |
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.
|
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.
|
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.
|
overridevirtual |
This function prepares the mapping of history indices to spatial cells, given the range of history indices allocated to this source.
Implements SecondarySource.
|
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).