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

#include <ParticleSource.hpp>

Inheritance diagram for ParticleSource:
Inheritance graph
[legend]

Public Member Functions

SmoothingKernelsmoothingKernel () const
 
- Public Member Functions inherited from ImportedSource
int dimension () const override
 
string filename () const
 
bool hasVelocity () const override
 
bool importCurrentMass () const
 
bool importVelocity () const
 
bool importVelocityDispersion () const
 
void launch (PhotonPacket *pp, size_t historyIndex, double L) const override
 
double luminosity () const override
 
double meanSpecificLuminosity (const Band *band, int m) const
 
double meanSpecificLuminosity (Range wavelengthRange, int m) const
 
void prepareForLaunch (double sourceBias, size_t firstIndex, size_t numIndices) override
 
SEDFamilysedFamily () const
 
const Snapshotsnapshot () const
 
double specificLuminosity (double wavelength) const override
 
double specificLuminosity (double wavelength, int m) const
 
string useColumns () const
 
Range wavelengthRange () const override
 
- Public Member Functions inherited from Source
virtual int dimension () const =0
 
virtual bool hasVelocity () const =0
 
virtual void launch (PhotonPacket *pp, size_t historyIndex, double L) const =0
 
virtual double luminosity () const =0
 
virtual void prepareForLaunch (double sourceBias, size_t firstIndex, size_t numIndices)
 
double sourceWeight () const
 
virtual double specificLuminosity (double wavelength) const =0
 
double wavelengthBias () const
 
WavelengthDistributionwavelengthBiasDistribution () 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 WavelengthRangeInterface
virtual ~WavelengthRangeInterface ()
 
virtual Range wavelengthRange () const =0
 

Protected Member Functions

 ParticleSource ()
 
SnapshotcreateAndOpenSnapshot () override
 
- Protected Member Functions inherited from ImportedSource
 ImportedSource ()
 
 ~ImportedSource ()
 
virtual SnapshotcreateAndOpenSnapshot ()=0
 
void setupSelfAfter () override
 
- Protected Member Functions inherited from Source
 Source ()
 
void informAvailableWavelengthRange (Range available, string itemType)
 
Randomrandom () const
 
void setupSelfBefore () override
 
- 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 SourceWavelengthRangeInterface
 SourceWavelengthRangeInterface ()
 
- Protected Member Functions inherited from WavelengthRangeInterface
 WavelengthRangeInterface ()
 

Private Types

using BaseType = ImportedSource
 
using ItemType = ParticleSource
 

Private Attributes

SmoothingKernel_smoothingKernel
 

Friends

class ItemRegistry
 

Detailed Description

A ParticleSource instance represents a primary radiation source with a spatial and spectral luminosity distribution described by a list of smoothed particles. The particle 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 ParticleSource instance, including the selected SEDFamily.

\[ x\,(\mathrm{pc}) \quad y\,(\mathrm{pc}) \quad z\,(\mathrm{pc}) \quad h\,(\mathrm{pc}) \quad [ v_x\,(\mathrm{km/s}) \quad v_y\,(\mathrm{km/s}) \quad v_z\,(\mathrm{km/s}) \quad [ \sigma_v\,(\mathrm{km/s}) ] ] \quad [M_\mathrm{curr}\,(\mathrm{M}_\odot)] \quad \dots \text{SED family parameters}\dots \]

The first three columns are the \(x\), \(y\) and \(z\) coordinates of the particle, and the fourth column is the particle smoothing length \(h\). If the importVelocity option is enabled, the next three columns specify the \(v_x\), \(v_y\), \(v_z\) bulk velocity components of the source population represented by the particle. If additionally the importVelocityDispersion option is enabled, the next column specifies the velocity dispersion \(\sigma_v\), adjusting the velocity for each photon packet launch with a random offset sampled from a spherically symmetric Gaussian distribution.

The remaining columns specify the parameters required by the configured SED family to select and scale the appropriate SED. For example for the Bruzual-Charlot SED family, the remaining columns provide the initial mass, the metallicity, and the age of the stellar population represented by the particle. Refer to the documentation of the configured type of SEDFamily for information about the expected parameters and their default units.

Constructor & Destructor Documentation

◆ ParticleSource()

ParticleSource::ParticleSource ( )
inlineprotected

Default constructor for concrete Item subclass ParticleSource : "a primary source imported from smoothed particle data" .

Member Function Documentation

◆ createAndOpenSnapshot()

Snapshot * ParticleSource::createAndOpenSnapshot ( )
overrideprotectedvirtual

This function constructs a new ParticleSnapshot object, calls its open() function, passes the smoothing kernel selected by the user to it, and returns a pointer to the object. Ownership of the Snapshot object is transferred to the caller.

Implements ImportedSource.

◆ smoothingKernel()

ParticleSource::smoothingKernel ( ) const
inline

This function returns the value of the discoverable item property smoothingKernel : "the kernel for interpolating the smoothed particles" .

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

This property is displayed only if the Boolean expression "Level2" 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: