The SKIRT project
advanced radiative transfer for astrophysics
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Snapshot Class Referenceabstract

#include <Snapshot.hpp>

Inheritance diagram for Snapshot:
Inheritance graph
[legend]

Public Member Functions

 Snapshot ()
 
virtual ~Snapshot ()
 
double age (int m) const
 
double age (Position bfr) const
 
double currentMass (int m) const
 
double currentMass (Position bfr) const
 
virtual double density (int m) const =0
 
virtual double density (Position bfr) const =0
 
virtual Box extent () const =0
 
virtual Position generatePosition () const =0
 
virtual Position generatePosition (int m) const =0
 
virtual void getEntities (EntityCollection &entities, Position bfr) const =0
 
virtual void getEntities (EntityCollection &entities, Position bfr, Direction bfk) const =0
 
bool hasAge () const
 
bool hasCurrentMass () const
 
bool hasInitialMass () const
 
bool hasMagneticField () const
 
bool hasMetallicity () const
 
bool hasParameters () const
 
bool hasTemperature () const
 
bool hasVelocity () const
 
bool hasVelocityDispersion () const
 
bool holdsNumber () const
 
void importBox ()
 
void importCurrentMass ()
 
void importMagneticField ()
 
void importMass ()
 
void importMassDensity ()
 
void importMetallicity ()
 
void importNumber ()
 
void importNumberDensity ()
 
void importParameters (const vector< SnapshotParameter > &parameters)
 
void importPosition ()
 
void importSize ()
 
void importTemperature ()
 
void importVelocity ()
 
void importVelocityDispersion ()
 
double initialMass (int m) const
 
double initialMass (Position bfr) const
 
Vec magneticField (int m) const
 
Vec magneticField (Position bfr) const
 
virtual double mass () const =0
 
double metallicity (int m) const
 
double metallicity (Position bfr) const
 
virtual int numEntities () const =0
 
void open (const SimulationItem *item, string filename, string description)
 
void parameters (int m, Array &params) const
 
void parameters (Position bfr, Array &params) const
 
virtual Position position (int m) const =0
 
virtual void readAndClose ()
 
void setMassDensityPolicy (double multiplier, double maxTemperature, bool useMetallicity)
 
void setNeedGetEntities ()
 
double SigmaX () const
 
double SigmaY () const
 
double SigmaZ () const
 
double temperature (int m) const
 
double temperature (Position bfr) const
 
void useColumns (string columns)
 
Vec velocity (int m) const
 
Vec velocity (Position bfr) const
 
double velocityDispersion (int m) const
 
double velocityDispersion (Position bfr) const
 
double volume () const
 
virtual double volume (int m) const =0
 

Protected Member Functions

int ageIndex () const
 
int boxIndex () const
 
int currentMassIndex () const
 
int densityIndex () const
 
bool hasMassDensityPolicy () const
 
TextInFileinfile ()
 
int initialMassIndex () const
 
Loglog () const
 
void logMassStatistics (int numIgnored, double totalOriginalMass, double totalMetallicMass, double totalEffectiveMass)
 
int magneticFieldIndex () const
 
int massIndex () const
 
double maxTemperature () const
 
int metallicityIndex () const
 
double multiplier () const
 
virtual int nearestEntity (Position bfr) const =0
 
bool needGetEntities () const
 
int numParameters () const
 
int parametersIndex () const
 
int positionIndex () const
 
virtual const Arrayproperties (int m) const =0
 
Randomrandom () const
 
void setContext (const SimulationItem *item)
 
int sizeIndex () const
 
int temperatureIndex () const
 
Unitsunits () const
 
bool useMetallicity () const
 
bool useTemperatureCutoff () const
 
int velocityDispersionIndex () const
 
int velocityIndex () const
 

Private Attributes

int _ageIndex
 
int _boxIndex
 
int _currentMassIndex
 
int _densityIndex
 
bool _hasDensityPolicy
 
bool _holdsNumber
 
TextInFile_infile
 
int _initialMassIndex
 
Log_log
 
int _magneticFieldIndex
 
