Skip to content

adam_prism_pic_object

ADAM, PRISM Particle-in-Cell class definition, CPU backend.

Source: src/app/prism/common/adam_prism_pic_object.F90

Dependencies

Contents

Variables

NameTypeAttributesDescription
INI_SECTION_NAMEcharacter(len=3)parameterINI file section name for PIC configuration.
PLASMA_TYPE_PROBLEMcharacter(len=6)parameterAnalyzing physical problem involving the presence of plasma
STANDARD_INITIALIZATIONcharacter(len=8)parameterField initialization through elliptic solver wuth standard laplacian scheme (7-points)
COHERENT_INITIALIZATIONcharacter(len=8)parameterField initialization through elliptic solver wuth laplacian scheme coherent with centerd difference scheme (implemented only for 6th order)
NEUMANN_BCcharacter(len=7)parameterNeumann boundary condition
DIRICHLET_BCcharacter(len=9)parameterDirichlet boundary condition
ANALYTIC_BCcharacter(len=5)parameterAnalytic boundary condition
SINGLE_PARTICLE_TYPE_PROBLEMcharacter(len=15)parameterAnalyzing physical problem involving the presence of a single particle
NGP_WEIGHTING_MODELcharacter(len=3)parameterNGP weighting model.
CIC_WEIGHTING_MODELcharacter(len=3)parameterCIC weighting model.
TSC_WEIGHTING_MODELcharacter(len=3)parameterTSC weighting model.
CUBIC_WEIGHTING_MODELcharacter(len=5)parametercubic order weighting model.
QUARTIC_WEIGHTING_MODELcharacter(len=7)parameterquartic order weighting model.
QUINTIC_WEIGHTING_MODELcharacter(len=7)parameterquintic order weighting model.
GAUSSIAN_WEIGHTING_MODELcharacter(len=8)parameterGaussian weighting model.
ZEROD_FIELDS_WEIGHTING_MODELcharacter(len=2)parameter0D field weighting.
ONED_FIELDS_WEIGHTING_MODELcharacter(len=2)parameter1D field weighting.
TWOD_FIELDS_WEIGHTING_MODELcharacter(len=2)parameter2D field weighting.
THREED_FIELDS_WEIGHTING_MODELcharacter(len=2)parameter3D field weighting.
FOURD_FIELDS_WEIGHTING_MODELcharacter(len=2)parameter4D field weighting.
FIVED_FIELDS_WEIGHTING_MODELcharacter(len=2)parameter5D field weighting.
NUM_SCHEME_TIME_PIC_LEAPFROGcharacter(len=8)parameterLeapfrog numerical scheme for time operator.
NUM_SCHEME_TIME_PIC_RUNGE_KUTTAcharacter(len=11)parameterRunge-Kutta numerical scheme for time operator.
UNIFORM_DOMAINcharacter(len=14)parameter
UNIFORM_CILINDERcharacter(len=16)parameter
UNIFORM_CELLcharacter(len=12)parameter

Derived Types

prism_pic_object

Components

NameTypeAttributesDescription
plasma_densityreal(kind=R8P)Plasma density
neutral_fractionreal(kind=R8P)Neutral fraction
cilinder_lengthreal(kind=R8P)
cilinder_radiusreal(kind=R8P)
cilinder_centerreal(kind=R8P)
cilinder_axischaracter(len=1)
sigmareal(kind=R8P)Standard deviation for a gaussian weighting
cutoff_sigmareal(kind=R8P)Gaussian cutoff.
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
neighbour_listinteger(kind=I4P)allocatableParticle grid positions array.
problem_typecharacter(len=99)Type of problem analyzed
plasma_domaincharacter(len=99)Domain of plasma at t0
initializationcharacter(len=99)field initialization solver
bc_solvercharacter(len=99)boundary conditions for the elliptic solver for initial conditions
elliptic_correctionlogicalelliptic correction for the initial fields
bc_correctioncharacter(len=99)boundary conditions for the elliptic correction
particle_weighting_modelcharacter(len=99)Particle weighting model.
current_weighting_modelcharacter(len=99)Current weighting model.
field_weighting_modelcharacter(len=99)Field weighting model.
scheme_timecharacter(len=99)Numerical scheme for time operator [runge_kutta, leapfrog,...].
particle_weightingprocedure(particle_weighting_interface)pass(self), pointerParticle weighting.
current_weightingprocedure(current_weighting_interface)pass(self), pointerCurrent weighting.
field_weightingprocedure(field_weighting_interface)pass(self), pointerfield weighting.

Type-Bound Procedures

