The SKIRT project
advanced radiative transfer for astrophysics
AdaptiveMeshGeometry Class Reference

#include <AdaptiveMeshGeometry.hpp>

Inheritance diagram for AdaptiveMeshGeometry:

Protected Member Functions

 AdaptiveMeshGeometry ()
AdaptiveMeshSnapshotadaptiveMesh () const override
SnapshotcreateAndOpenSnapshot () override
Protected Member Functions inherited from MeshGeometry
 MeshGeometry ()
const Boxdomain () const
void setupSelfBefore () override
Protected Member Functions inherited from ImportedGeometry
 ImportedGeometry ()
 ~ImportedGeometry ()
void setupSelfAfter () override
Protected Member Functions inherited from GenGeometry
 GenGeometry ()
Protected Member Functions inherited from Geometry
 Geometry ()
Randomrandom () const
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 ()
Protected Member Functions inherited from AdaptiveMeshInterface
 AdaptiveMeshInterface ()

Private Types

using BaseType
using ItemType

Private Attributes

AdaptiveMeshSnapshot_adaptiveMeshSnapshot

Friends

class ItemRegistry

Additional Inherited Members

Public Types inherited from MeshGeometry
enum class  MassType : int { MassDensity , Mass , NumberDensity , Number }
Public Member Functions inherited from MeshGeometry
MassType massType () const
double maxX () const
double maxY () const
double maxZ () const
double minX () const
double minY () const
double minZ () 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
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 ()
Public Member Functions inherited from AdaptiveMeshInterface
virtual ~AdaptiveMeshInterface ()

Detailed Description

An AdaptiveMeshGeometry instance represents a 3D geometry with a spatial density distribution described by an Adaptive Mesh Refinement (AMR) grid partitioning a cuboidal domain. The 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 AdaptiveMeshSnapshot class for information on the structure of an adaptive mesh and on how to represent it in text column file format. 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 1, 2, or 3 columns, depending on the options configured by the user for this AdaptiveMeshGeometry instance:

\[ \{\, \rho\,(\text{M}_\odot\,\text{pc}^{-3}) \;\;|\;\; M\,(\text{M}_\odot) \;\;|\;\; n\,(\text{cm}^{-3}) \;\;|\;\; N\,(1) \,\} \quad [Z\,(1)] \quad [T\,(\mathrm{K})] \]

Depending on the value of the massType option, the first column lists the average mass density \(\rho\), the integrated mass \(M\), the average number density \(n\), or the integrated number density \(N\) for the cell corresponding to the site. The precise units for this field are 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/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 for the site are set to zero, regardless of the mass or density specified in the fourth column. If the importTemperature option is disabled, or the maximum temperature value is set to zero, such a cutoff is not applied.

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

Constructor & Destructor Documentation

◆ AdaptiveMeshGeometry()

AdaptiveMeshGeometry::AdaptiveMeshGeometry ( )
inlineprotected

Default constructor for concrete Item subclass AdaptiveMeshGeometry: "a geometry imported from data represented on an adaptive mesh (AMR grid)".

Member Function Documentation

◆ adaptiveMesh()

AdaptiveMeshSnapshot * AdaptiveMeshGeometry::adaptiveMesh ( ) const
overrideprotectedvirtual

This function implements the AdaptiveMeshInterface interface. It returns a pointer to the adaptive mesh snapshot maintained by this geometry.

Implements AdaptiveMeshInterface.

◆ createAndOpenSnapshot()

Snapshot * AdaptiveMeshGeometry::createAndOpenSnapshot ( )
overrideprotectedvirtual

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

Implements ImportedGeometry.


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