The SKIRT project
advanced radiative transfer for astrophysics
FragmentDustMixDecorator Class Reference

#include <FragmentDustMixDecorator.hpp>

Inheritance diagram for FragmentDustMixDecorator:

Public Member Functions

double asymmpar (double lambda) const override
MultiGrainDustMixdustMix () const
Array emissionSpectrum (const MaterialState *state, const Array &Jv) const override
DisjointWavelengthGridemissionWavelengthGrid () const override
Array emissivity (const Array &Jv) const override
bool fragmentSizeBins () const
bool hasContinuumEmission () const override
bool hasDynamicDensities () const
bool hasExtraSpecificState () const override
bool hasPolarizedScattering () const override
bool hasStochasticDustEmission () const override
double indicativeTemperature (const MaterialState *state, const Array &Jv) const override
double initialDensityFraction () const
void initializeSpecificState (MaterialState *state, double metallicity, double temperature, const Array &params) const override
double mass () const override
MaterialType materialType () const override
int numPopulations () const override
double opacityAbs (double lambda, const MaterialState *state, const PhotonPacket *pp) const override
double opacityExt (double lambda, const MaterialState *state, const PhotonPacket *pp) const override
double opacitySca (double lambda, const MaterialState *state, const PhotonPacket *pp) const override
vector< SnapshotParameterparameterInfo () const override
bool peeloffScattering (double &I, double &Q, double &U, double &V, double &lambda, Direction bfkobs, Direction bfky, const MaterialState *state, const PhotonPacket *pp) const override
void performScattering (double lambda, const MaterialState *state, PhotonPacket *pp) const override
double populationBulkDensity (int f) const override
double populationGrainRadius (int f) const
string populationGrainType (int f) const override
bool populationIsGraphite (int f) const
double populationMass (int f) const override
double populationNumberDensity (int f, const MaterialState *state) const
double populationOpacityExt (int f, double lambda, const MaterialState *state) const
const GrainSizeDistributionpopulationSizeDistribution (int f) const override
Range populationSizeRange (int f) const override
double populationTemperature (int f, const Array &Jv) const
double sectionAbs (double lambda) const override
double sectionExt (double lambda) const override
double sectionSca (double lambda) const override
vector< StateVariablespecificStateVariableInfo () const override
double totalMass () const override
Public Member Functions inherited from MaterialMix
virtual DynamicStateType hasDynamicMediumState () const
virtual bool hasLineEmission () const
virtual bool hasNegativeExtinction () const
virtual bool hasPolarizedAbsorption () const
virtual bool hasPolarizedEmission () const
virtual bool hasResonantScattering () const
virtual bool hasScatteringDispersion () const
bool isDust () const
bool isElectrons () const
bool isGas () const
virtual bool isSpecificStateConverged (int numCells, int numUpdated, int numNotConverged, MaterialState *currentAggregate, MaterialState *previousAggregate) const
virtual Array lineEmissionCenters () const
virtual Array lineEmissionMasses () const
virtual Array lineEmissionSpectrum (const MaterialState *state, const Array &Jv) const
virtual bool scatteringEmulatesSecondaryEmission () const
virtual const ArraysectionsAbs (double lambda) const
virtual const ArraysectionsAbspol (double lambda) const
virtual const ArraythetaGrid () const
virtual UpdateStatus updateSpecificState (MaterialState *state, const Array &Jv) 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
Public Member Functions inherited from MultiGrainPopulationInterface
virtual ~MultiGrainPopulationInterface ()

Protected Member Functions

 FragmentDustMixDecorator ()
void setupSelfAfter () override
Protected Member Functions inherited from MaterialMix
 MaterialMix ()
Configurationconfig () const
Randomrandom () const
void setupSelfBefore () override
Protected Member Functions inherited from SimulationItem
 SimulationItem ()
virtual bool offersInterface (const std::type_info &interfaceTypeInfo) const
Protected Member Functions inherited from Item
 Item ()
Protected Member Functions inherited from MultiGrainPopulationInterface
 MultiGrainPopulationInterface ()

Private Types

using BaseType
using ItemType

Private Attributes

MultiGrainDustMix_dustMix
vector< const DustMixFragment * > _fragments
bool _fragmentSizeBins
bool _hasDynamicDensities
double _initialDensityFraction
int _numFrags

Friends

class ItemRegistry

Additional Inherited Members

Public Types inherited from MaterialMix
enum class  DynamicStateType { None , Primary , Secondary , PrimaryIfMergedIterations }
enum class  MaterialType { Dust , Electrons , Gas }

Detailed Description

A FragmentDustMixDecorator instance aggregates a fixed number of predefined dust populations, called fragments, and provides a way to manage the relative weight of each of those fragments during the simulation. The aggregated fragments are defined by specifying a MultiGrainDustMix instance as part of the user configuration. Depending on a user configuration flag, the specified multi-grain dust mix is fragmented into its underlying dust populations or into the individual grain size bins for those populations. A fragment dust mix decorator thus essentially splits a multi-grain dust mix into its underlying fragments. The dust mix being fragmented can be a turn-key multi-grain mix (e.g., ZubkoDustMix) or a fully user-configured dust mix (ConfigurableDustMix), offering nearly limitless possibilities.

The specific medium state for a fragmented dust mix consists of a weight factor for each fragment. To construct the aggregated dust mix represented by the fragmented dust mix for a given spatial cell, the dust mass represented by each fragment in the original dust mix is multiplied by its corresponding weight factor in the specific state. In other words, a weight factor of one means that the fragment's mass remains unchanged from the original dust mix.

Initialization of the specific medium state proceeds as follows. If the fragmented dust mix is configured as part of a geometric medium component, all fragment weight factors are set to a value of one, thus preserving the relative weigths of the fragments in the original dust mix. If the fragmented dust mix is configured as part of an imported medium component, the fragment weight factors are imported from the snapshot.

FragmentDustMixDecorator inherits directly from MaterialMix rather than from DustMix or MultiGrainDustMix so that it cannot be nested inside another fragment dust mix decorator or inside a SelectDustMixFamily instance.

When an item of this type is used, the names provided by the conditional value expression "CustomMediumState" are inserted into the name sets used for evaluating Boolean expressions.

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

Constructor & Destructor Documentation

◆ FragmentDustMixDecorator()

FragmentDustMixDecorator::FragmentDustMixDecorator ( )
inlineprotected

Default constructor for concrete Item subclass FragmentDustMixDecorator: "a dust mix decorator that manages separate densities for fragments of another dust mix".

Member Function Documentation

◆ asymmpar()

double FragmentDustMixDecorator::asymmpar ( double lambda) const
overridevirtual

This function returns the scattering asymmetry parameter \(g_\lambda = \left<\cos\theta\right>\) at wavelength \(\lambda\) for the original dust mix being fragmented, without taking into account any additional fragment weights.

Reimplemented from MaterialMix.

◆ dustMix()

MultiGrainDustMix * FragmentDustMixDecorator::dustMix ( ) const
inline

This function returns the value of the discoverable item property dustMix: "the dust mix to be fragmented".

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

◆ emissionSpectrum()

Array FragmentDustMixDecorator::emissionSpectrum ( const MaterialState * state,
const Array & Jv ) const
overridevirtual

This function returns the emission spectrum (radiated power per unit of solid angle) in the spatial cell and medium component represented by the specified material state and the receiving material mix when it would be embedded in the specified radiation field. The returned spectrum takes into account the weigths of the various fragments in the mix in addition to the number density of the material in the specified cell.

The input and output arrays are discretized on the wavelength grids returned by the Configuration::radiationFieldWLG() and Configuration::dustEmissionWLG() functions, repectively.

Reimplemented from MaterialMix.

◆ emissionWavelengthGrid()

DisjointWavelengthGrid * FragmentDustMixDecorator::emissionWavelengthGrid ( ) const
overridevirtual

This function returns the wavelength grid on which dust emission is discretized, i.e. the wavelength grid returned by the Configuration::dustEmissionWLG() function.

Reimplemented from MaterialMix.

◆ emissivity()

Array FragmentDustMixDecorator::emissivity ( const Array & Jv) const
overridevirtual

