#include <DensityTreePolicy.hpp>
Public Member Functions | |
vector< TreeNode * > | constructTree (TreeNode *root) override |
double | maxDustDensityDispersion () const |
double | maxDustFraction () const |
double | maxDustOpticalDepth () const |
double | maxElectronFraction () const |
double | maxGasFraction () const |
virtual bool | needsSubdivide (TreeNode *node) |
double | wavelength () const |
Range | wavelengthRange () const override |
![]() | |
virtual vector< TreeNode * > | constructTree (TreeNode *root)=0 |
int | maxLevel () const |
int | minLevel () const |
![]() | |
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 WavelengthGrid * | materialWavelengthGrid () const |
![]() | |
virtual | ~WavelengthRangeInterface () |
virtual Range | wavelengthRange () const =0 |
Protected Member Functions | |
DensityTreePolicy () | |
void | setupSelfBefore () override |
![]() | |
TreePolicy () | |
void | setupSelfBefore () override |
![]() | |
SimulationItem () | |
virtual bool | offersInterface (const std::type_info &interfaceTypeInfo) const |
virtual void | setupSelfAfter () |
virtual void | setupSelfBefore () |
![]() | |
Item () | |
![]() | |
MaterialWavelengthRangeInterface () | |
![]() | |
WavelengthRangeInterface () | |
Private Types | |
using | BaseType = TreePolicy |
using | ItemType = DensityTreePolicy |
Private Attributes | |
double | _dustKappa |
double | _dustMass |
vector< Medium * > | _dustMedia |
vector< Medium * > | _electronMedia |
double | _electronNumber |
vector< Medium * > | _gasMedia |
double | _gasNumber |
bool | _hasAny |
bool | _hasDustAny |
bool | _hasDustDensityDispersion |
bool | _hasDustFraction |
bool | _hasDustOpticalDepth |
bool | _hasElectronFraction |
bool | _hasGasFraction |
double | _maxDustDensityDispersion |
double | _maxDustFraction |
double | _maxDustOpticalDepth |
double | _maxElectronFraction |
double | _maxGasFraction |
int | _numSamples |
Random * | _random |
double | _wavelength |
Friends | |
class | ItemRegistry |
DensityTreePolicy represents the configurable options and the corresponding implementation mechanisms for constructing spatial tree grids based on the density distribution of the media in the medium system.
This policy offers several options for configuring the recursive subdivision of the hierarchical tree. First of all, the minimum and maximum tree subdvision levels (actually offered by the base class) override the other subdvision criteria described below. Tree nodes are always subdivided up to the minimum level, and nodes are never subdivided beyond the maximum level, regardless of the outcome of the other criteria.
The remaining subdvision criteria consist of the maximum mass fraction
We first discuss the three criteria related to dust. For this material type, we use mass and mass density (as opposed to number and number density) because it is the appropriate quantity for dust in case multiple dust medium components have a different mass per hydrogen atom value. The total dust mass in the model,
The fraction of the mass
The estimated optical depth
where
Finally, a measure for the dust density dispersion
where
For electrons and for gas, only the maximum mass fraction criterion is offered. For these material types, the number
This class implements the MaterialWavelengthRangeInterface to indicate that wavelength-dependent material properties will be required in case the optical depth criterion is enabled.
|
inlineprotected |
Default constructor for concrete Item subclass DensityTreePolicy : "a tree grid construction policy using the medium density distribution" .
This function constructs the hierarchical tree and all (interconnected) nodes forming the tree as described for the corresponding pure virtual function in the base class. The implementation for this class loops over the tree subdivision levels. For each level, the function alternates between evaluating all of the nodes (i.e. determining which nodes need subdivision) and actually subdividing the nodes that need it.
These operations are split over two phases because the first one can be parallelized (the only output is a Boolean flag), while the second one cannot (the tree structure is updated in various ways). Parallelizing the first operation is often meaningful, because determining whether a node needs subdivision can be resource-intensive. For example, it may require sampling densities in the source distribution.
Implements TreePolicy.
|
inline |
This function returns the value of the discoverable double property maxDustDensityDispersion : "the maximum dust density dispersion in each cell" .
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 "0" .
This property is displayed only if the Boolean expression "DustMix&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 double property maxDustFraction : "the maximum fraction of dust contained in each cell" .
The minimum value for this property is "[0" .
The maximum value for this property is "1e-2]" .
The default value for this property is given by the conditional value expression "1e-6" .
This property is displayed only if the Boolean expression "DustMix" 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 maxDustOpticalDepth : "the maximum diagonal dust optical depth for each cell" .
The minimum value for this property is "[0" .
The maximum value for this property is "100]" .
The default value for this property is given by the conditional value expression "0" .
This property is displayed only if the Boolean expression "DustMix&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 double property maxElectronFraction : "the maximum fraction of electrons contained in each cell" .
The minimum value for this property is "[0" .
The maximum value for this property is "1e-2]" .
The default value for this property is given by the conditional value expression "1e-6" .
This property is displayed only if the Boolean expression "ElectronMix" 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 maxGasFraction : "the maximum fraction of gas contained in each cell" .
The minimum value for this property is "[0" .
The maximum value for this property is "1e-2]" .
The default value for this property is given by the conditional value expression "1e-6" .
This property is displayed only if the Boolean expression "GasMix" evaluates to true after replacing the names by true or false depending on their presence.
|
virtual |
This function returns true if the given node needs to be subdivided according to the criteria configured for this policy, including minimum and maximum level, and false otherwise.
Reimplemented in NestedDensityTreePolicy.
|
overrideprotectedvirtual |
This function obtains and caches information used by the needsSubdivide() function to evaluate the configured criteria.
Reimplemented from SimulationItem.
Reimplemented in NestedDensityTreePolicy.
|
inline |
This function returns the value of the discoverable double property wavelength : "the wavelength at which to evaluate the optical depth" .
This property represents a physical quantity of type "wavelength" .
The minimum value for this property is "1 pm" .
The maximum value for this property is "1 m" .
The default value for this property is given by the conditional value expression "0.55 micron" .
This property is relevant only if the Boolean expression "maxDustOpticalDepth" evaluates to true after replacing the names by true or false depending on their presence.
|
overridevirtual |
If the optical depth criterion is enabled, this function returns a wavelength range corresponding to the related user-configured wavelength, indicating that wavelength-dependent material properties will be required for this wavelength. Otherwise, the function returns a null range.
Implements WavelengthRangeInterface.