Appearance
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
- prism_pic_object
- particle_weighting_interface
- current_weighting_interface
- field_weighting_interface
- initialize
- load_from_file
- particle_cartesian_grid_index
- NGP_charge_weighting
- CIC_charge_weighting
- TSC_charge_weighting
- cubic_charge_weighting
- quartic_charge_weighting
- quintic_charge_weighting
- Gaussian_charge_weighting
- NGP_current_weighting
- CIC_current_weighting
- TSC_current_weighting
- cubic_current_weighting
- quartic_current_weighting
- quintic_current_weighting
- Gaussian_current_weighting
- zeroD_field_weighting
- oneD_field_weighting
- twoD_field_weighting
- threeD_field_weighting
- fourD_field_weighting
- fiveD_field_weighting
- Gaussian_field_weighting
- bspline_field_weighting
- set_bspline_stencil
- description
- bspline_weight
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
INI_SECTION_NAME | character(len=3) | parameter | INI file section name for PIC configuration. |
PLASMA_TYPE_PROBLEM | character(len=6) | parameter | Analyzing physical problem involving the presence of plasma |
STANDARD_INITIALIZATION | character(len=8) | parameter | Field initialization through elliptic solver wuth standard laplacian scheme (7-points) |
COHERENT_INITIALIZATION | character(len=8) | parameter | Field initialization through elliptic solver wuth laplacian scheme coherent with centerd difference scheme (implemented only for 6th order) |
NEUMANN_BC | character(len=7) | parameter | Neumann boundary condition |
DIRICHLET_BC | character(len=9) | parameter | Dirichlet boundary condition |
ANALYTIC_BC | character(len=5) | parameter | Analytic boundary condition |
SINGLE_PARTICLE_TYPE_PROBLEM | character(len=15) | parameter | Analyzing physical problem involving the presence of a single particle |
NGP_WEIGHTING_MODEL | character(len=3) | parameter | NGP weighting model. |
CIC_WEIGHTING_MODEL | character(len=3) | parameter | CIC weighting model. |
TSC_WEIGHTING_MODEL | character(len=3) | parameter | TSC weighting model. |
CUBIC_WEIGHTING_MODEL | character(len=5) | parameter | cubic order weighting model. |
QUARTIC_WEIGHTING_MODEL | character(len=7) | parameter | quartic order weighting model. |
QUINTIC_WEIGHTING_MODEL | character(len=7) | parameter | quintic order weighting model. |
GAUSSIAN_WEIGHTING_MODEL | character(len=8) | parameter | Gaussian weighting model. |
ZEROD_FIELDS_WEIGHTING_MODEL | character(len=2) | parameter | 0D field weighting. |
ONED_FIELDS_WEIGHTING_MODEL | character(len=2) | parameter | 1D field weighting. |
TWOD_FIELDS_WEIGHTING_MODEL | character(len=2) | parameter | 2D field weighting. |
THREED_FIELDS_WEIGHTING_MODEL | character(len=2) | parameter | 3D field weighting. |
FOURD_FIELDS_WEIGHTING_MODEL | character(len=2) | parameter | 4D field weighting. |
FIVED_FIELDS_WEIGHTING_MODEL | character(len=2) | parameter | 5D field weighting. |
NUM_SCHEME_TIME_PIC_LEAPFROG | character(len=8) | parameter | Leapfrog numerical scheme for time operator. |
NUM_SCHEME_TIME_PIC_RUNGE_KUTTA | character(len=11) | parameter | Runge-Kutta numerical scheme for time operator. |
UNIFORM_DOMAIN | character(len=14) | parameter | |
UNIFORM_CILINDER | character(len=16) | parameter | |
UNIFORM_CELL | character(len=12) | parameter |
Derived Types
prism_pic_object
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
plasma_density | real(kind=R8P) | Plasma density | |
neutral_fraction | real(kind=R8P) | Neutral fraction | |
cilinder_length | real(kind=R8P) | ||
cilinder_radius | real(kind=R8P) | ||
cilinder_center | real(kind=R8P) | ||
cilinder_axis | character(len=1) | ||
sigma | real(kind=R8P) | Standard deviation for a gaussian weighting | |
cutoff_sigma | real(kind=R8P) | Gaussian cutoff. | |
particle_number | integer(kind=I4P) | Total number of particles. | |
n_ions | integer(kind=I4P) | Total ions number | |
n_electrons | integer(kind=I4P) | Total electrons number | |
n_neutrals | integer(kind=I4P) | Total neutrals number | |
neighbour_list | integer(kind=I4P) | allocatable | Particle grid positions array. |
problem_type | character(len=99) | Type of problem analyzed | |
plasma_domain | character(len=99) | Domain of plasma at t0 | |
initialization | character(len=99) | field initialization solver | |
bc_solver | character(len=99) | boundary conditions for the elliptic solver for initial conditions | |
elliptic_correction | logical | elliptic correction for the initial fields | |
bc_correction | character(len=99) | boundary conditions for the elliptic correction | |
particle_weighting_model | character(len=99) | Particle weighting model. | |
current_weighting_model | character(len=99) | Current weighting model. | |
field_weighting_model | character(len=99) | Field weighting model. | |
scheme_time | character(len=99) | Numerical scheme for time operator [runge_kutta, leapfrog,...]. | |
particle_weighting | procedure(particle_weighting_interface) | pass(self), pointer | Particle weighting. |
current_weighting | procedure(current_weighting_interface) | pass(self), pointer | Current weighting. |
field_weighting | procedure(field_weighting_interface) | pass(self), pointer | field weighting. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
description | pass(self) | Return pretty-printed object description. |
initialize | pass(self) | Initialize IC. |
load_from_file | pass(self) | Load config from file. |
particle_cartesian_grid_index | pass(self) | Compute the grid index corresponding to a particle position. |
CIC_charge_weighting | pass(self) | Cloud-in-Cell weighting of particle quantities to the grid. |
NGP_charge_weighting | pass(self) | Nearest Grid Point weighting of particle quantities to the grid. |
TSC_charge_weighting | pass(self) | Triangular Shaped Cloud weighting of particle quantities to the grid. |
cubic_charge_weighting | pass(self) | 3rd order weighting of particle quantities to the grid. |
quartic_charge_weighting | pass(self) | 4th order weighting of particle quantities to the grid. |
quintic_charge_weighting | pass(self) | 5th order weighting of particle quantities to the grid. |
Gaussian_charge_weighting | pass(self) | Gaussian Shaped Cloud weighting of particle quantities to the grid. |
CIC_current_weighting | pass(self) | Cloud-in-Cell weighting of particle quantities to the grid. |
NGP_current_weighting | pass(self) | Nearest Grid Point weighting of particle quantities to the grid. |
TSC_current_weighting | pass(self) | Triangular Shaped Cloud weighting of particle quantities to the grid. |
Gaussian_current_weighting | pass(self) | Gaussian Shaped Cloud weighting of particle quantities to the grid. |
zeroD_field_weighting | pass(self) | |
oneD_field_weighting | pass(self) | |
twoD_field_weighting | pass(self) | |
threeD_field_weighting | pass(self) | |
fourD_field_weighting | pass(self) | |
fiveD_field_weighting | pass(self) | |
Gaussian_field_weighting | pass(self) | |
bspline_field_weighting | pass(self) |
Interfaces
particle_weighting_interface
current_weighting_interface
field_weighting_interface
Subroutines
initialize
Initialize PIC.
fortran
subroutine initialize(self, field, grid, file_parameters)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | Pic object. | |
field | type(field_object) | in | Field (sibling realm component, threaded in). | |
grid | type(grid_object) | in | Grid (sibling realm component, threaded in). | |
file_parameters | type(file_ini) | in | Simulation 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | PIC object. | |
file_parameters | type(file_ini) | in | File handler. | |
go_on_fail | logical | in | optional | Go 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | External fields. | |
field | type(field_object) | in | The field. | |
grid | type(grid_object) | in | Grid (sibling realm component, threaded in) | |
q_pic | real(kind=R8P) | in | PIC variables. |
Call graph
NGP_charge_weighting
fortran
subroutine NGP_charge_weighting(self, field, grid, q, q_pic, nv)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | External fields. | |
field | type(field_object) | inout | The field. | |
grid | type(grid_object) | in | Grid (sibling realm component, threaded in). | |
q | real(kind=R8P) | inout | Field variables. | |
q_pic | real(kind=R8P) | in | PIC variables. | |
nv | integer(kind=I4P) | in | Number 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | External fields. | |
field | type(field_object) | inout | The field. | |
grid | type(grid_object) | in | Grid (sibling realm component, threaded in). | |
q | real(kind=R8P) | inout | Field variables. | |
q_PIC | real(kind=R8P) | in | PIC variables. | |
nv | integer(kind=I4P) | in | Number of variables. |
TSC_charge_weighting
fortran
subroutine TSC_charge_weighting(self, field, grid, q, q_pic, nv)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | External fields. | |
field | type(field_object) | inout | The field. | |
grid | type(grid_object) | in | Grid (sibling realm component, threaded in). | |
q | real(kind=R8P) | inout | Field variables. | |
q_pic | real(kind=R8P) | in | PIC variables. | |
nv | integer(kind=I4P) | in | Number of variables. |
cubic_charge_weighting
fortran
subroutine cubic_charge_weighting(self, field, grid, q, q_pic, nv)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | PIC object. | |
field | type(field_object) | inout | The field. | |
grid | type(grid_object) | in | Grid (sibling realm component, threaded in). | |
q | real(kind=R8P) | inout | Field variables. | |
q_pic | real(kind=R8P) | in | PIC variables. | |
nv | integer(kind=I4P) | in | Charge variable index. |
quartic_charge_weighting
fortran
subroutine quartic_charge_weighting(self, field, grid, q, q_pic, nv)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | PIC object. | |
field | type(field_object) | inout | The field. | |
grid | type(grid_object) | in | Grid (sibling realm component, threaded in). | |
q | real(kind=R8P) | inout | Field variables. | |
q_pic | real(kind=R8P) | in | PIC variables. | |
nv | integer(kind=I4P) | in | Charge variable index. |
quintic_charge_weighting
fortran
subroutine quintic_charge_weighting(self, field, grid, q, q_pic, nv)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | PIC object. | |
field | type(field_object) | inout | The field. | |
grid | type(grid_object) | in | Grid (sibling realm component, threaded in). | |
q | real(kind=R8P) | inout | Field variables. | |
q_pic | real(kind=R8P) | in | PIC variables. | |
nv | integer(kind=I4P) | in | Charge 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | PIC object. | |
field | type(field_object) | inout | The field. | |
grid | type(grid_object) | in | Grid object. | |
q | real(kind=R8P) | inout | Field variables. | |
q_PIC | real(kind=R8P) | in | PIC variables. | |
nv | integer(kind=I4P) | in | Charge-density variable index. |
NGP_current_weighting
fortran
subroutine NGP_current_weighting(self, field, grid, q, q_pic, nv)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | External fields. | |
field | type(field_object) | inout | The field. | |
grid | type(grid_object) | in | Grid (sibling realm component, threaded in). | |
q | real(kind=R8P) | inout | Field variables. | |
q_pic | real(kind=R8P) | in | PIC variables. | |
nv | integer(kind=I4P) | in | Number 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | External fields. | |
field | type(field_object) | inout | The field. | |
grid | type(grid_object) | in | Grid (sibling realm component, threaded in). | |
q | real(kind=R8P) | inout | Field variables. | |
q_pic | real(kind=R8P) | in | PIC variables. | |
nv | integer(kind=I4P) | in | Number 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | External fields. | |
field | type(field_object) | inout | The field. | |
grid | type(grid_object) | in | Grid (sibling realm component, threaded in). | |
q | real(kind=R8P) | inout | Field variables. | |
q_pic | real(kind=R8P) | in | PIC variables. | |
nv | integer(kind=I4P) | in | Number 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | External fields. | |
field | type(field_object) | inout | The field. | |
grid | type(grid_object) | in | Grid (sibling realm component, threaded in). | |
q | real(kind=R8P) | inout | Field variables. | |
q_pic | real(kind=R8P) | in | PIC variables. | |
nv | integer(kind=I4P) | in | Number 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | External fields. | |
field | type(field_object) | inout | The field. | |
grid | type(grid_object) | in | Grid (sibling realm component, threaded in). | |
q | real(kind=R8P) | inout | Field variables. | |
q_pic | real(kind=R8P) | in | PIC variables. | |
nv | integer(kind=I4P) | in | Number 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | External fields. | |
field | type(field_object) | inout | The field. | |
grid | type(grid_object) | in | Grid (sibling realm component, threaded in). | |
q | real(kind=R8P) | inout | Field variables. | |
q_pic | real(kind=R8P) | in | PIC variables. | |
nv | integer(kind=I4P) | in | Number 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | PIC object. | |
field | type(field_object) | inout | The field. | |
grid | type(grid_object) | in | Grid object. | |
q | real(kind=R8P) | inout | Field variables. | |
q_PIC | real(kind=R8P) | in | PIC variables. | |
nv | integer(kind=I4P) | in | Index 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | ||
field | type(field_object) | inout | ||
grid | type(grid_object) | in | ||
pic_fields | real(kind=R8P) | inout | ||
q | real(kind=R8P) | in | ||
q_pic | real(kind=R8P) | in | ||
nv | integer(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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | ||
field | type(field_object) | inout | ||
grid | type(grid_object) | in | ||
pic_fields | real(kind=R8P) | inout | ||
q | real(kind=R8P) | in | ||
q_pic | real(kind=R8P) | in | ||
nv | integer(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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | ||
field | type(field_object) | inout | ||
grid | type(grid_object) | in | ||
pic_fields | real(kind=R8P) | inout | ||
q | real(kind=R8P) | in | ||
q_pic | real(kind=R8P) | in | ||
nv | integer(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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | ||
field | type(field_object) | inout | ||
grid | type(grid_object) | in | ||
pic_fields | real(kind=R8P) | inout | ||
q | real(kind=R8P) | in | ||
q_pic | real(kind=R8P) | in | ||
nv | integer(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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | ||
field | type(field_object) | inout | ||
grid | type(grid_object) | in | ||
pic_fields | real(kind=R8P) | inout | ||
q | real(kind=R8P) | in | ||
q_pic | real(kind=R8P) | in | ||
nv | integer(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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | ||
field | type(field_object) | inout | ||
grid | type(grid_object) | in | ||
pic_fields | real(kind=R8P) | inout | ||
q | real(kind=R8P) | in | ||
q_pic | real(kind=R8P) | in | ||
nv | integer(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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | PIC object. | |
field | type(field_object) | inout | The field. | |
grid | type(grid_object) | in | Grid object. | |
pic_fields | real(kind=R8P) | inout | Fields at particle locations. | |
q | real(kind=R8P) | in | Field variables. | |
q_PIC | real(kind=R8P) | in | PIC variables. | |
nv | integer(kind=I4P) | in | Number 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | inout | ||
field | type(field_object) | inout | ||
grid | type(grid_object) | in | ||
pic_fields | real(kind=R8P) | inout | ||
q | real(kind=R8P) | in | ||
q_pic | real(kind=R8P) | in | ||
nv | integer(kind=I4P) | in | ||
order | integer(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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
order | integer(kind=I4P) | in | ||
x_p | real(kind=R8P) | in | ||
x_c | real(kind=R8P) | in | ||
i_p | integer(kind=I4P) | in | ||
i_min | integer(kind=I4P) | out | ||
i_max | integer(kind=I4P) | out |
Call graph
Functions
description
Return a pretty-formatted object description.
Returns: character(len=:)
fortran
function description(self) result(desc)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_pic_object) | in | External 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
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
order | integer(kind=I4P) | in | ||
r | real(kind=R8P) | in |
Call graph