The SKIRT project
advanced radiative transfer for astrophysics
AbsorptionOnlyMaterialMixDecorator Class Reference

#include <AbsorptionOnlyMaterialMixDecorator.hpp>

Inheritance diagram for AbsorptionOnlyMaterialMixDecorator:

Public Member Functions

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

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

Private Types

using BaseType
using ItemType

Private Attributes

MaterialMix_materialMix

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

AbsorptionOnlyMaterialMixDecorator is a material mix decorator that removes scattering from any material mix, passing through just the absorption properties. It can be used to evaluate the effects of scattering on observations. As a result, one can use SKIRT to test different versions of approximate radiation transfer:

  • a version that accounts for scattering out of the line of sight but neglects scattering into the line of sight; this can be obtained from the direct flux offered by the SKIRT instruments.
  • a version that neglects scattering both out of and into the line of sight; this can be obtained by removing all scattering from the material mix using this decorator.

Fragmented dust mixes

When working with fragmented dust mixes, first apply the FragmentDustMixDecorator to the original MultiGrainDustMix and then apply the AbsorptionOnlyMaterialMixDecorator to the FragmentDustMixDecorator. The other way around doesn't work because the FragmentDustMixDecorator explicitly expects a MultiGrainDustMix while the AbsorptionOnlyMaterialMixDecorator inherits directly from MaterialMix. This is not really a limitation as the intended goal is properly achieved.

Limitations

The current implementation of this decorator does not support secondary emission. To make this work, the decorator would need to pass through all material mix functions related to dust and/or gas emission, and the dynamic casting of material mix subclasses in the secondary emission framework would need to be replaced by the SimulationItem::interface() mechanism.

Similarly, the current implementation of the decorator does not support dynamic dust destruction. To make this work, the decorator would need to implement the additional functions in the FragmentDustMixDecorator class provided for this purpose as a separate interface, and the DustDestructionRecipe class would need to use this interface rather than calling the FragmentDustMixDecorator class directly.

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

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

Constructor & Destructor Documentation

◆ AbsorptionOnlyMaterialMixDecorator()

AbsorptionOnlyMaterialMixDecorator::AbsorptionOnlyMaterialMixDecorator ( )
inlineprotected

Default constructor for concrete Item subclass AbsorptionOnlyMaterialMixDecorator: "a decorator that removes scattering from any material mix".

Member Function Documentation

◆ hasDynamicMediumState()

virtual DynamicStateType AbsorptionOnlyMaterialMixDecorator::hasDynamicMediumState ( ) const
overridevirtual

This function returns an enumeration indicating whether the decorated material mix offers an algorithm to update its specific medium state, and if so, when the updateSpecificState() function should be called.

Reimplemented from MaterialMix.

◆ hasExtraSpecificState()

virtual bool AbsorptionOnlyMaterialMixDecorator::hasExtraSpecificState ( ) const
overridevirtual

This function returns true if the cross sections returned by the decorated material mix may depend on the values of specific state variables other than the number density, and false otherwise.

Reimplemented from MaterialMix.

◆ hasNegativeExtinction()

virtual bool AbsorptionOnlyMaterialMixDecorator::hasNegativeExtinction ( ) const
overridevirtual

This function returns true if the extinction cross section (the sum of the absorption and scattering cross section) for the decorated material mix can be negative, and false otherwise.

Reimplemented from MaterialMix.

◆ hasPolarizedAbsorption()

virtual bool AbsorptionOnlyMaterialMixDecorator::hasPolarizedAbsorption ( ) const
overridevirtual

This function returns true if the absorption of radiation for the decorated material mix is dichroic (i.e. the absorption cross section depends on the polarization state of incoming photon and the polarization state is adjusted during absorption), and false otherwise.

Reimplemented from MaterialMix.

◆ hasPolarizedScattering()

virtual bool AbsorptionOnlyMaterialMixDecorator::hasPolarizedScattering ( ) const
overridevirtual

This function returns true if the decorated material mix supports polarization during scattering events, and false otherwise.

Reimplemented from MaterialMix.

◆ hasResonantScattering()

