The SKIRT project
advanced radiative transfer for astrophysics
Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Attributes | Friends | List of all members
SphericalCellMedium Class Reference

#include <SphericalCellMedium.hpp>

Inheritance diagram for SphericalCellMedium:
Inheritance graph
[legend]

Public Types

enum class  AutoRevolveType : int { None , Inclination , Azimuth , InclinationAndAzimuth }
 
enum class  MassType : int { MassDensity , Mass , NumberDensity , Number }
 

Public Member Functions

AutoRevolveType autoRevolve () const
 
MassType massType () const
 
int numAzimuthRevolveBins () const
 
int numInclinationRevolveBins () const
 
- Public Member Functions inherited from ImportedMedium
Vec bulkVelocity (Position bfr) const override
 
int dimension () const override
 
string filename () const
 
Position generatePosition () const override
 
bool hasMagneticField () const override
 
bool hasMetallicity () const override
 
bool hasParameters () const override
 
bool hasTemperature () const override
 
bool hasVariableMix () const override
 
bool hasVelocity () const override
 
bool importMagneticField () const
 
bool importMetallicity () const
 
bool importTemperature () const
 
bool importVariableMixParams () const
 
bool importVelocity () const
 
Vec magneticField (Position bfr) const override
 
double mass () const override
 
double massDensity (Position bfr) const override
 
double massFraction () const
 
MaterialMixmaterialMix () const
 
MaterialMixFamilymaterialMixFamily () const
 
double maxTemperature () const
 
double metallicity (Position bfr) const override
 
const MaterialMixmix () const override
 
const MaterialMixmix (Position bfr) const override
 
double number () const override
 
double numberDensity (Position bfr) const override
 
int numSites () const override
 
double opticalDepthX (double lambda) const override
 
double opticalDepthY (double lambda) const override
 
double opticalDepthZ (double lambda) const override
 
void parameters (Position bfr, Array &params) const override
 
Position sitePosition (int index) const override
 
const Snapshotsnapshot () const
 
double temperature (Position bfr) const override
 
string useColumns () const
 
virtual Vec bulkVelocity (Position bfr) const =0
 
virtual int dimension () const =0
 
virtual Position generatePosition () const =0
 
virtual bool hasMagneticField () const =0
 
virtual bool hasMetallicity () const =0
 
virtual bool hasParameters () const =0
 
virtual bool hasTemperature () const =0
 
virtual bool hasVariableMix () const =0
 
virtual bool hasVelocity () const =0
 
virtual Vec magneticField (Position bfr) const =0
 
virtual double mass () const =0
 
virtual double massDensity (Position bfr) const =0
 
virtual double metallicity (Position bfr) const =0
 
virtual const MaterialMixmix () const =0
 
virtual const MaterialMixmix (Position bfr) const =0
 
virtual double number () const =0
 
virtual double numberDensity (Position bfr) const =0
 
virtual double opticalDepthX (double lambda) const =0
 
virtual double opticalDepthY (double lambda) const =0
 
virtual double opticalDepthZ (double lambda) const =0
 
virtual void parameters (Position bfr, Array &params) const =0
 
virtual double temperature (Position bfr) const =0
 
- 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 SiteListInterface
virtual ~SiteListInterface ()
 
virtual int numSites () const =0
 
virtual Position sitePosition (int index) const =0
 

Protected Member Functions

 SphericalCellMedium ()
 
SnapshotcreateAndOpenSnapshot () override
 
- Protected Member Functions inherited from ImportedMedium
 ImportedMedium ()
 
 ~ImportedMedium ()
 
virtual SnapshotcreateAndOpenSnapshot ()=0
 
void setupSelfAfter () override
 
- Protected Member Functions inherited from Medium
 Medium ()
 
- 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 ()
 
- Protected Member Functions inherited from SiteListInterface
 SiteListInterface ()
 

Private Types

using BaseType = ImportedMedium
 
using ItemType = SphericalCellMedium
 

Private Attributes

AutoRevolveType _autoRevolve
 
MassType _massType
 
int _numAzimuthRevolveBins
 
int _numInclinationRevolveBins
 

Friends

class ItemRegistry
 

Detailed Description

A SphericalCellMedium instance represents a transfer medium with a spatial density distribution (and, optionally, other properties) described by a list of spherical cells lined up with the spherical coordinate axes; refer to the SphericalCellSnapshot class for more information. The cell data is usually extracted from a cosmological simulation snapshot, and it must be provided in a column text file formatted as described below.

Refer to the description of the TextInFile class for information on overall formatting and on how to include header lines specifying the units for each column in the input file. In case the input file has no unit specifications, the default units mentioned below are used instead. The number of columns expected in the input file depends on the options configured by the user for this SphericalCellMedium instance:

rmin(pc)θmin(deg)φmin(deg)rmax(pc)θmax(deg)φmax(deg){ρ(Mpc3)|M(M)|n(cm3)|N(1)}[Z(1)][T(K)]

[vx(km/s)vy(km/s)vz(km/s)][Bx(μG)By(μG)Bz(μG)][mix family params]

The first six columns specify the coordinates of the bordering surfaces of the cell. The autoRevolve property controls a feature to automatically revolve 1D or 2D data to 3D. See the SphericalCellSnapshot class for more information.

Depending on the value of the massType option, the seventh column lists the average mass density ρ, the integrated mass M, the average number density n, or the integrated number density N for the cell.

If the importMetallicity option is enabled, the next column specifies a "metallicity" fraction, which is multiplied with the mass/density column to obtain the actual mass/density of the cell. If the importTemperature option is enabled, the next column specifies a temperature. If this temperature is higher than the maximum configured temperature, the mass and density of the cell are set to zero, regardless of the mass or density specified in the seventh column. If the importTemperature option is disabled, or the maximum temperature value is set to zero, such a cutoff is not applied.

If both the importMetallicity and importTemperature options are enabled, this leads to the following expression for the mass of an imported particle:

Mimported={fmassZMifT<TmaxorTmax=00otherwise

If the importVelocity option is enabled, the subsequent three columns specify the vR, vφ, vz components of the bulk velocity, in spherical coordinates, for the material represented by the cell.

If the importMagneticField option is enabled, the subsequent three columns specify the BR, Bφ, Bz magnetic field vector components for the cell, in spherical coordinates.

Finally, if the importVariableMixParams option is enabled, the remaining columns specify the parameters used by the configured material mix family to select a particular material mix for the cell.

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.

Member Enumeration Documentation

◆ AutoRevolveType

enum class SphericalCellMedium::AutoRevolveType : int
strong

The enumeration type for selecting the auto-revolve option.

None : "no auto-revolve" .

Inclination : "auto-revolve inclination" .

Azimuth : "auto-revolve azimuth" .

InclinationAndAzimuth : "auto-revolve both inclination and azimuth" .

◆ MassType

enum class SphericalCellMedium::MassType : int
strong

The enumeration type indicating the type of mass quantity to be imported.

MassDensity : "mass density" .

Mass : "mass (volume-integrated)" .

NumberDensity : "number density" .

Number : "number (volume-integrated)" .

Constructor & Destructor Documentation

◆ SphericalCellMedium()

SphericalCellMedium::SphericalCellMedium ( )
inlineprotected

Default constructor for concrete Item subclass SphericalCellMedium : "a transfer medium imported from spherical cell data" .

Member Function Documentation

◆ autoRevolve()

SphericalCellMedium::autoRevolve ( ) const
inline

This function returns the value of the discoverable AutoRevolveType enumeration property autoRevolve : "automatically revolve 1D or 2D data to a 3D model" .

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

◆ createAndOpenSnapshot()

Snapshot * SphericalCellMedium::createAndOpenSnapshot ( )
overrideprotectedvirtual

This function constructs a new SphericalCellSnapshot object, calls its open() function, configures it to import a mass or density column, and finally returns a pointer to the object. Ownership of the Snapshot object is transferred to the caller.

Implements ImportedMedium.

◆ massType()

SphericalCellMedium::massType ( ) const
inline

This function returns the value of the discoverable MassType enumeration property massType : "the type of mass quantity to be imported" .

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

◆ numAzimuthRevolveBins()

SphericalCellMedium::numAzimuthRevolveBins ( ) const
inline

This function returns the value of the discoverable integer property numAzimuthRevolveBins : "the number of azimuth bins for auto-revolving 1D or 2D data" .

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

The minimum value for this property is "2" .

The maximum value for this property is "1024" .

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

◆ numInclinationRevolveBins()

SphericalCellMedium::numInclinationRevolveBins ( ) const
inline

This function returns the value of the discoverable integer property numInclinationRevolveBins : "the number of inclination bins for auto-revolving 1D or 2D data" .

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

The minimum value for this property is "2" .

The maximum value for this property is "1024" .

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


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