The SKIRT project
advanced radiative transfer for astrophysics
CompositeWavelengthGrid Class Reference

#include <CompositeWavelengthGrid.hpp>

Inheritance diagram for CompositeWavelengthGrid:

Public Member Functions

bool log () const
const vector< DisjointWavelengthGrid * > & wavelengthGrids () const
Public Member Functions inherited from DisjointWavelengthGrid
int bin (double lambda) const override
vector< int > bins (double lambda) const override
const Arraydlambdav () const
double effectiveWidth (int ell) const override
Array extdlambdav () const
Array extlambdav () const
const Arraylambdav () const
double leftBorder (int ell) const override
int numBins () const override
double rightBorder (int ell) const override
double transmission (int ell, double lambda) const override
double wavelength (int ell) const override
Public Member Functions inherited from WavelengthGrid
Range wavelengthRange () 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

 CompositeWavelengthGrid ()
void setupSelfAfter () override
Protected Member Functions inherited from DisjointWavelengthGrid
 DisjointWavelengthGrid ()
void setupSelfAfter () override
void setWavelengthBins (const Array &lambdav, double relativeHalfWidth, bool constantWidth=false)
void setWavelengthBorders (const Array &borderv, bool logScale)
void setWavelengthRange (const Array &lambdav, bool logScale)
void setWavelengthSegments (const Array &bordcharv)
void setWavelengthSegments (const vector< double > &borderv, const vector< double > &characv)
Protected Member Functions inherited from WavelengthGrid
 WavelengthGrid ()
Protected Member Functions inherited from SimulationItem
 SimulationItem ()
virtual bool offersInterface (const std::type_info &interfaceTypeInfo) const
virtual void setupSelfBefore ()
Protected Member Functions inherited from Item
 Item ()

Private Types

using BaseType
using ItemType

Private Attributes

bool _log
vector< DisjointWavelengthGrid * > _wavelengthGrids

Friends

class ItemRegistry

Detailed Description

The CompositeWavelengthGrid class aggregates a number of "child" wavelength grids configured by the user into a single, composite wavelength grid. All involved wavelength grids (i.e. all child grids and the composited grid) are disjoint wavelength grids, i.e. they inherit from the DisjointWavelengthGrid class. These grids have non-overlapping but possibly adjacent wavelength bins with constant maximum transmission within the bins and zero transmission outside of the bins. Refer to the DisjointWavelengthGrid class description for a more formal definition. Many of the wavelength grids frequently used in SKIRT have these properties. Refer to the list of DisjointWavelengthGrid subclasses for more information.

The wavelengthGrids property specifies a nonempty list of disjoint wavelength grids of any type and with arbitrary configuration options. To construct a single combined grid, each of the child grids is processed one by one in order of occurrence in the user configuration. After initializing the result buffer to an empty grid, the procedure composites each child grid in turn into the current contents of the result buffer. Specifically, the procedure replaces any bins in the result buffer that are overlapped by child bins by those child bins, splitting partially overlapped bins where needed. The characteristic wavelengths of the bins are preserved where possible. If needed, a new characteristic wavelength is calculated for a shortened (partially overlapped) bin from the new bin borders using linear or logarithmic interpolation as indicated by the log configuration option.

It is worth noting the following:

  • If there is just one child, the composite wavelength grid is merely a copy of that child.
  • As long as all child wavelength ranges are mutually disjoint, the order in which the children are specified is irrelevant because the wavelength bins will be automatically sorted by the compositing process. As soon as there is overlap, however, the ordering of the children determines which child’s wavelength bins will be preserved in the composite wavelength grid for the overlapping ranges. It is therefore usually preferable to sort the child wavelength grids from lower to higher resolution.
  • It is possible to nest a composite wavelength grid inside another composite wavelength grid. This allows joining multiple groups of child wavelength grids each with a different setting of the log option. However, this seems useful only in pathetic cases.

    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

◆ CompositeWavelengthGrid()

CompositeWavelengthGrid::CompositeWavelengthGrid ( )
inlineprotected

Default constructor for concrete Item subclass CompositeWavelengthGrid: "a wavelength grid composited from a list of wavelength grids".

Member Function Documentation

◆ log()

bool CompositeWavelengthGrid::log ( ) const
inline

This function returns the value of the discoverable Boolean property log: "use logarithmic scale".

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

◆ setupSelfAfter()

void CompositeWavelengthGrid::setupSelfAfter ( )
overrideprotectedvirtual

This function constructs the composite wavelength grid from the configured list of wavelength grids.

Reimplemented from SimulationItem.

◆ wavelengthGrids()

const vector< DisjointWavelengthGrid * > & CompositeWavelengthGrid::wavelengthGrids ( ) const
inline

This function returns the value of the discoverable item list property wavelengthGrids: "the wavelength grids to be composited".

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


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