NameAttributesDescription
descriptionpass(self)Return pretty-printed object description.
initializepass(self)Initialize IC.
load_from_filepass(self)Load config from file.
particle_cartesian_grid_indexpass(self)Compute the grid index corresponding to a particle position.
CIC_charge_weightingpass(self)Cloud-in-Cell weighting of particle quantities to the grid.
NGP_charge_weightingpass(self)Nearest Grid Point weighting of particle quantities to the grid.
TSC_charge_weightingpass(self)Triangular Shaped Cloud weighting of particle quantities to the grid.
cubic_charge_weightingpass(self)3rd order weighting of particle quantities to the grid.
quartic_charge_weightingpass(self)4th order weighting of particle quantities to the grid.
quintic_charge_weightingpass(self)5th order weighting of particle quantities to the grid.
Gaussian_charge_weightingpass(self)Gaussian Shaped Cloud weighting of particle quantities to the grid.
CIC_current_weightingpass(self)Cloud-in-Cell weighting of particle quantities to the grid.
NGP_current_weightingpass(self)Nearest Grid Point weighting of particle quantities to the grid.
TSC_current_weightingpass(self)Triangular Shaped Cloud weighting of particle quantities to the grid.
Gaussian_current_weightingpass(self)Gaussian Shaped Cloud weighting of particle quantities to the grid.
zeroD_field_weightingpass(self)
oneD_field_weightingpass(self)
twoD_field_weightingpass(self)
threeD_field_weightingpass(self)
fourD_field_weightingpass(self)
fiveD_field_weightingpass(self)
Gaussian_field_weightingpass(self)
bspline_field_weightingpass(self)

Interfaces

particle_weighting_interface

current_weighting_interface

field_weighting_interface

Subroutines

initialize

Initialize PIC.

fortran
subroutine initialize(self, field, grid, file_parameters)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutPic object.
fieldtype(field_object)inField (sibling realm component, threaded in).
gridtype(grid_object)inGrid (sibling realm component, threaded in).
file_parameterstype(file_ini)inSimulation parameters ini file handler.

Call graph

load_from_file

Load PIC configuration from file.

fortran
subroutine load_from_file(self, file_parameters, go_on_fail)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutPIC object.
file_parameterstype(file_ini)inFile handler.
go_on_faillogicalinoptionalGo on if load fails.

Call graph

particle_cartesian_grid_index

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

fortran
subroutine particle_cartesian_grid_index(self, field, grid, q_pic)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutExternal fields.
fieldtype(field_object)inThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in)
q_picreal(kind=R8P)inPIC variables.

Call graph

NGP_charge_weighting