int _massIndex
 
double _maxTemperature
 
int _metallicityIndex
 
double _multiplier
 
bool _needGetEntities
 
int _nextIndex
 
int _numParameters
 
int _parametersIndex
 
int _positionIndex
 
Random_random
 
int _sizeIndex
 
int _temperatureIndex
 
Units_units
 
bool _useMetallicity
 
int _velocityDispersionIndex
 
int _velocityIndex
 

Detailed Description

Snapshot is an abstract base class for representing snapshot data that is imported from a column text file and is used to define the properties of primary sources or transfer media. This base class offers facilities to handle the input options, such as determining which columns are to be imported from the text file, and defines a common interface for all snapshot types, for example to obtain the density at a given position. The actual implementation must be provided in a derived class for each snapshot type.

Some snapshot types use smoothed particles and some use spatial cells as their basic constituents. To avoid mentioning both, we use the generic term entity for referring to either particles or cells.

A Snapshot instance must be initialized using the following strict calling sequence; calling any of the getters before the initialization sequence has completed results in undefined behavior:

The functions for extracting information from a snapshot once it is loaded are thread-safe. However, the functions for configuring options and reading the snapshot file are not thread-safe; they must be called from a single thread (for each snapshot object).

Constructor & Destructor Documentation

◆ Snapshot()

Snapshot::Snapshot ( )

The default constructor initializes the snapshot in an invalid state; see the description of the required calling sequence in the class header.

◆ ~Snapshot()

virtual Snapshot::~Snapshot ( )
virtual

The destructor deletes the input file object, if it would still be present. The fact that the destructor is virtual ensures that derived classes can be propertly destructed through a pointer to this base class.

Member Function Documentation

◆ age() [1/2]

double Snapshot::age ( int  m) const

This function returns the age of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the age is not being imported, or the index is out of range, the behavior is undefined.

◆ age() [2/2]

double Snapshot::age ( Position  bfr) const

This function returns the age of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns zero. If the age is not being imported, the behavior is undefined.

◆ ageIndex()

int Snapshot::ageIndex ( ) const
inlineprotected

This function returns the column index of the age field, or -1 if this is not being imported, for use by subclasses.

◆ boxIndex()

int Snapshot::boxIndex ( ) const
inlineprotected

This function returns the column index of the first box field, or -1 if this is not being imported, for use by subclasses.

◆ currentMass() [1/2]

double Snapshot::currentMass ( int  m) const

This function returns the current mass of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the current mass is not being imported, or the index is out of range, the behavior is undefined.

◆ currentMass() [2/2]

double Snapshot::currentMass ( Position  bfr) const

This function returns the current mass of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns zero. If the current mass is not being imported, the behavior is undefined.

◆ currentMassIndex()

int Snapshot::currentMassIndex ( ) const
inlineprotected

This function returns the column index of the current mass field, or -1 if this is not being imported, for use by subclasses.

◆ density() [1/2]

virtual double Snapshot::density ( int  m) const
pure virtual

This function returns the mass or number density for the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the index is out of range, if no density policy has been set, or no mass/density information is being imported, the behavior is undefined.

Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.

◆ density() [2/2]

virtual double Snapshot::density ( Position  bfr) const
pure virtual

This function returns the mass or number density represented by the snapshot at a given point \({\bf{r}}\). If the point is outside the domain, the function returns zero. If no density policy has been set or no mass/density information is being imported, the behavior is undefined.

Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.

◆ densityIndex()

int Snapshot::densityIndex ( ) const
inlineprotected

This function returns the column index of the density field, or -1 if this is not being imported, for use by subclasses.

◆ extent()

virtual Box Snapshot::extent ( ) const
pure virtual

This function returns the extent of the complete spatial domain of the snapshot as a box lined up with the coordinate axes.

Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.

◆ generatePosition() [1/2]

virtual Position Snapshot::generatePosition ( ) const
pure virtual

This function returns a random position within the spatial domain of the snapshot, drawn from the mass density distribution represented by the snapshot. If no density policy has been set or no mass/density information is being imported, the behavior is undefined.

Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.

◆ generatePosition() [2/2]

virtual Position Snapshot::generatePosition ( int  m) const
pure virtual

This function returns a random position within the entity with index \(0\le m \le N_\mathrm{ent}-1\), drawn from an appropriate probability distribution depending on the snapshot type (e.g. uniform for cells, and some smoothing kernel for particles). If the index is out of range, the behavior is undefined.

Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.

◆ getEntities() [1/2]

virtual void Snapshot::getEntities ( EntityCollection entities,
Position  bfr 
) const
pure virtual

This function replaces the contents of the specified entity collection by the set of entities that overlap the specified point \({\bf{r}}\), with their corresponding weights. If the point is outside the domain or otherwise does not overlap any entity, the collection will be empty.

For a cell-based snapshot, the function returns the cell containing the given point, if any. The weight is set to 1. For a particle-based snapshot, the function returns all particles with a smoothing kernel that overlaps the given point. The weight of a particle is given by the particle's smoothing kernel value at the given point.

Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.

◆ getEntities() [2/2]

virtual void Snapshot::getEntities ( EntityCollection entities,
Position  bfr,
Direction  bfk 
) const
pure virtual

This function replaces the contents of the specified entity collection by the set of entities that overlap the specified path with starting point \({\bf{r}}\) and direction \({\bf{k}}\), with their corresponding weights. If the path does not overlap any entity, the collection will be empty.

For a cell-based snapshot, the weight of a cell is given by the length of the path segment inside the cell. For a particle-based snapshot, the weight of a particle is given by the effective length seen by the path as it crosses the particle's smoothing kernel.

Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.

◆ hasAge()

bool Snapshot::hasAge ( ) const
inline

This function returns true if the age is being imported, and false otherwise.

◆ hasCurrentMass()

bool Snapshot::hasCurrentMass ( ) const
inline

This function returns true if the current mass is being imported, and false otherwise.

◆ hasInitialMass()

bool Snapshot::hasInitialMass ( ) const
inline

This function returns true if the initial mass is being imported, and false otherwise.

◆ hasMagneticField()

bool Snapshot::hasMagneticField ( ) const
inline

This function returns true if the magnetic field is being imported, and false otherwise.

◆ hasMassDensityPolicy()

bool Snapshot::hasMassDensityPolicy ( ) const
inlineprotected

This function returns true if the user configured the mass or mass density policy and false otherwise, for use by subclasses.

◆ hasMetallicity()

bool Snapshot::hasMetallicity ( ) const
inline

This function returns true if the metallicity is being imported, and false otherwise.

◆ hasParameters()

bool Snapshot::hasParameters ( ) const
inline

This function returns true if parameters are being imported (i.e. if the number of imported parameters is nonzero), and false otherwise.

◆ hasTemperature()

bool Snapshot::hasTemperature ( ) const
inline

This function returns true if the temperature is being imported, and false otherwise.

◆ hasVelocity()

bool Snapshot::hasVelocity ( ) const
inline

This function returns true if the velocity is being imported, and false otherwise.

◆ hasVelocityDispersion()

bool Snapshot::hasVelocityDispersion ( ) const
inline

This function returns true if the velocity dispersion is being imported, and false otherwise.

◆ holdsNumber()

bool Snapshot::holdsNumber ( ) const
inline

This function returns true if the snapshot holds number (density) values, and false if it holds mass (density) values (or if no mass or density column is being imported).

◆ importBox()

void Snapshot::importBox ( )

This function configures the snapshot to import a cuboid lined up with the coordinate axes, defined by six components (xmin,ymin,zmin,xmax,ymax,zmax). The default unit is pc.

◆ importCurrentMass()

void Snapshot::importCurrentMass ( )

This function configures the snapshot to import the current mass (for use by sources). Not to be confused with the initial mass, which is often requested by single stellar population SED families. The default unit is Msun.

◆ importMagneticField()

void Snapshot::importMagneticField ( )

This function configures the snapshot to import a magnetic field vector with three components (x,y,z). The default unit is \(\mu \mathrm{G}\).