This function returns the emissivity spectrum \(\varepsilon_{\ell'}\) (radiated power per unit of solid angle and per hydrogen atom) of the dust mix when it would be embedded in a given radiation field. Because this function does not have access to the material state, it simply returns the value returned by the corresponding function for the dust mix being fragmented. In other words, it behaves as if the fragment weights are all equal to one.

The input and output arrays are discretized on the wavelength grids returned by the Configuration::radiationFieldWLG() and Configuration::dustEmissionWLG() functions, repectively.

Reimplemented from MaterialMix.

◆ fragmentSizeBins()

bool FragmentDustMixDecorator::fragmentSizeBins ( ) const
inline

This function returns the value of the discoverable Boolean property fragmentSizeBins: "fragment each dust population into its grain size bins".

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

◆ hasContinuumEmission()

bool FragmentDustMixDecorator::hasContinuumEmission ( ) const
overridevirtual

This function returns true for this class because all dust mixes support secondary continuum emission.

Reimplemented from MaterialMix.

◆ hasDynamicDensities()

bool FragmentDustMixDecorator::hasDynamicDensities ( ) const
inline

This function returns the value of the discoverable Boolean property hasDynamicDensities: "allow the fragment densities to be adjusted dynamically".

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

The default value for this property is given by the conditional value expression "DynamicState:true;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.

◆ hasExtraSpecificState()

bool FragmentDustMixDecorator::hasExtraSpecificState ( ) const
overridevirtual

This function returns true, indicating that the cross sections returned by the fragment dust mix decorator depend on the values of specific state variables other than the number density, in this case the fragment weight factors.

Reimplemented from MaterialMix.

◆ hasPolarizedScattering()

bool FragmentDustMixDecorator::hasPolarizedScattering ( ) const
overridevirtual

This function returns a flag indicating whether the material mix supports polarization during scattering events or not. For the fragment dust mix decorator, the function returns the value returned by the corresponding function for the dust mix being fragmented.

Reimplemented from MaterialMix.

◆ hasStochasticDustEmission()

bool FragmentDustMixDecorator::hasStochasticDustEmission ( ) const
overridevirtual

This function returns a flag indicating whether this material mix supports stochastic heating of dust grains. For the fragment dust mix decorator, the function returns true because all dust mixes being fragmented support stochastic heating by definition.

Reimplemented from MaterialMix.

◆ indicativeTemperature()

double FragmentDustMixDecorator::indicativeTemperature ( const MaterialState * state,
const Array & Jv ) const
overridevirtual

This function returns an indicative temperature of the fragmented dust mix when it would be embedded in a given radiation field, averaging over the fragments using the fragment weights in the material state as described in the class header.

Reimplemented from MaterialMix.

◆ initialDensityFraction()

double FragmentDustMixDecorator::initialDensityFraction ( ) const
inline

This function returns the value of the discoverable double property initialDensityFraction: "the initial value of the dynamic density fraction".

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 "0".

This property is relevant only if the Boolean expression "DynamicState&hasDynamicDensities" 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.

◆ initializeSpecificState()

void FragmentDustMixDecorator::initializeSpecificState ( MaterialState * state,
double metallicity,
double temperature,
const Array & params ) const
overridevirtual

This function initializes the specific state variables requested by this fragmented dust mix through the specificStateVariableInfo() function except for the number density. If the params array is nonempty, the function assumes that the array contains the appropriate number of imported parameter values as requested through the parameterInfo() function, i.e. a weight factor per fragment. It then copies these weights into the corresponding specific state variables. If the params array is empty, the function sets all the weights in the specific state to a value of one. The metallicity and temperature arguments are ignored.

Reimplemented from MaterialMix.

◆ mass()

double FragmentDustMixDecorator::mass ( ) const
overridevirtual

This function returns the dust mass \(\mu\) per hydrogen atom for the original dust mix being fragmented, without taking into account any additional fragment weights.

Implements MaterialMix.

◆ materialType()

MaterialType FragmentDustMixDecorator::materialType ( ) const
overridevirtual

This function returns the fundamental material type represented by this material mix. For the fragment dust mix decorator, it returns MaterialType::Dust.

Implements MaterialMix.

◆ numPopulations()

int FragmentDustMixDecorator::numPopulations ( ) const
overridevirtual

This function returns the number of fragments (with indices \(f\)) in this fragmented dust mix. If the fragmentSizeBins flag is configured to false, this corresponds to the number of populations in the dust mix being fragmented. If the fragmentSizeBins flag is configured to true, this corresponds to the grand total of size bins for all populations in the dust mix being fragmented.

Implements MultiGrainPopulationInterface.

◆ opacityAbs()

double FragmentDustMixDecorator::opacityAbs ( double lambda,
const MaterialState * state,
const PhotonPacket * pp ) const
overridevirtual

This function returns the absorption opacity \(k^\text{abs}=n\varsigma^\text{abs}\) for the given wavelength and material state, taking into account the fragment weights in the material state as described in the class header. The photon properties are used only if they are used by the dust mix being fragmented.

Implements MaterialMix.

◆ opacityExt()

double FragmentDustMixDecorator::opacityExt ( double lambda,
const MaterialState * state,
const PhotonPacket * pp ) const
overridevirtual

This function returns the extinction opacity \(k^\text{ext}=k^\text{abs}+k^\text{sca}\) for the given wavelength and material state, taking into account the fragment weights in the material state as described in the class header. The photon properties are used only if they are used by the dust mix being fragmented.

Implements MaterialMix.

◆ opacitySca()

double FragmentDustMixDecorator::opacitySca ( double lambda,
const MaterialState * state,
const PhotonPacket * pp ) const
overridevirtual

This function returns the scattering opacity \(k^\text{sca}=n\varsigma^\text{sca}\) for the given wavelength and material state, taking into account the fragment weights in the material state as described in the class header. The photon properties are used only if they are used by the dust mix being fragmented.

Implements MaterialMix.

◆ parameterInfo()

vector< SnapshotParameter > FragmentDustMixDecorator::parameterInfo ( ) const
overridevirtual

This function returns the number and type of import parameters required by this fragmented dust mix as a list of SnapshotParameter objects. Specifically, the function returns a parameter description for each fragment corresponding to the weight factor to be assigned to that fragment. The parameters imported for each spatial cell end up in the state for the medium component associated with this fragmented dust mix. For more information, see the specificStateVariableInfo() and initializeSpecificState() functions.

Reimplemented from MaterialMix.

◆ peeloffScattering()

bool FragmentDustMixDecorator::peeloffScattering ( double & I,
double & Q,
double & U,
double & V,
double & lambda,
Direction bfkobs,
Direction bfky,
const MaterialState * state,
const PhotonPacket * pp ) const
overridevirtual

This function calculates the contribution of the medium component associated with this material mix to the peel-off photon luminosity, polarization state, and wavelength shift for the given wavelength, geometry, material state, and photon properties. The relative weight of each fragment's contribution is adjusted by the relative scattering opacity of the fragment. The contributions to the Stokes vector components are stored in the I, Q, U, V arguments, which are guaranteed to be initialized to zero by the caller. For dust mixes, the wavelength remains unchanged.

Reimplemented from MaterialMix.

◆ performScattering()

void FragmentDustMixDecorator::performScattering ( double lambda,
const MaterialState * state,
PhotonPacket * pp ) const
overridevirtual

This function performs a scattering event on the specified photon packet in the spatial cell and medium component represented by the specified material state. Specifically, it randomly selects one of the fragments in the fragmented dust mix, weighted by their relative scattering opacity, and then causes this fragment to perform the scattering event.

Reimplemented from MaterialMix.

◆ populationBulkDensity()

double FragmentDustMixDecorator::populationBulkDensity ( int f) const
overridevirtual

This function returns the bulk mass density \(\rho_\text{bulk}\) of the grain material represented by the fragment with index \(f\).

Implements MultiGrainPopulationInterface.

◆ populationGrainRadius()

double FragmentDustMixDecorator::populationGrainRadius ( int f) const

This function returns the average radius of a dust grain in the dust population represented by the fragment with index \(f\).

◆ populationGrainType()

string FragmentDustMixDecorator::populationGrainType ( int f) const
overridevirtual

This function returns a brief human-readable identifier for the type of grain material represented by the fragment with index \(f\).

Implements MultiGrainPopulationInterface.

◆ populationIsGraphite()

bool FragmentDustMixDecorator::populationIsGraphite ( int f) const

This function returns true if the human-readable identifier for the type of grain material represented by the fragment with index \(f\) contains "Gra", "PAH" or "CM20", and false otherwise.

◆ populationMass()

double FragmentDustMixDecorator::populationMass ( int f) const
overridevirtual

This function returns the dust mass \(\mu_f\) per hydrogen atom for the fragment with index \(f\) as it would be in the original dust mix being fragmented, without taking into account any additional fragment weights.

Implements MultiGrainPopulationInterface.

◆ populationNumberDensity()

double FragmentDustMixDecorator::populationNumberDensity ( int f,
const MaterialState * state ) const

This function returns the number density of the dust population represented by the fragment with index \(f\), given the material state for a spatial cell.

◆ populationOpacityExt()

double FragmentDustMixDecorator::populationOpacityExt ( int f,
double lambda,
const MaterialState * state ) const

This function returns the extinction opacity of the dust population represented by the fragment with index \(f\) for the given wavelength and material state, taking into account the fragment weights in the material state as described in the class header.

◆ populationSizeDistribution()

const GrainSizeDistribution * FragmentDustMixDecorator::populationSizeDistribution ( int f) const
overridevirtual

This function returns the grain size distribution object for the fragment with index \(f\).

Implements MultiGrainPopulationInterface.

◆ populationSizeRange()

Range FragmentDustMixDecorator::populationSizeRange ( int f) const
overridevirtual

This function returns the minimum and maximum grain sizes \(a_{\text{min},f}, a_{\text{max},c}\) for the fragment with index \(f\).

Implements MultiGrainPopulationInterface.

◆ populationTemperature()

double FragmentDustMixDecorator::populationTemperature ( int f,
const Array & Jv ) const

This function returns the equilibrium temperature of the dust population represented by the fragment with index \(f\) when it would be embedded in a given radiation field.

◆ sectionAbs()

double FragmentDustMixDecorator::sectionAbs ( double lambda) const
overridevirtual

This function returns the absorption cross section per entity \(\varsigma^{\text{abs}}_{\lambda}\) at wavelength \(\lambda\) for the original dust mix being fragmented, without taking into account any additional fragment weights.

Implements MaterialMix.

◆ sectionExt()

double FragmentDustMixDecorator::sectionExt ( double lambda) const
overridevirtual

This function returns the total extinction cross section per entity \(\varsigma^{\text{ext}}_{\lambda} = \varsigma^{\text{abs}}_{\lambda} + \varsigma^{\text{sca}}_{\lambda}\) at wavelength \(\lambda\) for the original dust mix being fragmented, without taking into account any additional fragment weights.

Implements MaterialMix.

◆ sectionSca()

double FragmentDustMixDecorator::sectionSca ( double lambda) const
overridevirtual

This function returns the scattering cross section per entity \(\varsigma^{\text{sca}}_{\lambda}\) at wavelength \(\lambda\) for the original dust mix being fragmented, without taking into account any additional fragment weights.

Implements MaterialMix.

◆ setupSelfAfter()

void FragmentDustMixDecorator::setupSelfAfter ( )
overrideprotectedvirtual

This function creates and remembers a dust mix fragment for each grain population in the multi-grain dust mix being fragmented or, if requested by the user, for each size bin in each of those grain populations.

Reimplemented from SimulationItem.

◆ specificStateVariableInfo()

vector< StateVariable > FragmentDustMixDecorator::specificStateVariableInfo ( ) const
overridevirtual

This function returns a list of StateVariable objects describing the specific state variables used by this fragmented dust mix. Specifically, in addition to a description for the overall number density, the function returns a custom state variable description for each fragment corresponding to the weight factor for that fragment. For more information, see the parameterInfo() and initializeSpecificState() functions.

Implements MaterialMix.

◆ totalMass()

double FragmentDustMixDecorator::totalMass ( ) const
overridevirtual

This function returns the total dust mass \(\mu\) per hydrogen atom for all fragments combined in the original dust mix being fragmented, without taking into account any additional fragment weights.

Implements MultiGrainPopulationInterface.


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