virtual bool AbsorptionOnlyMaterialMixDecorator::hasResonantScattering ( ) const
overridevirtual

This function returns true if scattering for the decorated material mix is resonant (such as for Lyman-alpha), and false otherwise.

Reimplemented from MaterialMix.

◆ indicativeTemperature()

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

This function returns an indicative temperature for the material represented by the specified material state and the decorated material mix, assuming an embedding radiation field specified by the mean intensities \((J_\lambda)_\ell\), if available. The interpretation of the indicative temperature depends heavily on the material type.

Reimplemented from MaterialMix.

◆ initializeSpecificState()

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

This function initializes any specific state variables requested by the decorated material mix through the specificStateVariableInfo() function except for the number density.

Reimplemented from MaterialMix.

◆ isSpecificStateConverged()

virtual bool AbsorptionOnlyMaterialMixDecorator::isSpecificStateConverged ( int numCells,
int numUpdated,
int numNotConverged,
MaterialState * currentAggregate,
MaterialState * previousAggregate ) const
overridevirtual

If the decorated material mix has a dynamic medium state, i.e. if the hasDynamicMediumState() function returns anything other than None, this function is invoked (once) after updateSpecificState() has been called for all spatial cells. The numCells, numUpdated and numNotConverged arguments specify respectively the number of spatial cells in the simulation, the number of cells updated during this update cycle, and the number of updated cells that have not yet converged. The currentAggregate and previousAggregate arguments provide the current and previous aggregate material states for this material mix (for more information, see the section on aggregation in the MediumState class header). Based on this information and any relevant user configuration options, the function returns true if the medium state is considered to be converged and false if not.

Reimplemented from MaterialMix.

◆ mass()

virtual double AbsorptionOnlyMaterialMixDecorator::mass ( ) const
overridevirtual

This function returns the mass per entity \(\mu\) for the decorated material mix.

Implements MaterialMix.

◆ materialMix()

MaterialMix * AbsorptionOnlyMaterialMixDecorator::materialMix ( ) const
inline

This function returns the value of the discoverable item property materialMix: "the material mix to be decorated".

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

◆ materialType()

virtual MaterialType AbsorptionOnlyMaterialMixDecorator::materialType ( ) const
overridevirtual

This function returns the fundamental material type represented by the decorated material mix.

Implements MaterialMix.

◆ numPopulations()

int AbsorptionOnlyMaterialMixDecorator::numPopulations ( ) const
overridevirtual

If the decorated material mix offers the MultiGrainPopulationInterface, this function returns the result returned by the decorated material mix. Otherwise it throws a fatal error.

Implements MultiGrainPopulationInterface.

◆ offersInterface()

bool AbsorptionOnlyMaterialMixDecorator::offersInterface ( const std::type_info & interfaceTypeInfo) const
overrideprotectedvirtual

This function is used by the interface() function to ensure that the receiving item can actually offer the specified interface. If the requested interface is the MultiGrainPopulationInterface, the implementation in this class returns true if the decorated material mix offers the MultiGrainPopulationInterface, and false otherwise. For other requested interfaces, the function invokes its counterpart in the base class.

Reimplemented from SimulationItem.

◆ opacityAbs()

virtual double AbsorptionOnlyMaterialMixDecorator::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, material state, and photon properties, for the decorated material mix.

Implements MaterialMix.

◆ opacityExt()

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

This function returns the absorption opacity for the decorated material mix as the extinction opacity, because this decorator blocks scattering: \(k^\text{ext}=k^\text{abs}\) for the given wavelength, material state, and photon properties.

Implements MaterialMix.

◆ opacitySca()

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

This function always returns zero as the scattering opacity \(k^\text{sca}=n\varsigma^\text{sca}\) for the given wavelength, material state, and photon properties, because this decorator blocks scattering.

Implements MaterialMix.

◆ parameterInfo()

virtual vector< SnapshotParameter > AbsorptionOnlyMaterialMixDecorator::parameterInfo ( ) const
overridevirtual

This function returns the number and type of import parameters required by the decorated material mix as a list of SnapshotParameter objects.

