Skip to content

adam_prism_fnl_pic_object

ADAM, PRISM Particle-in-Cell definition, FNL backend.

Source: src/app/prism/fnl/adam_prism_fnl_pic_object.F90

Dependencies

Contents

Variables

NameTypeAttributesDescription
PIC_VARIABLES_NUMBERinteger(kind=I4P)parameter
PIC_FIELDS_NUMBERinteger(kind=I4P)parameter
PIC_NEIGHBOURS_NUMBERinteger(kind=I4P)parameter

Derived Types

prism_fnl_pic_object

Components

NameTypeAttributesDescription
q_pic_gpureal(kind=R8P)pointerPIC variables on device [particle, variable].
pic_fields_gpureal(kind=R8P)pointerFields at particle locations on device [particle, field].
neighbour_list_gpuinteger(kind=I4P)pointerParticle-cell map on device [particle, entry].
db2_q_picinteger(kind=I4P)Device bounds for q_pic_gpu.
hb2_q_picinteger(kind=I4P)Host bounds for q_pic.
db2_pic_fieldsinteger(kind=I4P)Device bounds for pic_fields_gpu.
hb2_pic_fieldsinteger(kind=I4P)Host bounds for pic_fields.
db2_neighbour_listinteger(kind=I4P)Device bounds for neighbour_list_gpu.
hb2_neighbour_listinteger(kind=I4P)Host bounds for neighbour_list.
buf_q_pic_R8Preal(kind=R8P)allocatableHost buffer with device layout for q_pic copies.
buf_pic_fields_R8Preal(kind=R8P)allocatableHost buffer with device layout for pic_fields copies.
buf_neighbour_list_I4Pinteger(kind=I4P)allocatableHost buffer with device layout for neighbour_list copies.
sigmareal(kind=R8P)Standard deviation for Gaussian weighting.
cutoff_sigmareal(kind=R8P)Gaussian cutoff radius in sigma units.
particle_numberinteger(kind=I4P)Total number of particles.
n_ionsinteger(kind=I4P)Total ions number.
n_electronsinteger(kind=I4P)Total electrons number.
n_neutralsinteger(kind=I4P)Total neutrals number.
particle_cartesian_grid_index_devprocedure(particle_cartesian_grid_index_interface_dev)pass(self), pointer
particle_weighting_devprocedure(particle_weighting_interface_dev)pass(self), pointer
current_weighting_devprocedure(current_weighting_interface_dev)pass(self), pointer
field_weighting_devprocedure(field_weighting_interface_dev)pass(self), pointer

Type-Bound Procedures

NameAttributesDescription
copy_cpu_gpupass(self)
copy_gpu_cpupass(self)
copy_q_pic_gpu_cpupass(self)
destroypass(self)
initializepass(self)
particle_cartesian_grid_index_dev_implpass(self)
NGP_charge_weighting_devpass(self)
CIC_charge_weighting_devpass(self)
TSC_charge_weighting_devpass(self)
cubic_charge_weighting_devpass(self)
quartic_charge_weighting_devpass(self)
quintic_charge_weighting_devpass(self)
Gaussian_charge_weighting_devpass(self)
NGP_current_weighting_devpass(self)
CIC_current_weighting_devpass(self)
TSC_current_weighting_devpass(self)
cubic_current_weighting_devpass(self)
quartic_current_weighting_devpass(self)
quintic_current_weighting_devpass(self)
Gaussian_current_weighting_devpass(self)
zeroD_field_weighting_devpass(self)
oneD_field_weighting_devpass(self)
twoD_field_weighting_devpass(self)
threeD_field_weighting_devpass(self)
fourD_field_weighting_devpass(self)
fiveD_field_weighting_devpass(self)
Gaussian_field_weighting_devpass(self)

Interfaces

particle_cartesian_grid_index_interface_dev

particle_weighting_interface_dev

current_weighting_interface_dev

field_weighting_interface_dev

Subroutines

destroy

Free device and host staging data owned by this object.