◆ importMass()

void Snapshot::importMass ( )

This function configures the snapshot to import a mass, i.e. mass density integrated over volume (for use by media). The default unit is Msun. It is allowed to combine the importMassDensity() and importMass() options, supporting special use cases where the volume of the entity cannot be derived otherwise. However, combining the "mass" family functions with the "number" family functions is prohibited and leads to undefined behavior.

◆ importMassDensity()

void Snapshot::importMassDensity ( )

This function configures the snapshot to import a mass density per unit of volume (for use by media). The default unit is Msun/pc3. It is allowed to combine the importMassDensity() and importMass() options, supporting special use cases where the volume of the entity cannot be derived otherwise. However, combining the "mass" family functions with the "number" family functions is prohibited and leads to undefined behavior.

◆ importMetallicity()

void Snapshot::importMetallicity ( )

This function configures the snapshot to import a (dimensionless) metallicity fraction.

◆ importNumber()

void Snapshot::importNumber ( )

This function configures the snapshot to import a number, i.e. number density integrated over volume (for use by media). The default unit is 1. It is allowed to combine the importNumberDensity() and importNumber() options, supporting special use cases where the volume of the entity cannot be derived otherwise. However, combining the "mass" family functions with the "number" family functions is prohibited and leads to undefined behavior.

◆ importNumberDensity()

void Snapshot::importNumberDensity ( )

This function configures the snapshot to import a number density per unit of volume (for use by media). The default unit is 1/cm3. It is allowed to combine the importNumberDensity() and importNumber() options, supporting special use cases where the volume of the entity cannot be derived otherwise. However, combining the "mass" family functions with the "number" family functions is prohibited and leads to undefined behavior.

◆ importParameters()

void Snapshot::importParameters ( const vector< SnapshotParameter > &  parameters)

This function configures the snapshot to import a sequence of parameters as described by the specified list of SnapshotParameter metadata objects.

◆ importPosition()

void Snapshot::importPosition ( )

This function configures the snapshot to import a spatial position with three components (x,y,z). The default unit is pc.

◆ importSize()

void Snapshot::importSize ( )

This function configures the snapshot to import a spatial radial size. The default unit is pc.

◆ importTemperature()

void Snapshot::importTemperature ( )

This function configures the snapshot to import a temperature. The default unit is K.

◆ importVelocity()

void Snapshot::importVelocity ( )

This function configures the snapshot to import a velocity with three components (x,y,z). The default unit is km/s.

◆ importVelocityDispersion()

void Snapshot::importVelocityDispersion ( )

This function configures the snapshot to import a single velocity dispersion value, specifying a random offset to the bulk velocity with a spherically symmetric Gaussian distribution. The default unit is km/s.

◆ infile()

TextInFile * Snapshot::infile ( )
inlineprotected

This function returns a pointer to the input file object. It is intended for use in subclasses.

◆ initialMass() [1/2]

double Snapshot::initialMass ( int  m) const

This function returns the initial mass of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the initial mass is not being imported, or the index is out of range, the behavior is undefined.

◆ initialMass() [2/2]

double Snapshot::initialMass ( Position  bfr) const

This function returns the initial mass of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns zero. If the initial mass is not being imported, the behavior is undefined.

◆ initialMassIndex()

int Snapshot::initialMassIndex ( ) const
inlineprotected

This function returns the column index of the initial mass field, or -1 if this is not being imported, for use by subclasses.

◆ log()

Log * Snapshot::log ( ) const
inlineprotected

This function returns a pointer to an appropriate log object. It is intended for use in subclasses.

◆ logMassStatistics()

void Snapshot::logMassStatistics ( int  numIgnored,
double  totalOriginalMass,
double  totalMetallicMass,
double  totalEffectiveMass 
)
protected

This function issues log messages with statistics on the imported masses. It is implemented here for use by subclasses.

◆ magneticField() [1/2]

Vec Snapshot::magneticField ( int  m) const

This function returns the magnetic field vector of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the magnetic field is not being imported, or the index is out of range, the behavior is undefined.

◆ magneticField() [2/2]

Vec Snapshot::magneticField ( Position  bfr) const

This function returns the magnetic field vector of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns a zero magnetic field. If the magnetic field is not being imported, the behavior is undefined.

◆ magneticFieldIndex()

int Snapshot::magneticFieldIndex ( ) const
inlineprotected

This function returns the column index of the first magnetic field field, or -1 if this is not being imported, for use by subclasses.

◆ mass()

virtual double Snapshot::mass ( ) const
pure virtual

This function returns the total mass or number represented by the snapshot, which is equivalent to the mass or number density integrated over the complete spatial domain. If no density policy has been set or no mass/density information is being imported, the behavior is undefined.

Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.

◆ massIndex()

int Snapshot::massIndex ( ) const
inlineprotected

This function returns the column index of the mass field, or -1 if this is not being imported, for use by subclasses.

◆ maxTemperature()

double Snapshot::maxTemperature ( ) const
inlineprotected

This function returns the maximum temperature configured by the user for an entity to have mass, or zero if the user did not configure the mass or mass density policy, for use by subclasses.

◆ metallicity() [1/2]

double Snapshot::metallicity ( int  m) const

This function returns the metallicity of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the metallicity is not being imported, or the index is out of range, the behavior is undefined.

◆ metallicity() [2/2]

double Snapshot::metallicity ( Position  bfr) const

This function returns the metallicity of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns zero. If the metallicity is not being imported, the behavior is undefined.

◆ metallicityIndex()

int Snapshot::metallicityIndex ( ) const
inlineprotected

This function returns the column index of the metallicity field, or -1 if this is not being imported, for use by subclasses.

◆ multiplier()

double Snapshot::multiplier ( ) const
inlineprotected

This function returns the mass or mass density multiplier configured by the user, or zero if the user did not configure the mass or mass density policy, for use by subclasses.

◆ nearestEntity()

virtual int Snapshot::nearestEntity ( Position  bfr) const
protectedpure virtual

This function returns the index \(0\le m \le N_\mathrm{ent}-1\) for the entity at or nearest to the specified point \({\bf{r}}\), or -1 if the point is outside the domain or if there are no entities in the snapshot. For a cell-based snapshot, the function returns the index of the cell containing the given point. For a particle-based snapshot, the function returns the index of the particle whose center is nearest to the given point.

Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.

◆ needGetEntities()

bool Snapshot::needGetEntities ( ) const
inlineprotected

This function returns true if one of the getEntities() functions may be called during the simulation, implying that the snapshot must prebuild the required search data structures. Returns false otherwise. For use by subclasses.

◆ numEntities()

virtual int Snapshot::numEntities ( ) const
pure virtual

This function returns the number of entities \(N_\mathrm{ent}\) in the snapshot.

Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.

◆ numParameters()

int Snapshot::numParameters ( ) const
inlineprotected

This function returns the number of parameters being imported (which may be zero).

◆ open()

void Snapshot::open ( const SimulationItem item,
string  filename,
string  description 
)

This function creates an input file object corresponding to the specified file and opens it for reading; if the file can't be opened, a FatalError is thrown. It must be called before invoking any of the configuration functions(). This function takes several arguments: (1) item specifies a simulation item in the hierarchy of the caller (usually the caller itself) used to retrieve context such as an appropriate logger; (2) filename specifies the name of the file, including filename extension but excluding path and simulation prefix; (3) description describes the contents of the file for use in the log message issued after the file is successfully opened.

◆ parameters() [1/2]

void Snapshot::parameters ( int  m,
Array params 
) const

This function stores the parameters of the entity with index \(0\le m \le N_\mathrm{ent}-1\) into the given array. If parameters are not being imported, or the index is out of range, the behavior is undefined.

◆ parameters() [2/2]

void Snapshot::parameters ( Position  bfr,
Array params 
) const

This function stores the parameters of the entity nearest to (or at) the specified point \({\bf{r}}\) into the given array. If the point is outside the domain, the function returns the appropriate number of zero parameter values. If parameters are not being imported, the behavior is undefined.

