The SKIRT project
advanced radiative transfer for astrophysics
PhotonPacketOptions Class Reference

#include <PhotonPacketOptions.hpp>

Inheritance diagram for PhotonPacketOptions:

Public Member Functions

bool explicitAbsorption () const
bool forceScattering () const
int minScattEvents () const
double minWeightReduction () const
double pathLengthBias () 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

 PhotonPacketOptions ()
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
using ItemType

Private Attributes

bool _explicitAbsorption
bool _forceScattering
int _minScattEvents
double _minWeightReduction
double _pathLengthBias

Friends

class ItemRegistry

Detailed Description

The PhotonPacketOptions class simply offers a number of configuration options related to the Monte Carlo photon packet life cycle. These options are relevant as soon as there is a medium in the configuration.

Several variations of the photon life cycle implementation can be configured:

  • With or without explicit absorption. Explicit absorption allows absorption cross sections to be negative, which can be the case for materials that exhibit stimulated emission. Note that scattering cross sections never can be negative. The default behavior is not to use explicit absorption, because the effects of this recent technique has not yet been well studied.
  • With or without forced scattering. Forced scattering tends to reduce noise for simulations with low to limited optical depths, such as for most dust models on galaxy-wide scales. Therefore, forced scattering is the default behavior except when Lyman-alpha line transfer is included, because the extra peel-offs for the many resonant scattering events tend to slow down the simulation. Furthermore, the implementation without forced scattering currently does not support storing the radiation field, which means it cannot be used when the simulation includes secondary emission or dynamic state iteration.

The remaining three options serve to further configure the detailed behavior of the forced scattering photon cycle. The first two options determine when the photon life cycle will be terminated, i.e. after the weight of photon packet has decreased to some insignificant fraction of its original weight (luminosity) through interaction with the medium, with a given minimum number of scattering events if so desired.

The last option configures the path length stretching mechanism. When determining the next interaction location of a photon packet with the medium, this technique samples in part from a distribution representing unphysically long path segments, correcting this deviation through a bias factor on the photon packet's weight. This allows a photon packet to more easily skip through high optical depth regions. The value configured for this option determines the fraction of path lengths sampled from the unphysical distribution. A value of zero disables the mechanism altogether.

The path length stretching mechanism cannot be used for models where the photon packet wavelength may change during its life cycle, for example during scattering or as a result of bulk motions in the medium. This is so because the unphysically long distances between interactions would no longer correctly sample the effects on the wavelength. Also, path length stretching is currently not implemented for photon cycles without forced scattering. In all these cases, the path length stretching mechanism will automatically be disabled during setup. As a result, these simulations will lack the potential optimization brought by the path length technique. In particulatar, penetrating regions of high optical depth may require many scattering events with correspondingly longer running times.

Constructor & Destructor Documentation

◆ PhotonPacketOptions()

PhotonPacketOptions::PhotonPacketOptions ( )
inlineprotected

Default constructor for concrete Item subclass PhotonPacketOptions: "a set of options related to the photon packet lifecycle".

Member Function Documentation

◆ explicitAbsorption()

bool PhotonPacketOptions::explicitAbsorption ( ) const
inline

This function returns the value of the discoverable Boolean property explicitAbsorption: "use explicit absorption to allow negative absorption (stimulated emission)".

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

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

◆ forceScattering()

bool PhotonPacketOptions::forceScattering ( ) const
inline

This function returns the value of the discoverable Boolean property forceScattering: "use forced scattering to reduce noise".

The default value for this property is given by the conditional value expression "Lya:false;true".

This property is relevant only if the Boolean expression "!(Emission|IteratePrimary)" evaluates to true after replacing the names by true or false depending on their presence.

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

When a value is entered for this property, the names provided by the conditional value expression "Emission|IteratePrimary|forceScattering:ForceScattering" are inserted into the name sets used for evaluating Boolean expressions.

◆ minScattEvents()

int PhotonPacketOptions::minScattEvents ( ) const
inline

This function returns the value of the discoverable integer property minScattEvents: "the minimum number of forced scattering events before a photon packet is terminated".

The minimum value for this property is "0".

The maximum value for this property is "1000".

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

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

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

◆ minWeightReduction()

double PhotonPacketOptions::minWeightReduction ( ) const
inline

This function returns the value of the discoverable double property minWeightReduction: "the minimum weight reduction factor before a photon packet is terminated".

The minimum value for this property is "[1e3".

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

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

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

◆ pathLengthBias()

double PhotonPacketOptions::pathLengthBias ( ) const
inline

This function returns the value of the discoverable double property pathLengthBias: "the fraction of path lengths sampled from a stretched distribution".

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

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

The default value for this property is given by the conditional value expression "(ForceScattering)&(!Lya):0.5;0".

This property is relevant only if the Boolean expression "(ForceScattering)&(!Lya)" evaluates to true after replacing the names by true or false depending on their presence.

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


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