#include <ImportedMedium.hpp>
Public Member Functions | |
Vec | bulkVelocity (Position bfr) const override |
int | dimension () const override |
string | filename () const |
Position | generatePosition () const override |
bool | hasMagneticField () const override |
bool | hasMetallicity () const override |
bool | hasParameters () const override |
bool | hasTemperature () const override |
bool | hasVariableMix () const override |
bool | hasVelocity () const override |
bool | importMagneticField () const |
bool | importMetallicity () const |
bool | importTemperature () const |
bool | importVariableMixParams () const |
bool | importVelocity () const |
Vec | magneticField (Position bfr) const override |
double | mass () const override |
double | massDensity (Position bfr) const override |
double | massFraction () const |
MaterialMix * | materialMix () const |
MaterialMixFamily * | materialMixFamily () const |
double | maxTemperature () const |
double | metallicity (Position bfr) const override |
const MaterialMix * | mix () const override |
const MaterialMix * | mix (Position bfr) const override |
double | number () const override |
double | numberDensity (Position bfr) const override |
int | numSites () const override |
double | opticalDepthX (double lambda) const override |
double | opticalDepthY (double lambda) const override |
double | opticalDepthZ (double lambda) const override |
void | parameters (Position bfr, Array ¶ms) const override |
Position | sitePosition (int index) const override |
const Snapshot * | snapshot () const |
double | temperature (Position bfr) const override |
string | useColumns () const |
virtual Vec | bulkVelocity (Position bfr) const =0 |
virtual int | dimension () const =0 |
virtual Position | generatePosition () const =0 |
virtual bool | hasMagneticField () const =0 |
virtual bool | hasMetallicity () const =0 |
virtual bool | hasParameters () const =0 |
virtual bool | hasTemperature () const =0 |
virtual bool | hasVariableMix () const =0 |
virtual bool | hasVelocity () const =0 |
virtual Vec | magneticField (Position bfr) const =0 |
virtual double | mass () const =0 |
virtual double | massDensity (Position bfr) const =0 |
virtual double | metallicity (Position bfr) const =0 |
virtual const MaterialMix * | mix () const =0 |
virtual const MaterialMix * | mix (Position bfr) const =0 |
virtual double | number () const =0 |
virtual double | numberDensity (Position bfr) const =0 |
virtual double | opticalDepthX (double lambda) const =0 |
virtual double | opticalDepthY (double lambda) const =0 |
virtual double | opticalDepthZ (double lambda) const =0 |
virtual void | parameters (Position bfr, Array ¶ms) const =0 |
virtual double | temperature (Position bfr) const =0 |
![]() | |
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 |
![]() | |
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 Item * | getItemProperty (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) |
Item & | operator= (const Item &)=delete |
Item * | parent () 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 |
![]() | |
virtual | ~SiteListInterface () |
virtual int | numSites () const =0 |
virtual Position | sitePosition (int index) const =0 |
Protected Member Functions | |
ImportedMedium () | |
~ImportedMedium () | |
virtual Snapshot * | createAndOpenSnapshot ()=0 |
void | setupSelfAfter () override |
![]() | |
Medium () | |
![]() | |
SimulationItem () | |
virtual bool | offersInterface (const std::type_info &interfaceTypeInfo) const |
virtual void | setupSelfAfter () |
virtual void | setupSelfBefore () |
![]() | |
Item () | |
![]() | |
SiteListInterface () | |
Private Types | |
using | BaseType = Medium |
using | ItemType = ImportedMedium |
Private Attributes | |
string | _filename |
bool | _importMagneticField |
bool | _importMetallicity |
bool | _importTemperature |
bool | _importVariableMixParams |
bool | _importVelocity |
double | _massFraction |
MaterialMix * | _materialMix |
MaterialMixFamily * | _materialMixFamily |
double | _maxTemperature |
Snapshot * | _snapshot |
string | _useColumns |
Friends | |
class | ItemRegistry |
ImportedMedium is an abstract class representing transfer media for which the spatial material density distribution (and, optionally, related properties such as the bulk velocity) is 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 "Dimension3,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.
|
inlineprotected |
Default constructor for abstract Item subclass ImportedMedium : "a transfer medium imported from snapshot data" .
|
protected |
The destructor deletes the snapshot object, if present.
This function returns the bulk velocity of the medium at the specified position. If the importVelocity flag is enabled, it simply calls the corresponding function in the snapshot object; otherwise it returns zero velocity.
Implements Medium.
|
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 AdaptiveMeshMedium, CellMedium, CylindricalCellMedium, ParticleMedium, SphericalCellMedium, and VoronoiMeshMedium.
|
overridevirtual |
This function returns the dimension of the medium, which is always 3 for an imported medium.
Implements Medium.
|
inline |
This function returns the value of the discoverable string property filename : "the name of the file to be imported" .
|
overridevirtual |
This function generates a random position sampled from the medium's spatial density distribution. It simply calls the corresponding function in the snapshot object. In the current implementation, the conversion from number to mass is the same throughout the medium's spatial domain, meaning that there is no difference between sampling from the number density or the mass density. This may change in the future.
Implements Medium.
|
overridevirtual |
This function returns true if the importMagneticField flag is enabled for the medium.
Implements Medium.
|
overridevirtual |
This function returns true if the medium has a gas or electron material mix and the importMetallicity flag is enabled for the medium.
Implements Medium.
|
overridevirtual |
This function returns true if custom input model parameters are available for this medium. See the parameters() function for more information.
Implements Medium.
|
overridevirtual |
This function returns true if the medium has a gas or electron material mix and the importTemperature flag is enabled for the medium.
Implements Medium.
|
overridevirtual |
This function returns the configured value of the importVariableMixParams flag. If true, this medium may return a different MaterialMix object depending on the specified position. If false, the same object is always returned.
Implements Medium.
|
overridevirtual |
This function returns true if the importVelocity flag is enabled for the medium.
Implements Medium.
|
inline |
This function returns the value of the discoverable Boolean property importMagneticField : "import magnetic field components (3 columns)" .
The default value for this property is given by the conditional value expression "false" .
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.
When a value is entered for this property, the names provided by the conditional value expression "importMagneticField:MagneticField" are inserted into the name sets used for evaluating Boolean expressions.
|
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" .
|
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" .
|
inline |
This function returns the value of the discoverable Boolean property importVariableMixParams : "import parameter(s) to select a spatially varying material mix" .
The default value for this property is given by the conditional value expression "false" .
This property is displayed only if the Boolean expression "(!NonIdentitySpatialCellLibrary)&Level2" evaluates to true after replacing the names by true or false depending on their presence.
|
inline |
This function returns the value of the discoverable Boolean property importVelocity : "import velocity components (3 columns)" .
The default value for this property is given by the conditional value expression "false" .
This property is relevant only if the Boolean expression "Panchromatic" evaluates to true after replacing the names by true or false depending on their presence.
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.
When a value is entered for this property, the names provided by the conditional value expression "importVelocity:MediumVelocity" are inserted into the name sets used for evaluating Boolean expressions.
This function returns the magnetic field vector of the medium at the specified position. If the importMagneticField flag is enabled, it simply calls the corresponding function in the snapshot object; otherwise it returns a zero magnetic field.
Implements Medium.
|
overridevirtual |
This function returns the total mass in the medium. The function uses the default material mix (the one at the origin) throughout the complete spatial domain; if the importVariableMixParams flag is enabled, this is an approximation.
Implements Medium.
|
overridevirtual |
This function returns the mass density of the medium at the specified position.
Implements Medium.
|
inline |
This function returns the value of the discoverable double property massFraction : "the fraction of the mass to be included (or one to include all)" .
The minimum value for this property is "[0" .
The maximum value for this property is "1]" .
The default value for this property is given by the conditional value expression "1" .
|
inline |
This function returns the value of the discoverable item property materialMix : "the material type and properties throughout the medium" .
The default value for this property is given by the conditional value expression "MeanInterstellarDustMix" .
This property is relevant only if the Boolean expression "!importVariableMixParams" evaluates to true after replacing the names by true or false depending on their presence.
|
inline |
This function returns the value of the discoverable item property materialMixFamily : "the material mix family addressed by the imported parameter(s)" .
The default value for this property is given by the conditional value expression "SelectDustMixFamily" .
This property is relevant only if the Boolean expression "importVariableMixParams" evaluates to true after replacing the names by true or false depending on their presence.
|
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.
|
overridevirtual |
This function returns the metallicity of the medium at the specified position, if defined in the input model. Specifically, if the medium has a gas or electron material mix and the importMetallicity flag is enabled, the function returns the imported metallicity at the specified position. Otherwise, the function returns zero.
Implements Medium.
|
overridevirtual |
This function returns a default MaterialMix object representative of the material properties of the medium.
If the importVariableMixParams flag is enabled, a default material mix is selected from the configured material mix family using the appropriate number of parameters with a value of zero. If the flag is disabled, the fixed configured material mix is returned.
Implements Medium.
|
overridevirtual |
This function returns the MaterialMix object defining the material properties for the medium at the specified position.
If the importVariableMixParams flag is enabled, the appropriate material mix is selected from the configured material mix family based on the value of the imported parameters for the specified position. If the flag is disabled, the fixed configured material mix is returned regardless of position.
Implements Medium.
|
overridevirtual |
This function returns the total number of material entities in the medium. The function uses the default material mix (the one at the origin) throughout the complete spatial domain; if the importVariableMixParams flag is enabled, this is an approximation.
Implements Medium.
|
overridevirtual |
This function returns the number density of the medium at the specified position.
Implements Medium.
|
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.
|
overridevirtual |
This function returns the optical depth of the medium at wavelength
Implements Medium.
|
overridevirtual |
This function returns the optical depth of the medium at wavelength
Implements Medium.
|
overridevirtual |
This function returns the optical depth of the medium at wavelength
Implements Medium.
If custom input model parameters are available for this medium, this function stores the parameter values at the specified position into the given array. If the position is outside the domain, the parameter values default to zero. If no custom input model parameters are available for this medium, the array is resized to zero length.
For an imported medium that is configured with a material mix, custom input model parameters are imported from the snapshot as requested by the MaterialMix::parameterInfo() function. The number and order of parameters returned by this function then reflects the number and order of parameter descriptions returned by the MaterialMix::parameterInfo() function. If the medium is configured with a material mix family, any imported parameters are used to select a member of the material mix family at each location, and this function returns an empty array. In other words, requests by material mix family members for custom input model parameters are ignored.
Implements Medium.
|
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.
|
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.
const Snapshot * ImportedMedium::snapshot | ( | ) | const |
This function returns (a pointer to) the snapshot object associated with this imported medium. It is intended to provide InputModelProbe instances with direct access to the snapshot for probing imported information that is not otherwise made available to the simulation. To preserve proper data encapsulation, this function should not be called from anywhere else in the simulation machinery.
|
overridevirtual |
This function returns the temperature of the medium at the specified position, if defined in the input model. Specifically, if the medium has a gas or electron material mix and the importTemperature flag is enabled, the function returns the imported temperature at the specified position. Otherwise, the function returns zero.
Implements Medium.
|
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.