cart_grid Derived Type

type, public :: cart_grid


Components

Type Visibility Attributes Name Initial
real(kind=wp), public :: delta

Delta is the round off for near voxel cell walls

integer, public :: nxg

number of voxels in each cardinal direction for fluence grid

integer, public :: nyg

number of voxels in each cardinal direction for fluence grid

integer, public :: nzg

number of voxels in each cardinal direction for fluence grid

real(kind=wp), public, allocatable :: xface(:)

position of each cell wall in fluence grid

real(kind=wp), public :: xmax

half size of each dimension in fluence grid.

real(kind=wp), public, allocatable :: yface(:)

position of each cell wall in fluence grid

real(kind=wp), public :: ymax

half size of each dimension in fluence grid.

real(kind=wp), public, allocatable :: zface(:)

position of each cell wall in fluence grid

real(kind=wp), public :: zmax

half size of each dimension in fluence grid.


Constructor

public interface cart_grid

  • public function init_grid(nxg, nyg, nzg, xmax, ymax, zmax)

    setup grid

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: nxg

    number of voxels in each cardinal direction for fluence grid

    integer, intent(in) :: nyg

    number of voxels in each cardinal direction for fluence grid

    integer, intent(in) :: nzg

    number of voxels in each cardinal direction for fluence grid

    real(kind=wp), intent(in) :: xmax

    half size of each dimension in fluence grid.

    real(kind=wp), intent(in) :: ymax

    half size of each dimension in fluence grid.

    real(kind=wp), intent(in) :: zmax

    half size of each dimension in fluence grid.

    Return Value type(cart_grid)


Type-Bound Procedures

procedure, public :: get_voxel

  • private function get_voxel(this, pos) result(res)

    get current voxel the photon packet is in

    Arguments

    Type IntentOptional Attributes Name
    class(cart_grid) :: this

    grid class

    type(vector), intent(in) :: pos

    current vector position of photon packet

    Return Value integer, (3)

Source Code

    type :: cart_grid
        !> number of voxels in each cardinal direction for fluence grid
        integer       :: nxg, nyg, nzg
        !> half size of each dimension in fluence grid. 
        real(kind=wp) :: xmax, ymax, zmax
        !> Delta is the round off for near voxel cell walls
        real(kind=wp) :: delta
        !> position of each cell wall in fluence grid
        real(kind=wp), allocatable :: xface(:), yface(:), zface(:)
        contains
        procedure :: get_voxel
    end type cart_grid