fortran
subroutine destroy(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inoutPIC object on device.

Call graph

copy_cpu_gpu

Copy PIC data from CPU to GPU.

fortran
subroutine copy_cpu_gpu(self, pic, q_pic, pic_fields, verbose)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inoutPIC object on device.
picclass(prism_pic_object)inPIC object on host.
q_picreal(kind=R8P)intargetPIC variables on host.
pic_fieldsreal(kind=R8P)intargetFields at particle locations on host.
verboselogicalinoptionalTrigger verbose output.

Call graph

copy_gpu_cpu

Copy PIC data from GPU to CPU.

fortran
subroutine copy_gpu_cpu(self, pic, q_pic, pic_fields, verbose)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inoutPIC object on device.
picclass(prism_pic_object)inoutPIC object on host.
q_picreal(kind=R8P)inouttargetPIC variables on host.
pic_fieldsreal(kind=R8P)inouttargetFields at particle locations on host.
verboselogicalinoptionalTrigger verbose output.

Call graph

copy_q_pic_gpu_cpu

Copy only PIC particle state from GPU to CPU.

fortran
subroutine copy_q_pic_gpu_cpu(self, q_pic, verbose)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inoutPIC object on device.
q_picreal(kind=R8P)inouttargetPIC variables on host.
verboselogicalinoptionalTrigger verbose output.

Call graph

initialize

Initialize PIC device mirrors and dispatch hooks.

fortran
subroutine initialize(self, pic, q_pic, pic_fields)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inoutPIC object on device.
pictype(prism_pic_object)inPIC object on host.
q_picreal(kind=R8P)intargetPIC variables on host.
pic_fieldsreal(kind=R8P)intargetFields at particle locations on host.

Call graph

particle_cartesian_grid_index_dev_impl

Compute the grid index corresponding to a particle position. Good for cartesian grids only.

fortran
subroutine particle_cartesian_grid_index_dev_impl(self, field_fnl, field, grid, q_pic_gpu)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inoutPIC object on device.
field_fnltype(field_fnl_object)inDevice field helper.
fieldtype(field_object)inHost field helper.
gridtype(grid_object)inHost grid helper.
q_pic_gpureal(kind=R8P)inPIC variables on device.

NGP_charge_weighting_dev

Nearest Grid Point weighting of particle charge density to the grid.

fortran
subroutine NGP_charge_weighting_dev(self, field_fnl, field, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inoutPIC object on device.
field_fnltype(field_fnl_object)inDevice field helper.
fieldtype(field_object)inHost field helper.
gridtype(grid_object)inHost grid helper.
q_gpureal(kind=R8P)inoutField variables on device.
q_pic_gpureal(kind=R8P)inPIC variables on device.
nvinteger(kind=I4P)inCharge variable index.

Call graph

CIC_charge_weighting_dev

Cloud-in-Cell weighting of particle charge density to the grid.

fortran
subroutine CIC_charge_weighting_dev(self, field_fnl, field, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

TSC_charge_weighting_dev

Triangular-Shaped-Cloud weighting of particle charge density to the grid.

fortran
subroutine TSC_charge_weighting_dev(self, field_fnl, field, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

cubic_charge_weighting_dev

Cubic B-spline weighting of particle charge density to the grid.

fortran
subroutine cubic_charge_weighting_dev(self, field_fnl, field, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

quartic_charge_weighting_dev

Quartic B-spline weighting of particle charge density to the grid.

fortran
subroutine quartic_charge_weighting_dev(self, field_fnl, field, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

quintic_charge_weighting_dev

Quintic B-spline weighting of particle charge density to the grid.

fortran
subroutine quintic_charge_weighting_dev(self, field_fnl, field, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

Gaussian_charge_weighting_dev

Gaussian weighting of particle charge density to the grid.

fortran
subroutine Gaussian_charge_weighting_dev(self, field_fnl, field, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

NGP_current_weighting_dev

Nearest Grid Point weighting of particle current density to the grid.

fortran
subroutine NGP_current_weighting_dev(self, field_fnl, field, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

CIC_current_weighting_dev

Cloud-in-Cell weighting of particle current density to the grid.

fortran
subroutine CIC_current_weighting_dev(self, field_fnl, field, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

TSC_current_weighting_dev

Triangular-Shaped-Cloud weighting of particle current density to the grid.

fortran
subroutine TSC_current_weighting_dev(self, field_fnl, field, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

cubic_current_weighting_dev

Cubic B-spline weighting of particle current density to the grid.

fortran
subroutine cubic_current_weighting_dev(self, field_fnl, field, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

quartic_current_weighting_dev

Quartic B-spline weighting of particle current density to the grid.

fortran
subroutine quartic_current_weighting_dev(self, field_fnl, field, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

quintic_current_weighting_dev

Quintic B-spline weighting of particle current density to the grid.

fortran
subroutine quintic_current_weighting_dev(self, field_fnl, field, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

Gaussian_current_weighting_dev

Gaussian weighting of particle current density to the grid.

fortran
subroutine Gaussian_current_weighting_dev(self, field_fnl, field, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

zeroD_field_weighting_dev

Zeroth-order spatial interpolation of cell-centered fields to particle locations.

fortran
subroutine zeroD_field_weighting_dev(self, field_fnl, field, grid, pic_fields_gpu, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
pic_fields_gpureal(kind=R8P)inout
q_gpureal(kind=R8P)in
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

oneD_field_weighting_dev

First-order spatial interpolation of cell-centered fields to particle locations.

fortran
subroutine oneD_field_weighting_dev(self, field_fnl, field, grid, pic_fields_gpu, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
pic_fields_gpureal(kind=R8P)inout
q_gpureal(kind=R8P)in
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

twoD_field_weighting_dev

Second-order spatial interpolation of cell-centered fields to particle locations.

fortran
subroutine twoD_field_weighting_dev(self, field_fnl, field, grid, pic_fields_gpu, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
pic_fields_gpureal(kind=R8P)inout
q_gpureal(kind=R8P)in
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

threeD_field_weighting_dev

Third-order spatial interpolation of cell-centered fields to particle locations.

fortran
subroutine threeD_field_weighting_dev(self, field_fnl, field, grid, pic_fields_gpu, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
pic_fields_gpureal(kind=R8P)inout
q_gpureal(kind=R8P)in
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

fourD_field_weighting_dev

Fourth-order spatial interpolation of cell-centered fields to particle locations.

fortran
subroutine fourD_field_weighting_dev(self, field_fnl, field, grid, pic_fields_gpu, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
pic_fields_gpureal(kind=R8P)inout
q_gpureal(kind=R8P)in
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

fiveD_field_weighting_dev

Fifth-order spatial interpolation of cell-centered fields to particle locations.

fortran
subroutine fiveD_field_weighting_dev(self, field_fnl, field, grid, pic_fields_gpu, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
pic_fields_gpureal(kind=R8P)inout
q_gpureal(kind=R8P)in
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

Gaussian_field_weighting_dev

Gaussian interpolation of cell-centered fields to particle locations.

fortran
subroutine Gaussian_field_weighting_dev(self, field_fnl, field, grid, pic_fields_gpu, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)inout
field_fnltype(field_fnl_object)in
fieldtype(field_object)in
gridtype(grid_object)in
pic_fields_gpureal(kind=R8P)inout
q_gpureal(kind=R8P)in
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

deposit_bspline_charge_dev

Deposit particle charge density with centered cardinal B-splines.

fortran
subroutine deposit_bspline_charge_dev(self, field_fnl, grid, q_gpu, q_pic_gpu, nv, order)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)in
field_fnltype(field_fnl_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in
orderinteger(kind=I4P)in

Call graph

deposit_gaussian_charge_dev

Deposit particle charge density with Gaussian support.

fortran
subroutine deposit_gaussian_charge_dev(self, field_fnl, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)in
field_fnltype(field_fnl_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

deposit_bspline_current_dev

Deposit particle current density with centered cardinal B-splines.

fortran
subroutine deposit_bspline_current_dev(self, field_fnl, grid, q_gpu, q_pic_gpu, nv, order)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)in
field_fnltype(field_fnl_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in
orderinteger(kind=I4P)in

Call graph

deposit_gaussian_current_dev

Deposit particle current density with Gaussian support.

fortran
subroutine deposit_gaussian_current_dev(self, field_fnl, grid, q_gpu, q_pic_gpu, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)in
field_fnltype(field_fnl_object)in
gridtype(grid_object)in
q_gpureal(kind=R8P)inout
q_pic_gpureal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

gather_bspline_fields_dev

Gather cell-centered fields at particle locations with centered cardinal B-splines.

fortran
subroutine gather_bspline_fields_dev(self, field_fnl, grid, pic_fields_gpu, q_gpu, q_pic_gpu, order)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)in
field_fnltype(field_fnl_object)in
gridtype(grid_object)in
pic_fields_gpureal(kind=R8P)inout
q_gpureal(kind=R8P)in
q_pic_gpureal(kind=R8P)in
orderinteger(kind=I4P)in

Call graph

gather_gaussian_fields_dev

Gather cell-centered fields at particle locations with Gaussian support.

fortran
subroutine gather_gaussian_fields_dev(self, field_fnl, grid, pic_fields_gpu, q_gpu, q_pic_gpu)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_fnl_pic_object)in
field_fnltype(field_fnl_object)in
gridtype(grid_object)in
pic_fields_gpureal(kind=R8P)inout
q_gpureal(kind=R8P)in
q_pic_gpureal(kind=R8P)in

Call graph

set_bspline_stencil_dev

Compute the one-dimensional B-spline stencil.

Attributes: pure

fortran
subroutine set_bspline_stencil_dev(order, x_p, x_c, i_p, i_min, i_max)

Arguments

NameTypeIntentAttributesDescription
orderinteger(kind=I4P)in
x_preal(kind=R8P)in
x_creal(kind=R8P)in
i_pinteger(kind=I4P)in
i_mininteger(kind=I4P)out
i_maxinteger(kind=I4P)out

Call graph

Functions

bspline_weight_dev

Return the centered cardinal B-spline weight.

Attributes: pure

Returns: real(kind=R8P)

fortran
function bspline_weight_dev(order, r) result(weight)

Arguments

NameTypeIntentAttributesDescription
orderinteger(kind=I4P)in
rreal(kind=R8P)in

Call graph