This source file contains the photon type, all the photon launch routines for different light sources, and the scattering code.
Below are the current types of light sources available. Check here for parameters needed for each light source.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(photon), | public | :: | photon_origin |
used to save some computation time |
Bind emission function to photon object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | choice |
Name of light source to use |
set up all the variables in the photon object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | val |
value to assing to variables |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(photon) | :: | this | ||||
type(spectrum_t), | intent(in) | :: | spectrum | |||
type(toml_table), | intent(inout), | optional | :: | dict | ||
type(seq), | intent(inout), | optional | :: | seqs(2) |
photon class
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | bounces |
Debug data. Number of SDF evals |
|||
integer, | public | :: | cnts |
Debug data. Number of SDF evals |
|||
real(kind=wp), | public | :: | cosp |
direction cosines |
|||
real(kind=wp), | public | :: | cost |
direction cosines |
|||
procedure(generic_emit), | public, | pointer | :: | emit | => | null() |
emission routine |
real(kind=wp), | public | :: | energy |
Energy of the packet. TODO |
|||
real(kind=wp), | public | :: | fact |
. Used to save computational time |
|||
integer, | public | :: | id |
Thread ID of the packet |
|||
integer, | public | :: | layer |
ID of the SDF the packet is in |
|||
real(kind=wp), | public | :: | nxp |
direction vectors |
|||
real(kind=wp), | public | :: | nyp |
direction vectors |
|||
real(kind=wp), | public | :: | nzp |
direction vectors |
|||
real(kind=wp), | public | :: | phase |
Current phase of the packet |
|||
real(kind=wp), | public | :: | phi |
direction cosines |
|||
type(vector), | public | :: | pos |
postion of photon packet in cm. (0,0,0) is the center of the grid. |
|||
real(kind=wp), | public | :: | sinp |
direction cosines |
|||
real(kind=wp), | public | :: | sint |
direction cosines |
|||
real(kind=wp), | public | :: | step |
used if photon packet weights are used |
|||
logical, | public | :: | tflag |
photon alive flag |
|||
real(kind=wp), | public | :: | wavelength |
Wavelength of the packet |
|||
real(kind=wp), | public | :: | weight |
used if photon packet weights are used |
|||
integer, | public | :: | xcell |
grid cell position |
|||
integer, | public | :: | ycell |
grid cell position |
|||
integer, | public | :: | zcell |
grid cell position |
public function init_source (choice) | Bind emission function to photon object |
private function init_photon (val) | set up all the variables in the photon object |
procedure, public :: scatter | ../../ scattering routine |
set up all the variables in the photon object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | val |
value to assing to variables |
Bind emission function to photon object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | choice |
Name of light source to use |
annular source
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(photon) | :: | this | ||||
type(spectrum_t), | intent(in) | :: | spectrum | |||
type(toml_table), | intent(inout), | optional | :: | dict | ||
type(seq), | intent(inout), | optional | :: | seqs(2) |
sample from square aperture to produce diff pattern
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(photon) | :: | this | ||||
type(spectrum_t), | intent(in) | :: | spectrum | |||
type(toml_table), | intent(inout), | optional | :: | dict | ||
type(seq), | intent(inout), | optional | :: | seqs(2) |
circular source
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(photon) | :: | this | ||||
type(spectrum_t), | intent(in) | :: | spectrum | |||
type(toml_table), | intent(inout), | optional | :: | dict | ||
type(seq), | intent(inout), | optional | :: | seqs(2) |
sample from double slit to produce diff pattern
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(photon) | :: | this | ||||
type(spectrum_t), | intent(in) | :: | spectrum | |||
type(toml_table), | intent(inout), | optional | :: | dict | ||
type(seq), | intent(inout), | optional | :: | seqs(2) |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(photon) | :: | this | ||||
type(spectrum_t), | intent(in) | :: | spectrum | |||
type(toml_table), | intent(inout), | optional | :: | dict | ||
type(seq), | intent(inout), | optional | :: | seqs(2) |
pencil beam source
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(photon) | :: | this | ||||
type(spectrum_t), | intent(in) | :: | spectrum | |||
type(toml_table), | intent(inout), | optional | :: | dict | ||
type(seq), | intent(inout), | optional | :: | seqs(2) |
isotropic point source
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(photon) | :: | this | ||||
type(spectrum_t), | intent(in) | :: | spectrum | |||
type(toml_table), | intent(inout), | optional | :: | dict | ||
type(seq), | intent(inout), | optional | :: | seqs(2) |
Scattering routine. Implments both isotropic and henyey-greenstein scattering taken from mcxyz
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(photon), | intent(inout) | :: | this | |||
real(kind=wp), | intent(in) | :: | hgg |
g factor |
||
real(kind=wp), | intent(in) | :: | g2 |
g factor squared |
||
type(dect_array), | intent(in), | optional | :: | dects(:) |
array of detectors. Only used if biased scattering is enabled. |
image source
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(photon) | :: | this | ||||
type(spectrum_t), | intent(in) | :: | spectrum |
Input image to sample position from |
||
type(toml_table), | intent(inout), | optional | :: | dict |
Metadata dictionary |
|
type(seq), | intent(inout), | optional | :: | seqs(2) |
random numbers from a sequence. Quasi-Monte Carlo |
uniformly illuminate a surface of the simulation media
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(photon) | :: | this | ||||
type(spectrum_t), | intent(in) | :: | spectrum | |||
type(toml_table), | intent(inout), | optional | :: | dict | ||
type(seq), | intent(inout), | optional | :: | seqs(2) |