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

#include <ParticleGeometry.hpp>

Inheritance diagram for ParticleGeometry:
Inheritance graph
[legend]

Public Member Functions

SmoothingKernelsmoothingKernel () const
 
- Public Member Functions inherited from ImportedGeometry
double density (Position bfr) const override
 
string filename () const
 
Position generatePosition () const override
 
bool importMetallicity () const
 
bool importTemperature () const
 
double maxTemperature () const
 
int numSites () const override
 
double SigmaX () const override
 
double SigmaY () const override
 
double SigmaZ () const override
 
Position sitePosition (int index) const override
 
string useColumns () const
 
- Public Member Functions inherited from GenGeometry
int dimension () const override
 
virtual double density (Position bfr) const =0
 
virtual int dimension () const =0
 
virtual Position generatePosition () const =0
 
virtual double SigmaX () const =0
 
virtual double SigmaY () const =0
 
virtual double SigmaZ () 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

 ParticleGeometry ()
 
SnapshotcreateAndOpenSnapshot () override
 
- Protected Member Functions inherited from ImportedGeometry
 ImportedGeometry ()
 
 ~ImportedGeometry ()
 
virtual SnapshotcreateAndOpenSnapshot ()=0
 
void setupSelfAfter () override
 
- Protected Member Functions inherited from GenGeometry
 GenGeometry ()
 
- Protected Member Functions inherited from Geometry
 Geometry ()
 
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 SiteListInterface
 SiteListInterface ()
 

Private Types

using BaseType = ImportedGeometry
 
using ItemType = ParticleGeometry
 

Private Attributes

SmoothingKernel_smoothingKernel
 

Friends

class ItemRegistry
 

Detailed Description

A ParticleGeometry instance represents a 3D geometry with a spatial density 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. The total mass in the geometry is normalized to unity after importing the data.

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 input file should contain 5, 6, or 7 columns, depending on the options configured by the user for this ParticleGeometry instance:

\[ x\,(\mathrm{pc}) \quad y\,(\mathrm{pc}) \quad z\,(\mathrm{pc}) \quad h\,(\mathrm{pc}) \quad M\,(\mathrm{M}_\odot) \quad [Z\,(1)] \quad [T\,(\mathrm{K})] \]

The first three columns are the \(x\), \(y\) and \(z\) coordinates of the particle, the fourth column is the particle smoothing length \(h\), and the fifth column is the mass \(M\) of the particle. The mass units are actually irrelevant because the total mass in the geometry will be normalized to unity after importing the data. However, the import procedure still insists on knowing the units.

If the importMetallicity option is enabled, the next column specifies a "metallicity" fraction, which in this context is simply multiplied with the mass column to obtain the actual mass of the particle. If the importTemperature option is enabled, the next column specifies a temperature. If this temperature is higher than the maximum configured temperature, the particle is ignored. If the importTemperature option is disabled, or the maximum temperature value is set to zero, the particle is never ignored.

Constructor & Destructor Documentation

◆ ParticleGeometry()

ParticleGeometry::ParticleGeometry ( )
inlineprotected

Default constructor for concrete Item subclass ParticleGeometry : "a geometry imported from smoothed particle data" .

Member Function Documentation

◆ createAndOpenSnapshot()

Snapshot * ParticleGeometry::createAndOpenSnapshot ( )
overrideprotectedvirtual

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

Implements ImportedGeometry.

◆ smoothingKernel()

ParticleGeometry::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: