The SKIRT project
advanced radiative transfer for astrophysics
ImportedGeometry Class Referenceabstract

#include <ImportedGeometry.hpp>

Inheritance diagram for ImportedGeometry:

Public Member Functions

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
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 ()

Protected Member Functions

 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
Protected Member Functions inherited from Item
 Item ()
Protected Member Functions inherited from SiteListInterface
 SiteListInterface ()

Private Types

using BaseType
using ItemType

Private Attributes

string _filename
bool _importMetallicity
bool _importTemperature
double _maxTemperature
double _norm
Snapshot_snapshot
string _useColumns

Friends

class ItemRegistry

Detailed Description

ImportedGeometry is an abstract class for describing 3D geometries with a spatial density distribution imported from an input file. The input data is usually derived from a hydrodynamical simulation snapshot. Various types of snapshots are supported by subclasses of this class. Refer to the subclass documentation for information on the file format.

When an item of this type is used, the names provided by the conditional value expression "SiteListInterface" are inserted into the name sets used for evaluating Boolean expressions.

Properties of sub-types of this type are listed in user interfaces somewhere in between the properties of this type.

Constructor & Destructor Documentation

◆ ImportedGeometry()

ImportedGeometry::ImportedGeometry ( )
inlineprotected

Default constructor for abstract Item subclass ImportedGeometry: "a geometry imported from snapshot data".

◆ ~ImportedGeometry()

ImportedGeometry::~ImportedGeometry ( )
protected

The destructor deletes the snapshot object, if present.

Member Function Documentation

◆ createAndOpenSnapshot()

virtual Snapshot * ImportedGeometry::createAndOpenSnapshot ( )
protectedpure virtual

This function constructs a new Snapshot object of the type appropriate for the subclass, calls its open() function, configures the mass or density column, and returns a pointer to the object. Ownership of the Snapshot object is transferred to the caller.

Implemented in AdaptiveMeshGeometry, CellGeometry, CylindricalCellGeometry, ParticleGeometry, SphericalCellGeometry, and VoronoiMeshGeometry.

◆ density()

double ImportedGeometry::density ( Position bfr) const
overridevirtual

This function returns the density for this geometry at the given position. It simply calls the corresponding function in the snapshot object.

Implements Geometry.

◆ filename()

string ImportedGeometry::filename ( ) const
inline

This function returns the value of the discoverable string property filename: "the name of the file to be imported".

◆ generatePosition()

Position ImportedGeometry::generatePosition ( ) const
overridevirtual

This function generates a random position from the geometry's spatial density distribution. It simply calls the corresponding function in the snapshot object.

Implements Geometry.

◆ importMetallicity()

bool ImportedGeometry::importMetallicity ( ) const
inline

This function returns the value of the discoverable Boolean property importMetallicity: "import a metallicity column".

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

◆ importTemperature()

bool ImportedGeometry::importTemperature ( ) const
inline

This function returns the value of the discoverable Boolean property importTemperature: "import a temperature column".

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

◆ maxTemperature()

double ImportedGeometry::maxTemperature ( ) const
inline

This function returns the value of the discoverable double property maxTemperature: "the maximum temperature for included mass (or zero to include all)".

This property represents a physical quantity of type "temperature".

The minimum value for this property is "[0 K".

The maximum value for this property is "1000000 K]".

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

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

◆ numSites()

int ImportedGeometry::numSites ( ) const
overridevirtual

This function returns the number of entities (particles or cells) used for defining the density distribution represented by the snapshot. The function is part of the SiteListInterface. It simply calls the corresponding function in the snapshot object.

Implements SiteListInterface.

◆ setupSelfAfter()

void ImportedGeometry::setupSelfAfter ( )
overrideprotectedvirtual

This function imports the snapshot data from the input file through a Snapshot object of the appropriate type. Specifically, it first calls the createSnapshot() function, which must be implemented in a subclass, to construct and open a Snapshot object of the appropriate type. It then passes the user-configurable options of this class to the Snapshot object and tells it to import the data.

Reimplemented from SimulationItem.

◆ SigmaX()

double ImportedGeometry::SigmaX ( ) const
overridevirtual

This function returns the X-axis surface density of the geometry, defined as the integration of the density along the entire X-axis. It simply calls the corresponding function in the snapshot object.

Implements Geometry.

◆ SigmaY()

double ImportedGeometry::SigmaY ( ) const
overridevirtual

This function returns the Y-axis surface density of the geometry, defined as the integration of the density along the entire Y-axis. It simply calls the corresponding function in the snapshot object.

Implements Geometry.

◆ SigmaZ()

double ImportedGeometry::SigmaZ ( ) const
overridevirtual

This function returns the Z-axis surface density of the geometry, defined as the integration of the density along the entire Z-axis. It simply calls the corresponding function in the snapshot object.

Implements Geometry.

◆ sitePosition()

Position ImportedGeometry::sitePosition ( int index) const
overridevirtual

This function returns the coordinates of the entity (particle or cell) with the specified zero-based index. If the index is out of range, the behavior is undefined. The function is part of the SiteListInterface. It simply calls the corresponding function in the snapshot object.

Implements SiteListInterface.

◆ useColumns()

string ImportedGeometry::useColumns ( ) const
inline

This function returns the value of the discoverable string property useColumns: "a list of names corresponding to columns in the file to be imported".

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

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

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