fortran
subroutine NGP_charge_weighting(self, field, grid, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutExternal fields.
fieldtype(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
qreal(kind=R8P)inoutField variables.
q_picreal(kind=R8P)inPIC variables.
nvinteger(kind=I4P)inNumber of variables.

CIC_charge_weighting

Cloud-in-Cell weighting of particle quantities to the grid.

fortran
subroutine CIC_charge_weighting(self, field, grid, q, q_PIC, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutExternal fields.
fieldtype(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
qreal(kind=R8P)inoutField variables.
q_PICreal(kind=R8P)inPIC variables.
nvinteger(kind=I4P)inNumber of variables.

TSC_charge_weighting

fortran
subroutine TSC_charge_weighting(self, field, grid, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutExternal fields.
fieldtype(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
qreal(kind=R8P)inoutField variables.
q_picreal(kind=R8P)inPIC variables.
nvinteger(kind=I4P)inNumber of variables.

cubic_charge_weighting

fortran
subroutine cubic_charge_weighting(self, field, grid, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutPIC object.
fieldtype(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
qreal(kind=R8P)inoutField variables.
q_picreal(kind=R8P)inPIC variables.
nvinteger(kind=I4P)inCharge variable index.

quartic_charge_weighting

fortran
subroutine quartic_charge_weighting(self, field, grid, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutPIC object.
fieldtype(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
qreal(kind=R8P)inoutField variables.
q_picreal(kind=R8P)inPIC variables.
nvinteger(kind=I4P)inCharge variable index.

quintic_charge_weighting

fortran
subroutine quintic_charge_weighting(self, field, grid, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutPIC object.
fieldtype(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
qreal(kind=R8P)inoutField variables.
q_picreal(kind=R8P)inPIC variables.
nvinteger(kind=I4P)inCharge variable index.

Gaussian_charge_weighting

Gaussian weighting of particle charge density to the grid.

fortran
subroutine Gaussian_charge_weighting(self, field, grid, q, q_PIC, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutPIC object.
fieldtype(field_object)inoutThe field.
gridtype(grid_object)inGrid object.
qreal(kind=R8P)inoutField variables.
q_PICreal(kind=R8P)inPIC variables.
nvinteger(kind=I4P)inCharge-density variable index.

NGP_current_weighting

fortran
subroutine NGP_current_weighting(self, field, grid, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutExternal fields.
fieldtype(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
qreal(kind=R8P)inoutField variables.
q_picreal(kind=R8P)inPIC variables.
nvinteger(kind=I4P)inNumber of variables.

CIC_current_weighting

Cloud-in-Cell weighting of particle quantities to the grid.

fortran
subroutine CIC_current_weighting(self, field, grid, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutExternal fields.
fieldtype(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
qreal(kind=R8P)inoutField variables.
q_picreal(kind=R8P)inPIC variables.
nvinteger(kind=I4P)inNumber of variables.

TSC_current_weighting

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

fortran
subroutine TSC_current_weighting(self, field, grid, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutExternal fields.
fieldtype(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
qreal(kind=R8P)inoutField variables.
q_picreal(kind=R8P)inPIC variables.
nvinteger(kind=I4P)inNumber of variables.

cubic_current_weighting

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

fortran
subroutine cubic_current_weighting(self, field, grid, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutExternal fields.
fieldtype(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
qreal(kind=R8P)inoutField variables.
q_picreal(kind=R8P)inPIC variables.
nvinteger(kind=I4P)inNumber of variables.

quartic_current_weighting

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

fortran
subroutine quartic_current_weighting(self, field, grid, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutExternal fields.
fieldtype(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
qreal(kind=R8P)inoutField variables.
q_picreal(kind=R8P)inPIC variables.
nvinteger(kind=I4P)inNumber of variables.

quintic_current_weighting

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

fortran
subroutine quintic_current_weighting(self, field, grid, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutExternal fields.
fieldtype(field_object)inoutThe field.
gridtype(grid_object)inGrid (sibling realm component, threaded in).
qreal(kind=R8P)inoutField variables.
q_picreal(kind=R8P)inPIC variables.
nvinteger(kind=I4P)inNumber of variables.

Gaussian_current_weighting

Gaussian weighting of particle current density to the grid.

fortran
subroutine Gaussian_current_weighting(self, field, grid, q, q_PIC, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutPIC object.
fieldtype(field_object)inoutThe field.
gridtype(grid_object)inGrid object.
qreal(kind=R8P)inoutField variables.
q_PICreal(kind=R8P)inPIC variables.
nvinteger(kind=I4P)inIndex following Jx, Jy, Jz.

zeroD_field_weighting

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

fortran
subroutine zeroD_field_weighting(self, field, grid, pic_fields, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inout
fieldtype(field_object)inout
gridtype(grid_object)in
pic_fieldsreal(kind=R8P)inout
qreal(kind=R8P)in
q_picreal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

oneD_field_weighting

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

fortran
subroutine oneD_field_weighting(self, field, grid, pic_fields, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inout
fieldtype(field_object)inout
gridtype(grid_object)in
pic_fieldsreal(kind=R8P)inout
qreal(kind=R8P)in
q_picreal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

twoD_field_weighting

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

fortran
subroutine twoD_field_weighting(self, field, grid, pic_fields, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inout
fieldtype(field_object)inout
gridtype(grid_object)in
pic_fieldsreal(kind=R8P)inout
qreal(kind=R8P)in
q_picreal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

threeD_field_weighting

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

fortran
subroutine threeD_field_weighting(self, field, grid, pic_fields, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inout
fieldtype(field_object)inout
gridtype(grid_object)in
pic_fieldsreal(kind=R8P)inout
qreal(kind=R8P)in
q_picreal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

fourD_field_weighting

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

fortran
subroutine fourD_field_weighting(self, field, grid, pic_fields, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inout
fieldtype(field_object)inout
gridtype(grid_object)in
pic_fieldsreal(kind=R8P)inout
qreal(kind=R8P)in
q_picreal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

fiveD_field_weighting

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

fortran
subroutine fiveD_field_weighting(self, field, grid, pic_fields, q, q_pic, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inout
fieldtype(field_object)inout
gridtype(grid_object)in
pic_fieldsreal(kind=R8P)inout
qreal(kind=R8P)in
q_picreal(kind=R8P)in
nvinteger(kind=I4P)in

Call graph

Gaussian_field_weighting

Gaussian interpolation of cell-centered fields to particle locations.

fortran
subroutine Gaussian_field_weighting(self, field, grid, pic_fields, q, q_PIC, nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inoutPIC object.
fieldtype(field_object)inoutThe field.
gridtype(grid_object)inGrid object.
pic_fieldsreal(kind=R8P)inoutFields at particle locations.
qreal(kind=R8P)inField variables.
q_PICreal(kind=R8P)inPIC variables.
nvinteger(kind=I4P)inNumber of variables.

bspline_field_weighting

B-spline interpolation of cell-centered fields to particle locations.

fortran
subroutine bspline_field_weighting(self, field, grid, pic_fields, q, q_pic, nv, order)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inout
fieldtype(field_object)inout
gridtype(grid_object)in
pic_fieldsreal(kind=R8P)inout
qreal(kind=R8P)in
q_picreal(kind=R8P)in
nvinteger(kind=I4P)in
orderinteger(kind=I4P)in

Call graph

set_bspline_stencil

Compute the one-dimensional B-spline stencil.

Attributes: pure

fortran
subroutine set_bspline_stencil(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

description

Return a pretty-formatted object description.

Returns: character(len=:)

fortran
function description(self) result(desc)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_pic_object)inExternal fields.

Call graph

bspline_weight

Return the centered cardinal B-spline weight.

Attributes: pure

Returns: real(kind=R8P)

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

Arguments

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

Call graph