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

#include <SamplingOptions.hpp>

Inheritance diagram for SamplingOptions:
Inheritance graph
[legend]

Public Types

enum class  AggregatePolicy : int { Average , Maximum , First }
 

Public Member Functions

AggregatePolicy aggregateVelocity () const
 
int numDensitySamples () const
 
int numPropertySamples () 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
 

Protected Member Functions

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

Private Types

using BaseType = SimulationItem
 
using ItemType = SamplingOptions
 

Private Attributes

AggregatePolicy _aggregateVelocity
 
int _numDensitySamples
 
int _numPropertySamples
 

Friends

class ItemRegistry
 

Detailed Description

The SamplingOptions class simply offers a number of configuration options related to sampling the media properties for the spatial grid.

A separate number of spatial samples per grid cell can be configured for the density and for all of the the other medium properties (as a group). In each case, if the specified number of samples is one, the property is sampled just at the central position of the cell. If the specified number is larger than one, the property is sampled at the given number of positions, randomly selected from a uniform distribution within the cell volume, and the average value of these random samples is used. The average is density-weigthed except for the magnetic field (and density itself).

The medium system maintains at most a single bulk velocity value per spatial cell. If multiple medium components specify a bulk velocity, the values sampled from these components are aggregated using one of three possible policies, as requested by the user through the aggregateVelocity property:

Similarly, the medium system maintains at most a single magnetic field vector per spatial cell. However, because the configuration can contain at most one medium component that specifies a magnetic field, there is no need for aggregation over multiple components.

Member Enumeration Documentation

◆ AggregatePolicy

enum class SamplingOptions::AggregatePolicy : int
strong

The enumeration type defining a policy for aggregating (in each spatial cell) a single bulk velocity from the values in multiple medium components.

Average : "Use the density-weighted average; missing values are taken to be zero" .

Maximum : "Use the vector with largest magnitude; missing values are taken to be zero" .

First : "Use the vector of the first medium component for which one is available" .

Constructor & Destructor Documentation

◆ SamplingOptions()

SamplingOptions::SamplingOptions ( )
inlineprotected

Default constructor for concrete Item subclass SamplingOptions : "a set of options related to media sampling for the spatial grid" .

Member Function Documentation

◆ aggregateVelocity()

SamplingOptions::aggregateVelocity ( ) const
inline

This function returns the value of the discoverable AggregatePolicy enumeration property aggregateVelocity : "aggregating the bulk velocity from multiple medium components" .

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

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

◆ numDensitySamples()

SamplingOptions::numDensitySamples ( ) const
inline

This function returns the value of the discoverable integer property numDensitySamples : "the number of random density samples for determining spatial cell mass" .

The minimum value for this property is "1" .

The maximum value for this property is "1000" .

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

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.

◆ numPropertySamples()

SamplingOptions::numPropertySamples ( ) const
inline

This function returns the value of the discoverable integer property numPropertySamples : "the number of random samples for determining other medium properties" .

The minimum value for this property is "1" .

The maximum value for this property is "1000" .

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

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: