BeamGrid Derived Type

type, public :: BeamGrid

Defines a 3D grid for neutral beam calculations


Contents

Source Code


Components

TypeVisibilityAttributesNameInitial
integer(kind=Int32), public :: nx

Number of cells in the x direction

integer(kind=Int32), public :: ny

Number of cells in the y direction

integer(kind=Int32), public :: nz

Number of cells in the z direction

real(kind=Float64), public :: xmin

Minimum x value

real(kind=Float64), public :: xmax

Maximum x value

real(kind=Float64), public :: ymin

Minimum y value

real(kind=Float64), public :: ymax

Maximum y value

real(kind=Float64), public :: zmin

Minimum z value

real(kind=Float64), public :: zmax

Maximum z value

real(kind=Float64), public :: alpha

Tait-Bryan angle for a rotation about z [radians]

real(kind=Float64), public :: beta

Tait-Bryan angle for a rotation about y' [radians]

real(kind=Float64), public :: gamma

Tait-Bryan angle for a rotation about x" [radians]

real(kind=Float64), public :: drmin

Minimum cell spacing: min(dx,dy,dz)

real(kind=Float64), public :: dv

Cell volume []

real(kind=Float64), public :: volume

Grid volume []

integer(kind=Int32), public :: ntrack

Maximum number of cell for particle tracking

integer(kind=Int32), public :: ngrid

Number of cells

integer(kind=Int32), public, dimension(3):: dims

Dimensions of beam grid

real(kind=Float64), public, dimension(3):: origin

Origin of beam grid in machine coordinates

real(kind=Float64), public, dimension(3):: center

Center of beam grid in beam coordinates

real(kind=Float64), public, dimension(3):: dr

Cell spacings [dx, dy, dz]

real(kind=Float64), public, dimension(3):: lwh

Grid [length(x), width(y), height(z)]

real(kind=Float64), public, dimension(3,3):: basis

Beam grid basis for converting from beam coordinates(xyz) to machine coordinates(uvw): (\uvw = B*xyz + origin)

real(kind=Float64), public, dimension(3,3):: inv_basis

Inverse basis for reverse transformation: (\xyz = B^{-1}*(uvw - origin))

real(kind=Float64), public, dimension(:), allocatable:: xc

x positions of cell centers

real(kind=Float64), public, dimension(:), allocatable:: yc

y positions of cell centers

real(kind=Float64), public, dimension(:), allocatable:: zc

z positions of cell centers


Source Code

type BeamGrid
    !+ Defines a 3D grid for neutral beam calculations
    integer(Int32) :: nx
        !+ Number of cells in the x direction
    integer(Int32) :: ny
        !+ Number of cells in the y direction
    integer(Int32) :: nz
        !+ Number of cells in the z direction
    real(Float64)  :: xmin
        !+ Minimum x value
    real(Float64)  :: xmax
        !+ Maximum x value
    real(Float64)  :: ymin
        !+ Minimum y value
    real(Float64)  :: ymax
        !+ Maximum y value
    real(Float64)  :: zmin
        !+ Minimum z value
    real(Float64)  :: zmax
        !+ Maximum z value
    real(Float64)  :: alpha
        !+ Tait-Bryan angle for a rotation about z [radians]
    real(Float64)  :: beta
        !+ Tait-Bryan angle for a rotation about y' [radians]
    real(Float64)  :: gamma
        !+ Tait-Bryan angle for a rotation about x" [radians]
    real(Float64)  :: drmin
        !+ Minimum cell spacing: `min(dx,dy,dz)`
    real(Float64)  :: dv
        !+ Cell volume [\(cm^3\)]
    real(Float64)  :: volume
        !+ Grid volume [\(cm^3\)]
    integer(Int32) :: ntrack
        !+ Maximum number of cell for particle tracking
    integer(Int32) :: ngrid
        !+ Number of cells
    integer(Int32), dimension(3)  :: dims
        !+ Dimensions of beam grid
    real(Float64), dimension(3)   :: origin
        !+ Origin of beam grid in machine coordinates
    real(Float64), dimension(3)   :: center
        !+ Center of beam grid in beam coordinates
    real(Float64), dimension(3)   :: dr
        !+ Cell spacings [dx, dy, dz]
    real(Float64), dimension(3)   :: lwh
        !+ Grid [length(x), width(y), height(z)]
    real(Float64), dimension(3,3) :: basis
        !+Beam grid basis for converting from beam coordinates(xyz)
        !+to machine coordinates(uvw): (\uvw = B*xyz + origin\)
    real(Float64), dimension(3,3) :: inv_basis
        !+Inverse basis for reverse transformation: (\xyz = B^{-1}*(uvw - origin)\)
    real(Float64), dimension(:), allocatable :: xc
        !+ x positions of cell centers
    real(Float64), dimension(:), allocatable :: yc
        !+ y positions of cell centers
    real(Float64), dimension(:), allocatable :: zc
        !+ z positions of cell centers
end type BeamGrid