gridMod Module

This module defines the cartesian grid type (cart_grid) and associated routines.

The cart_grid type contains information related to the grid used to record the fluence. This includes the number of voxels in each cardinal direction (nxg, nyg, nzg), the half size of the grid in each direction (xmax, ymax, zmax), and the locations of the voxels walls in each direction (xface, yface, zface). The type-bound function get_voxel takes a position (vector) and returns the voxel the position falls in.

Init_grid initialises a cart_grid instance.

Grid class


Uses


Interfaces

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)


Derived Types

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 function init_grid (nxg, nyg, nzg, xmax, ymax, zmax)

setup grid

Type-Bound Procedures

procedure, public :: get_voxel

Functions

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)

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)