Reimplemented from MaterialMix.

◆ populationBulkDensity()

double AbsorptionOnlyMaterialMixDecorator::populationBulkDensity ( int c) const
overridevirtual

If the decorated material mix offers the MultiGrainPopulationInterface, this function returns the result returned by the decorated material mix. Otherwise it throws a fatal error.

Implements MultiGrainPopulationInterface.

◆ populationGrainType()

string AbsorptionOnlyMaterialMixDecorator::populationGrainType ( int c) const
overridevirtual

If the decorated material mix offers the MultiGrainPopulationInterface, this function returns the result returned by the decorated material mix. Otherwise it throws a fatal error.

Implements MultiGrainPopulationInterface.

◆ populationMass()

double AbsorptionOnlyMaterialMixDecorator::populationMass ( int c) const
overridevirtual

If the decorated material mix offers the MultiGrainPopulationInterface, this function returns the result returned by the decorated material mix. Otherwise it throws a fatal error.

Implements MultiGrainPopulationInterface.

◆ populationSizeDistribution()

const GrainSizeDistribution * AbsorptionOnlyMaterialMixDecorator::populationSizeDistribution ( int c) const
overridevirtual

If the decorated material mix offers the MultiGrainPopulationInterface, this function returns the result returned by the decorated material mix. Otherwise it throws a fatal error.

Implements MultiGrainPopulationInterface.

◆ populationSizeRange()

Range AbsorptionOnlyMaterialMixDecorator::populationSizeRange ( int c) const
overridevirtual

If the decorated material mix offers the MultiGrainPopulationInterface, this function returns the result returned by the decorated material mix. Otherwise it throws a fatal error.

Implements MultiGrainPopulationInterface.

◆ sectionAbs()

virtual double AbsorptionOnlyMaterialMixDecorator::sectionAbs ( double lambda) const
overridevirtual

This function returns the default absorption cross section per entity \(\varsigma^{\text{abs}}_{\lambda}\) at wavelength \(\lambda\) for the decorated material mix.

Implements MaterialMix.

◆ sectionExt()

virtual double AbsorptionOnlyMaterialMixDecorator::sectionExt ( double lambda) const
overridevirtual

This function returns the absorption cross section per entity of the decorated material mix as the default extinction cross section per entity, because this decorator blocks scattering: \(\varsigma^{\text{ext}}_{\lambda} = \varsigma^{\text{abs}}_{\lambda}\) at all wavelengths \(\lambda\).

Implements MaterialMix.

◆ sectionSca()

virtual double AbsorptionOnlyMaterialMixDecorator::sectionSca ( double lambda) const
overridevirtual

This function always returns zero as the default scattering cross section per entity \(\varsigma^{\text{sca}}_{\lambda}\) at any wavelength \(\lambda\), because this decorator blocks scattering.

Implements MaterialMix.

◆ specificStateVariableInfo()

virtual vector< StateVariable > AbsorptionOnlyMaterialMixDecorator::specificStateVariableInfo ( ) const
overridevirtual

This function returns a list of StateVariable objects describing the specific state variables used by the decorated material mix.

Implements MaterialMix.

◆ totalMass()

double AbsorptionOnlyMaterialMixDecorator::totalMass ( ) const
overridevirtual

If the decorated material mix offers the MultiGrainPopulationInterface, this function returns the result returned by the decorated material mix. Otherwise it throws a fatal error.

Implements MultiGrainPopulationInterface.

◆ updateSpecificState()

virtual UpdateStatus AbsorptionOnlyMaterialMixDecorator::updateSpecificState ( MaterialState * state,
const Array & Jv ) const
overridevirtual

If the decorated material mix has a dynamic medium state, i.e. if the hasDynamicMediumState() function returns anything other than None, this function is invoked for each spatial cell at the end of each relevant primary or secondary emission segment. Based on the specified radiation field, if needed, the function updates any values in the specific material state for this cell and medium component that may inform the local emission and/or extinction properties of the material. The function returns the update status as described for the UpdateStatus class.

Reimplemented from MaterialMix.


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