◆ parametersIndex()

int Snapshot::parametersIndex ( ) const
inlineprotected

This function returns the column index of the first field in the parameter list, or -1 if this is not being imported, for use by subclasses.

◆ position()

virtual Position Snapshot::position ( int  m) const
pure virtual

This function returns a characteristic position for the entity with index \(0\le m \le N_\mathrm{ent}-1\). Such a position is always available for all snapshot types, regardless of whether a position is explicitly being imported or not. If the index is out of range, the behavior is undefined.

Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.

◆ positionIndex()

int Snapshot::positionIndex ( ) const
inlineprotected

This function returns the column index of the first position field, or -1 if this is not being imported, for use by subclasses.

◆ properties()

virtual const Array & Snapshot::properties ( int  m) const
protectedpure virtual

This function returns a reference to an array containing the imported properties (in column order) for the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the index is out of range, the behavior is undefined.

Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.

◆ random()

Random * Snapshot::random ( ) const
inlineprotected

This function returns a pointer to an appropriate random generator. It is intended for use in subclasses.

◆ readAndClose()

virtual void Snapshot::readAndClose ( )
virtual

This function reads the snapshot data from the input file, honoring the options set through the configuration functions, stores the data for later use, and closes the file.

The implementation in this base class simply closes the file and deletes the corresponding file object. Subclasses must override the function to actually read the data and then call the implementation in this base class.

Reimplemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.

◆ setContext()

void Snapshot::setContext ( const SimulationItem item)
protected

This function retrieves the relevant simulation hierarchy context (such as an appropriate logger) from the specified simulation item (usually the caller itself). It is intended for use in subclasses that support use cases where the open() function is never invoked.

◆ setMassDensityPolicy()

void Snapshot::setMassDensityPolicy ( double  multiplier,
double  maxTemperature,
bool  useMetallicity 
)

This function sets the policy for calculating the mass or mass density at a given spatial position in the snapshot. If the policy is not set during configuration, or if neither of the importMass() and importDensity() functions was invoked, attempting to obtain mass or mass density values results in undefined behavior.

If the policy is set during configuration, the argument values determine the heuristic for calculating the mass or density for each entity:

  • If the maxTemperature argument is positive, and the temperature field is being imported and its value for a given entity is positive as well, and the imported temperature is above the maximum temperature, then the mass or density corresponding to this entity is considered to be zero.
  • Otherwise, the intrinsic mass or mass density is obtained from the mass or density fields using a mechanism that depends on the snapshot type and possibly on the configuration. If the useMetallicity argument is true, and the metallicity field is being imported, this intrinsic value is multiplied by the metallicity fraction. Finally, it is multiplied by the value of the multiplier argument to obtain the final result.

◆ setNeedGetEntities()

void Snapshot::setNeedGetEntities ( )

This function notifies the snapshot that one of the getEntities() functions may be called during the simulation, implying that the snapshot must prebuild the required search data structures.

◆ SigmaX()

double Snapshot::SigmaX ( ) const

This function returns the X-axis surface density of the density distribution represented by the snapshot, defined as the integration of the density along the entire X-axis,

\[ \Sigma_X = \int_{x_\text{min}}^{x_\text{max}} \rho(x,0,0)\, {\text{d}}x.\]

This integral is calculated numerically using 10000 samples along the X-axis. If no density policy has been set or no mass/density information is being imported, the behavior is undefined.

◆ SigmaY()

double Snapshot::SigmaY ( ) const

This function returns the Y-axis surface density of the density distribution represented by the snapshot, defined as the integration of the density along the entire Y-axis,

\[ \Sigma_Y = \int_{y_\text{min}}^{y_\text{max}} \rho(0,y,0)\, {\text{d}}y.\]

This integral is calculated numerically using 10000 samples along the Y-axis. If no density policy has been set or no mass/density information is being imported, the behavior is undefined.

◆ SigmaZ()

double Snapshot::SigmaZ ( ) const

This function returns the Z-axis surface density of the density distribution represented by the snapshot, defined as the integration of the density along the entire Z-axis,

\[ \Sigma_Z = \int_{z_\text{min}}^{z_\text{max}} \rho(0,0,z)\, {\text{d}}z.\]

This integral is calculated numerically using 10000 samples along the Z-axis. If no density policy has been set or no mass/density information is being imported, the behavior is undefined.

◆ sizeIndex()

int Snapshot::sizeIndex ( ) const
inlineprotected

This function returns the column index of the size field, or -1 if this is not being imported, for use by subclasses.

◆ temperature() [1/2]

double Snapshot::temperature ( int  m) const

This function returns the temperature of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the temperature is not being imported, or the index is out of range, the behavior is undefined.

◆ temperature() [2/2]

double Snapshot::temperature ( Position  bfr) const

This function returns the temperature of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns zero. If the temperature is not being imported, the behavior is undefined.

◆ temperatureIndex()

int Snapshot::temperatureIndex ( ) const
inlineprotected

This function returns the column index of the temperature field, or -1 if this is not being imported, for use by subclasses.

◆ units()

Units * Snapshot::units ( ) const
inlineprotected

This function returns a pointer to an appropriate units object. It is intended for use in subclasses.

◆ useColumns()

void Snapshot::useColumns ( string  columns)

This function specifies a mapping (defined by the columns argument) between the "physical" columns in the file being imported (defined by the column information in the file header) and the required "logical" columns (defined by calling the other configuration functions). For information on the syntax and semantics of the columns string contents, refer to the description of the TextInFile::useColumns() function.

This function can be called with a non-empty columns string at most once for each snapshot, and such invocation should occur before the first invocation of any other configuration function. Calling this function with an empty columns string is equivalent to not calling it at all.

◆ useMetallicity()

bool Snapshot::useMetallicity ( ) const
inlineprotected

This function returns true if the user configured the mass or mass density policy with a request to use the metallicity, and the metallicity field is being imported. Returns false otherwise. For use by subclasses.

◆ useTemperatureCutoff()

bool Snapshot::useTemperatureCutoff ( ) const
inlineprotected

This function returns true if the user configured the mass or mass density policy with a nonzero maximum temperature and the temperature field is being imported. Returns false otherwise. For use by subclasses.

◆ velocity() [1/2]

Vec Snapshot::velocity ( int  m) const

This function returns the velocity of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the velocity is not being imported, or the index is out of range, the behavior is undefined.

◆ velocity() [2/2]

Vec Snapshot::velocity ( Position  bfr) const

This function returns the velocity of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns zero velocity. If the velocity is not being imported, the behavior is undefined.

◆ velocityDispersion() [1/2]

double Snapshot::velocityDispersion ( int  m) const

This function returns the velocity dispersion of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the velocity dispersion is not being imported, or the index is out of range, the behavior is undefined.

◆ velocityDispersion() [2/2]

double Snapshot::velocityDispersion ( Position  bfr) const

This function returns the velocity dispersion of the entity nearest to (or at) the specified point \({\bf{r}}\). If the point is outside the domain, the function returns zero dispersion. If the velocity dispersion is not being imported, the behavior is undefined.

◆ velocityDispersionIndex()

int Snapshot::velocityDispersionIndex ( ) const
inlineprotected

This function returns the column index of the velocity dispersion field, or -1 if this is not being imported, for use by subclasses.

◆ velocityIndex()

int Snapshot::velocityIndex ( ) const
inlineprotected

This function returns the column index of the first velocity field, or -1 if this is not being imported, for use by subclasses.

◆ volume() [1/2]

double Snapshot::volume ( ) const

This function returns the volume of the complete domain of the snapshot, taken to be a box lined up with the coordinate axes.

◆ volume() [2/2]

virtual double Snapshot::volume ( int  m) const
pure virtual

This function returns the volume of the entity with index \(0\le m \le N_\mathrm{ent}-1\). If the index is out of range, if no density policy has been set, or no mass/density information is being imported, the behavior is undefined.

Implemented in AdaptiveMeshSnapshot, CellSnapshot, ParticleSnapshot, and VoronoiMeshSnapshot.


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