#include <Configuration.hpp>
Public Types | |
enum class | LyaAccelerationScheme { None , Constant , Variable } |
Protected Member Functions | |
void | setupSelfAfter () override |
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 () | |
Private Attributes | |
double | _angularDiameterDistance |
SpatialCellLibrary * | _cellLibrary |
WavelengthGrid * | _defaultWavelengthGrid |
double | _dustEmissionSourceWeight |
double | _dustEmissionWavelengthBias |
WavelengthDistribution * | _dustEmissionWavelengthBiasDistribution |
DisjointWavelengthGrid * | _dustEmissionWLG |
bool | _emulationMode |
bool | _explicitAbsorption |
bool | _forceScattering |
int | _gridDimension |
bool | _hasConstantPerceivedWavelength |
bool | _hasDustEmission |
bool | _hasDynamicStateRecipes |
bool | _hasGasEmission |
bool | _hasLymanAlpha |
bool | _hasMedium |
bool | _hasMergedIterations |
bool | _hasMovingMedia |
bool | _hasMovingSources |
bool | _hasMultipleConstantSectionMedia |
bool | _hasNegativeExtinction |
bool | _hasPanRadiationField |
bool | _hasPolarization |
bool | _hasPrimaryDynamicState |
bool | _hasPrimaryDynamicStateMedia |
bool | _hasPrimaryIterations |
bool | _hasRadiationField |
bool | _hasScatteringDispersion |
bool | _hasSecondaryDynamicState |
bool | _hasSecondaryDynamicStateMedia |
bool | _hasSecondaryEmission |
bool | _hasSecondaryIterations |
bool | _hasSecondaryRadiationField |
bool | _hasSingleConstantSectionMedium |
bool | _hasSpheroidalPolarization |
bool | _hasStochasticDustEmission |
bool | _hasVariableMedia |
double | _hubbleExpansionRate |
bool | _includeHeatingByCMB |
double | _luminosityDistance |
LyaAccelerationScheme | _lyaAccelerationScheme |
double | _lyaAccelerationStrength |
int | _magneticFieldMediumIndex |
double | _maxFractionOfPrevious |
double | _maxFractionOfPrimary |
int | _maxPrimaryIterations |
int | _maxSecondaryIterations |
bool | _mediaNeedGeneratePosition |
int | _minPrimaryIterations |
int | _minScattEvents |
int | _minSecondaryIterations |
double | _minWeightReduction |
int | _modelDimension |
int | _numDensitySamples |
double | _numPrimaryIterationPackets |
double | _numPrimaryPackets |
int | _numPropertySamples |
double | _numSecondaryIterationPackets |
double | _numSecondaryPackets |
bool | _oligochromatic |
WavelengthDistribution * | _oligoWavelengthBiasDistribution |
double | _pathLengthBias |
DisjointWavelengthGrid * | _radiationFieldWLG |
double | _redshift |
double | _secondarySourceBias |
double | _secondarySpatialBias |
bool | _snapshotsNeedGetEntities |
Range | _sourceWavelengthRange |
bool | _storeEmissionRadiationField |
Configuration is a helper class that serves as a central clearing house for overall simulation configuration options including the simulation mode.
Each MonteCarloSimulation holds a single Configuration object. During setup, it retrieves many properties and options from the simulation hierarchy, verifying consistency of the configuration and flagging any conflicts while doing so. Once this process has completed, the Configuration object offers getters for these retrieved properties to any of the other simulation items in the hierarchy. The setup() function of the Configuration object is invoked at the very early stages of simulation setup, so that it is safe for other simulation items to retrieve information from the Configuration object during setup.
The Configuration class is based on SimulationItem so that it can be part of a simulation item hierarchy, however it is not discoverable because it is not intended to be selected or configured by the user.
|
strong |
This enumeration lists the supported Lyman-alpha acceleration schemes.
|
explicit |
This constructor creates a Configuration object that is hooked up as a child to the specified parent in the simulation hierarchy, so that it will automatically be deleted. The setup() function is not called by this constructor.
|
inline |
Returns the angular-diameter distance corresponding to the redshift at which the model resides, or zero if the model resides in the Local Universe. Refer to the Cosmology class description for more information.
|
inline |
Returns the cell library mapping to be used for calculating the dust emission spectra.
|
inline |
Returns the bias weight for dust emission sources.
|
inline |
Returns the fraction of dust emission photon packet wavelengths sampled from a bias distribution.
|
inline |
Returns the bias distribution for sampling dust emission photon packet wavelengths.
|
inline |
Returns the wavelength grid to be used for calculating the dust emission spectra.
|
inline |
Returns true if the simulation has been put in emulation mode.
|
inline |
Returns true if explicit absorption should be used during the photon cycle, false if not.
|
inline |
Returns true if forced scattering should be used during the photon cycle, false if not.
|
inline |
Returns the symmetry dimension of the spatial grid, if present, or 0 if there is no spatial grid (which can only happen if the simulation does not include any media). A value of 1 means spherical symmetry, 2 means axial symmetry and 3 means none of these symmetries.
|
inline |
Returns true if the perceived photon packet wavelength equals the intrinsic photon packet wavelength for all spatial cells along the path of the packet. The following conditions cause this function to return false: Hubble expansion is enabled or some media may have a non-zero velocity in some cells.
|
inline |
Returns true if thermal dust emission must be calculated, and false otherwise.
|
inline |
Returns true if the simulation has primary or merged iterations and includes one or more recipes or media that perform primary or secondary dynamic medium state (DMS) updates, and false otherwise.
|
inline |
Returns true if the simulation has primary or merged iterations and includes one or more dynamic medium state recipes (instances of a DynamicStateRecipe subclass), and false otherwise. In the current implementation, these recipes by definition perform primary dynamic medium state (PDMS) updates.
|
inline |
Returns true if gas emission must be calculated, and false otherwise.
|
inline |
Returns true if one of the medium components in the simulation defines a spatial magnetic field distribution that may have nonzero strength for some positions, or false if none of the media define a magnetic field. It is not allowed for multiple medium components to define a magnetic field (a fatal error is raised during setup when this happens).
|
inline |
Returns true if there is at least one medium component in the simulation, and false otherwise.
|
inline |
Returns true if the simulation iterates over both primary and secondary emission and the iterations over secondary emission should include primary emission, and false otherwise.
|
inline |
Returns true if one or more medium components in the simulation may have a nonzero velocity for some positions. If the function returns false, none of the media has a velocity.
|
inline |
Returns true if the simulation has two or more medium components and the absorption and scattering cross sections for a photon packet traversing those medium components are spatially constant, so that the opacity in each crossed cell can be calculated by multiplying these constant cross sections by the corresponding number densities in the cell. Otherwise the function returns false.
The following conditions cause this function to return false: Hubble expansion is enabled, some media may have a non-zero velocity in some cells, so that the perceived wavelength changes between cells; some media have a variable material mix; the cross sections for some material mixes depend on extra medium state variables such as temperature or fragment weight factors.
|
inline |
Returns true if the extinction cross section (the sum of the absorption and scattering cross section) for one or more material mixes in the simulation can be negative, and false if not.
|
inline |
Returns true if a panchromatic radiation field (from which a temperature can be calculated) is being stored during the photon cycle, and false otherwise.
|
inline |
Returns true if all media in the simulation support polarization, and false if none of the media do. A mixture of support and no support for polarization is not allowed and will cause a fatal error during setup.
|
inline |
Returns true if the simulation has primary or merged iterations and includes one or more recipes or media that perform primary dynamic medium state (PDMS) updates, and false otherwise.
|
inline |
Returns true if the simulation has primary or merged iterations and includes one or more media with an associated MaterialMix that performs primary dynamic medium state (PDMS) updates, and false otherwise.
|
inline |
Returns true if the simulation iterates over primary emission, and false otherwise.
|
inline |
Returns true if the radiation field must be stored during the photon cycle, and false otherwise.
|
inline |
Returns true if a scattering interaction for one or more media may adjust the wavelength of the interacting photon packet, and false otherwise.
|
inline |
Returns true if the simulation has primary or merged iterations and includes one or more recipes or media that perform secondary dynamic medium state (SDMS) updates, and false otherwise.
|
inline |
Returns true if the simulation has secondary emission and includes one or more media with an associated MaterialMix that performs secondary dynamic medium state (SDMS) updates, and false otherwise.
|
inline |
Returns true if secondary emission must be calculated for any media type, and false otherwise.
|
inline |
Returns true if the simulation iterates over secondary emission, and false otherwise.
|
inline |
Returns true if the radiation field for emission from secondary sources must be stored in a separate data structure, and false otherwise.
|
inline |
Returns true if the simulation has a exactly one medium component and the absorption and scattering cross sections for a photon packet traversing that medium component are spatially constant, so that the opacity in each crossed cell can be calculated by multiplying this constant cross section by the number density in the cell. Otherwise the function returns false.
The following conditions cause this function to return false: Hubble expansion is enabled, there is more than one medium component, the medium may have a non-zero velocity in some cells, the medium has a variable material mix; the cross sections for some material mixes depend on extra medium state variables such as temperature or fragment weight factors.
|
inline |
Returns true if some of the media in the simulation represent spheroidal (i.e. non-spherical) particles and require the corresponding treatment of polarization for scattering, absorption and emission, or false otherwise. If this function returns true, the hasPolarization() and hasMagneticField() functions return true as well.
|
inline |
Returns true if thermal dust emission must be calculated by taking stochastically heated grains into account, and false otherwise.
|
inline |
Returns true if the material mix for at least one medium component in the simulation may vary depending on spatial position. If the function returns false, the material mixes and thus the material properties for all media are constant throughout the complete spatial domain of the simulation.
|
inline |
If inclusion of the Hubble flow is enabled, this function returns the relative expansion rate of the universe in which the model resides. If inclusion of the Hubble flow is disabled, or if the simulation does not include Lyman-alpha treatment, this function returns zero.
|
inline |
Returns true if the cosmic microwave background (CMB) must be added as a source term for dust heating, and false otherwise.
|
inline |
Returns the luminosity distance corresponding to the redshift at which the model resides, or zero if the model resides in the Local Universe. Refer to the Cosmology class description for more information.
|
inline |
Returns the enumeration value determining the acceleration scheme to be used for Lyman-alpha line scattering. The value is relevant only if Lyman-alpha line treatment is enabled in the simulation.
|
inline |
Returns the strength of the Lyman-alpha acceleration scheme to be applied. The value is relevant only if Lyman-alpha line treatment is enabled in the simulation and lyaAccelerationScheme() returns Constant
or Variable
.
|
inline |
Returns the index of the medium component defining the magnetic field, or a negative value if none of the media define a magnetic field.
|
inline |
Returns the dust self-absorption iteration convergence criterion described as follows: convergence is reached when the total absorbed dust luminosity has changed by less than this fraction compared to the previous iteration.
|
inline |
Returns the dust self-absorption iteration convergence criterion described as follows: convergence is reached when the total absorbed dust luminosity is less than this fraction of the total absorbed primary luminosity.
|
inline |
Returns the maximum number of iterations in the primary emission phase.
|
inline |
Returns the maximum number of iterations in the secondary emission phase.
|
inline |
Returns true if the Medium::generatePosition() function may be called for the media in the simulation. In the current implementation, this happens only if the simulation uses a VoronoiMeshSpatialGrid instance to discretize the spatial domain. If there are no media or the Medium::generatePosition() will never be called during this simulation, this function returns false.
|
inline |
Returns the minimum number of iterations in the primary emission phase.
|
inline |
Returns the minimum number of forced scattering events before a photon packet is terminated.
|
inline |
Returns the minimum number of iterations in the secondary emission phase.
|
inline |
Returns the minimum weight reduction factor before a photon packet is terminated.
|
inline |
Returns the symmetry dimension of the input model, including sources and media, if present. A value of 1 means spherical symmetry, 2 means axial symmetry and 3 means none of these symmetries.
|
inline |
Returns the number of random spatial samples for determining density (or mass).
|
inline |
Returns the number of photon packets launched per iteration segment during primary emission.
|
inline |
Returns the number of photon packets launched per regular primary emission simulation segment.
|
inline |
Returns the number of random spatial samples for determining other properties.
|
inline |
Returns the number of photon packets launched per iteration segment during secondary emission.
|
inline |
Returns the number of photon packets launched per regular secondary emission simulation segment.
|
inline |
Returns true if the wavelength regime of the simulation is oligochromatic.
|
inline |
For oligochromatic simulations, this function returns the wavelength bias distribution to be used by all primary sources. For panchromatic simulations, the function returns the null pointer.
|
inline |
Returns the fraction of path lengths sampled from a linear rather than an exponential distribution.
|
inline |
Returns the wavelength grid to be used for storing the radiation field, or the null pointer if hasRadiationField() returns false.
|
inline |
Returns the redshift at which the model resides, or zero if the model resides in the Local Universe.
|
inline |
Returns the fraction of secondary photon packets distributed uniformly across secondary sources.
|
inline |
Returns the fraction of secondary photon packets distributed uniformly across spatial cells.
void Configuration::setEmulationMode | ( | ) |
This function puts the simulation in emulation mode. Specifically, it sets a flag that can be queried by other simulation items, it sets the number of photon packets to zero, and disables iteration over primary and/or secondary emisson.
|
overrideprotectedvirtual |
This function logs some aspects of the configuration as information to the user.
Reimplemented from SimulationItem.
|
overrideprotectedvirtual |
This function retrieves properties and options from the simulation hierarchy and stores the resulting values internally so that they can be returned by any of the getters with minimal overhead. During this process, the function also verifies the consistency of the simulation configuration, for example checking the configuration against the requirements of the selected simulation mode. If any conflicts are found, the function throws a fatal error.
Reimplemented from SimulationItem.
Range Configuration::simulationWavelengthRange | ( | ) | const |
Returns a wavelength range that covers all wavelengths possibly used in the simulation for photon transport or for otherwise probing material properties (e.g. optical depth). This range includes the primary and secondary source wavelength ranges extended on both sides to accommodate a redshift or blueshift caused by kinematics corresponding to \(v/c=1/3\). It also includes the range of the instrument wavelength grids and the wavelengths used for material normalization and material property probes.
vector< double > Configuration::simulationWavelengths | ( | ) | const |
Returns a list of wavelengths that are explicitly or indirectly mentioned by the simulation configuration. This includes the characteristic wavelengths of all configured wavelength grids (for instruments, probes, radiation field or dust emission) and specific wavelengths used for normalization or probing.
|
inline |
Returns true if one of the Snapshot::getEntities() functions may be called for any of the snapshots associated with the imported sources and media in the simulation, implying that the snapshot must prebuild the required search data structures. In the current implementation, this happens only if the simulation includes one or more input model probes, i.e. instances of an InputModelProbe subclass.
|
inline |
Returns the total wavelength range of the primary sources in the simulation. For panchromatic simulations, this range is configured by the user in the source system. For oligochromatic simulations, the range includes the discrete source wavelengths used in the simulation, which are also user-configured in the source system.
|
inline |
Returns true if the radiation field must be stored during emission (for probing), and false otherwise.
WavelengthGrid * Configuration::wavelengthGrid | ( | WavelengthGrid * | localWavelengthGrid | ) | const |
Returns the wavelength grid to be used for an instrument or probe, given the wavelength grid configured locally for the calling instrument or probe (which may the null pointer to indicate that no local grid was configured). For oligochromatic simulations, the function always returns a wavelength grid with disjoint bins centered around the discrete source wavelengths used in the simulation. For panchromatic simulations, the function returns the provided local wavelength grid if it is non-null, and otherwise it returns the default instrument wavelength grid obtained from the instrument system. If both the provided local wavelength grid and the default instrument wavelength grid are the null pointer, the function throws a fatal error.