#include <Probe.hpp>
Public Member Functions | |
string | itemName () const override |
int | iter () const |
string | probeName () const |
void | probePrimary (int iter) |
void | probeRun () |
void | probeSecondary (int iter) |
void | probeSetup () |
![]() | |
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 |
Protected Types | |
enum class | When { Setup , Run , Primary , Secondary } |
Protected Member Functions | |
Probe () | |
virtual void | initialize () |
virtual void | probe ()=0 |
virtual When | when () const |
![]() | |
SimulationItem () | |
virtual bool | offersInterface (const std::type_info &interfaceTypeInfo) const |
virtual void | setupSelfAfter () |
virtual void | setupSelfBefore () |
![]() | |
Item () | |
Private Types | |
using | BaseType = SimulationItem |
using | ItemType = Probe |
Private Attributes | |
int | _iter |
string | _probeName |
Friends | |
class | ItemRegistry |
Probe is an abstract class representing probes that output information on internal simulation data before or during the simulation run. Refer to the ProbeSystem class for more information.
Probe subclasses must adhere to the following rules. In this discussion, target refers to the item(s) in the simulation hierarchy from which the probe retrieves information.
|
strongprotected |
This enumeration indicates when to perform probing: after setup, after the complete simulation run, or after primary/secondary emission iterations.
|
protectedvirtual |
This function is called after the simulation has been fully setup but before the probe() function is called. It can implemented by a subclass that needs to perform some initialization that requires the simulation to be fully setup. The default implementation in this base class does nothing.
Reimplemented in LaunchedPacketsProbe.
|
overridevirtual |
This function returns the probe name as human-readable name for the simulation item, so that it can be used in log messages to identify the probe and differentiate it from other probes.
Reimplemented from SimulationItem.
int Probe::iter | ( | ) | const |
During the execution of the probePrimary() or probeSecondary() function, this function returns the current one-based primary or secondary emission iteration index. Otherwise the function returns zero.
|
protectedpure virtual |
This function must be implemented in each subclass to produce the relevant probing output. It is called either at the end of setup or at the end of the simulation run, depending on the return value of the when() function.
Implemented in ConvergenceCutsProbe, ConvergenceInfoProbe, CustomStateProbe, DensityProbe, DustAbsorptionPerCellProbe, DustEmissionWavelengthGridProbe, DustEmissivityProbe, DustGrainPopulationsProbe, DustGrainSizeDistributionProbe, InputModelFormProbe, InstrumentWavelengthGridProbe, LaunchedPacketsProbe, LuminosityProbe, MagneticFieldProbe, MetallicityProbe, OpacityProbe, OpticalMaterialPropertiesProbe, RadiationFieldProbe, RadiationFieldWavelengthGridProbe, SecondaryDustLuminosityProbe, SecondaryLineLuminosityProbe, SpatialCellPropertiesProbe, SpatialGridPlotProbe, SpatialGridSourceDensityProbe, TemperatureProbe, TreeSpatialGridTopologyProbe, and VelocityProbe.
|
inline |
This function returns the value of the discoverable string property probeName : "the name for this probe" .
void Probe::probePrimary | ( | int | iter | ) |
This function is called at the end of each iteration over primary emission, i.e. after all photon packets have been processed and the medium state and the radiation field have been updated if needed. The function argument specifies the one-based iteration index. If when() returns Primary
, this function saves the iteration index and calls probe(); otherwise it does nothing.
void Probe::probeRun | ( | ) |
void Probe::probeSecondary | ( | int | iter | ) |
This function is called at the end of each iteration over secondary emission, i.e. after all photon packets have been processed and the medium state and the radiation field have been updated if needed. In some execution flows, the iteration may include both a primary and secondary emission segment. The function argument specifies the one-based iteration index. If when() returns Secondary
, this function saves the iteration index and calls probe(); otherwise it does nothing.
void Probe::probeSetup | ( | ) |
This function is called at the end of the setup phase, i.e. after all simulation items have performed setup. It first calls initialize(), and if when() returns Setup
, it then calls probe().
|
protectedvirtual |
This function returns an enumeration indicating when probing should be performed for this probe. The default implementation in this base class returns Setup
. A subclass needs to override this function only if it (may) require probing at a different time.
Reimplemented in DustAbsorptionPerCellProbe, LaunchedPacketsProbe, RadiationFieldProbe, SecondaryDustLuminosityProbe, SecondaryLineLuminosityProbe, SpatialGridWhenFormProbe, and SpecialtyWhenProbe.