photon Derived Type

type, public :: photon

photon class


Components

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


Constructor

public interface photon

  • public function init_source(choice)

    Bind emission function to photon object

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: choice

    Name of light source to use

    Return Value type(photon)

  • private function init_photon(val)

    set up all the variables in the photon object

    Arguments

    Type IntentOptional Attributes Name
    real(kind=wp), intent(in) :: val

    value to assing to variables

    Return Value type(photon)


Type-Bound Procedures

procedure, public :: scatter

scattering routine

  • private subroutine scatter(this, hgg, g2, dects)

    Scattering routine. Implments both isotropic and henyey-greenstein scattering taken from mcxyz

    Arguments

    Type IntentOptional 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.

Source Code

    type :: photon
        !> postion of photon packet in cm. (0,0,0) is the center of the grid.
        type(vector)  :: pos
        !> direction vectors
        real(kind=wp) :: nxp, nyp, nzp
        !> direction cosines
        real(kind=wp) :: sint, cost, sinp, cosp, phi
        !> Wavelength of the packet
        real(kind=wp) :: wavelength
        !> Current phase of the packet
        real(kind=wp) :: phase
        !> \[\frac{2\pi}{\lambda}\]. Used to save computational time
        real(kind=wp) :: fact
        !> Energy of the packet. TODO
        real(kind=wp) :: energy
        !> grid cell position 
        integer       :: xcell, ycell, zcell
        !> photon alive flag
        logical       :: tflag
        !> ID of the SDF the packet is in
        integer       :: layer
        !> Thread ID of the packet
        integer       :: id
        !> Debug data. Number of SDF evals
        integer       :: cnts, bounces
        !> used if photon packet weights are used
        real(kind=wp) :: weight, step!, L
        !> emission routine
        procedure(generic_emit), pointer :: emit => null()
        contains
            !> scattering routine
            procedure :: scatter => scatter
    end type photon