#include <Source.hpp>
Public Member Functions | |
virtual int | dimension () const =0 |
virtual bool | hasVelocity () const =0 |
virtual void | launch (PhotonPacket *pp, size_t historyIndex, double L) const =0 |
virtual double | luminosity () const =0 |
virtual void | prepareForLaunch (double sourceBias, size_t firstIndex, size_t numIndices) |
double | sourceWeight () const |
virtual double | specificLuminosity (double wavelength) const =0 |
double | wavelengthBias () const |
WavelengthDistribution * | wavelengthBiasDistribution () 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 | ~WavelengthRangeInterface () |
virtual Range | wavelengthRange () const =0 |
Protected Member Functions | |
Source () | |
void | informAvailableWavelengthRange (Range available, string itemType) |
Random * | random () const |
void | setupSelfBefore () override |
![]() | |
SimulationItem () | |
virtual bool | offersInterface (const std::type_info &interfaceTypeInfo) const |
virtual void | setupSelfAfter () |
virtual void | setupSelfBefore () |
![]() | |
Item () | |
![]() | |
SourceWavelengthRangeInterface () | |
![]() | |
WavelengthRangeInterface () | |
Private Types | |
using | BaseType = SimulationItem |
using | ItemType = Source |
Private Attributes | |
Random * | _random |
double | _sourceWeight |
double | _wavelengthBias |
WavelengthDistribution * | _wavelengthBiasDistribution |
Friends | |
class | ItemRegistry |
Source is an abstract class representing a primary radiation source in the simulation. Each source (an instance of a Source subclass) must define the following information at each point in the spatial domain of the source (which is independent of the spatial grid in the simulation):
Furthermore, each source has a function for launching a photon packet that proceeds roughly as follows:
Wavelengths for new photon packets can be sampled from the intrinsic spectral distribution of the source
and the corresponding biasing weight factor becomes
By default, half of the photon packet wavelengths are sampled from each of the distributions, and the default bias distribution spreads wavelengths logarithmically over the wavelength range of the source (more precisely, the logarithm of the wavelength is distributed uniformly).
Properties of sub-types of this type are listed in user interfaces somewhere in between the properties of this type.
|
inlineprotected |
|
pure virtual |
This function returns the dimension of the source, which depends on the (lack of) symmetry of its geometry. A value of 1 means spherical symmetry, 2 means axial symmetry and 3 means none of these symmetries.
Implemented in FilePolarizedPointSource, GeometricSource, ImportedSource, and SpecialtySource.
|
pure virtual |
This function returns true if this source may have a nonzero velocity for some positions. It may be called before setup of the receiving source has completed.
Implemented in FilePolarizedPointSource, GeometricSource, ImportedSource, and SpecialtySource.
|
protected |
This function logs a warning message if the given range is smaller than the configured source wavelength range. The second argument specifies the type of the simulation item to be included in the message. This function can be called from subclasses.
|
pure virtual |
This function causes the photon packet pp to be launched from the source using the given history index and luminosity contribution. The photon packet's contents is fully (re-)initialized so that it is ready to start its lifecycle.
Implemented in FilePolarizedPointSource, ImportedSource, and NormalizedSource.
|
pure virtual |
This function returns the luminosity
Implemented in FilePolarizedPointSource, ImportedSource, and NormalizedSource.
|
virtual |
This function may perform some preparations for launching photon packets. It is called in serial mode before each segment of photon packet launches, providing the history indices mapped by the source system to this particular source. This allows the source to further map these indices to subsources if that would be meaningful. See the description of the SourceSystem class for more information. The default implementation of this function does nothing.
Reimplemented in ImportedSource.
|
inlineprotected |
This function returns the simulation's random generator as a service to subclasses.
|
overrideprotectedvirtual |
This function caches the simulation's random generator for use by subclasses.
Reimplemented from SimulationItem.
Reimplemented in SpecialtySource.
|
inline |
This function returns the value of the discoverable double property sourceWeight : "the weight of this source for the number of photon packets launched" .
The minimum value for this property is "]0" .
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.
|
pure virtual |
This function returns the specific luminosity
Implemented in FilePolarizedPointSource, ImportedSource, and NormalizedSource.
|
inline |
This function returns the value of the discoverable double property wavelengthBias : "the fraction of photon packet wavelengths sampled from a bias distribution" .
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.5" .
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 "Level3" 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 wavelengthBiasDistribution : "the bias distribution for sampling photon packet wavelengths" .
The default value for this property is given by the conditional value expression "DefaultWavelengthDistribution" .
This property is relevant only if the Boolean expression "Panchromatic&wavelengthBias" 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.