Appearance
adam_prism_coil_object
ADAM, PRISM coil source definition, CPU backend.
Source: src/app/prism/common/adam_prism_coil_object.F90
Dependencies
Contents
- prism_coil_object
- allocate_coil
- initialize
- load_coils_number
- load_from_file
- adimensionalize_coils_parameters
- build_support
- invalidate_support
- record_overlap
- detect_plasma
- capture_plasma
- restore_plasma
- support_cells
- description
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
INI_SECTION_NAME | character(len=11) | parameter | INI (config) file section name containing coils configs. |
COIL_TYPE_RECTANGULAR | character(len=11) | parameter | Rectangular shape coil. |
COIL_TYPE_CIRCULAR | character(len=8) | parameter | Circular shape coil. |
COIL_TYPE_SOLENOID | character(len=8) | parameter | Solenoid shape coil. |
COIL_TYPE_HELICON | character(len=8) | parameter | Helicon shape coil. |
CURRENT_TYPE_DC | character(len=10) | parameter | DC current. |
CURRENT_TYPE_AC | character(len=10) | parameter | AC current |
NORMAL_P_X | character(len=2) | parameter | Normal versor along positive x axis. |
NORMAL_M_X | character(len=2) | parameter | Normal versor along negative x axis. |
NORMAL_P_Y | character(len=2) | parameter | Normal versor along positive y axis. |
NORMAL_M_Y | character(len=2) | parameter | Normal versor along negative y axis. |
NORMAL_P_Z | character(len=2) | parameter | Normal versor along positive z axis. |
NORMAL_M_Z | character(len=2) | parameter | Normal versor along negative z axis. |
COIL_SLOT_COMMITTED | integer(kind=I4P) | parameter | Plasma-current slot of the committed state q. |
COIL_SLOT_STAGE | integer(kind=I4P) | parameter | Plasma-current slot of the stage state. |
Derived Types
prism_coil_object
ADAM, PRISM coil source definition, CPU backend.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
coil_type | character(len=99) | allocatable | Coil type. |
current_type | character(len=99) | allocatable | Current type. |
normal | character(len=2) | allocatable | Versore normale alla spira, che identifica anche verso |
A | real(kind=R8P) | allocatable | Current amplitude (A) |
coil_amplitude | real(kind=R8P) | allocatable | Current amplitude (A) for each coil, corrected for Gaussian current distribution. |
f | real(kind=R8P) | allocatable | Current frequency, if AC (Hz) |
phase | real(kind=R8P) | allocatable | Current initial phase, if AC |
x_center | real(kind=R8P) | allocatable | Coil center |
y_center | real(kind=R8P) | allocatable | Coil center |
z_center | real(kind=R8P) | allocatable | Coil center |
lx | real(kind=R8P) | allocatable | Rectangle's sizes (if rectangular coil) |
ly | real(kind=R8P) | allocatable | Rectangle's sizes (if rectangular coil) |
r_coil | real(kind=R8P) | allocatable | Circle's radius (if circular coil) |
l_solenoid | real(kind=R8P) | allocatable | Solenoid length (if solenoidal coil) |
windings | real(kind=R8P) | allocatable | Windings number (if solenoidal coil) |
N_points | integer(kind=I4P) | allocatable | Number of points for coil representation (for helicon coil setting) |
x_points | real(kind=R8P) | allocatable | Coil points coordinates (for helicon coil setting) |
y_points | real(kind=R8P) | allocatable | Coil points coordinates (for helicon coil setting) |
z_points | real(kind=R8P) | allocatable | Coil points coordinates (for helicon coil setting) |
rectangular_current_flux | real(kind=R8P) | allocatable | Per-side unit-current flux for rectangular coils. |
helicon_current_flux | real(kind=R8P) | allocatable | Per-segment unit-current flux for helicon coils. |
sigma | real(kind=R8P) | allocatable | Gaussian current distribution sigma |
J_vec | real(kind=R8P) | allocatable | Matrice contenente versori corrente spire (se assente |
td | real(kind=R8P) | Delay di accensione della spira | |
circular_coils_number | integer(kind=I4P) | Number of circular coils | |
rectangular_coils_number | integer(kind=I4P) | Number of rectangular coils | |
solenoid_coils_number | integer(kind=I4P) | Number of solenoid coils | |
helicon_coils_number | integer(kind=I4P) | Number of helicon coils | |
total_coils_number | integer(kind=I4P) | Number of coils | |
j_vec_name | type(string) | allocatable | J vec names. |
support | integer(kind=I4P) | allocatable | Cells (b,i,j,k) with J_vec /= 0: interior first, then ghost. |
support_interior | integer(kind=I4P) | Number of interior support cells. | |
support_valid | logical | Support built from the current J_vec. | |
plasma_j | real(kind=R8P) | allocatable | Plasma current on the support (3,n,slot). |
plasma_j_active | logical | Slot holds a plasma current. | |
overlap_first_it | integer(kind=I4P) | First iteration with plasma on coil cells. | |
overlap_last_it | integer(kind=I4P) | Last iteration with plasma on coil cells. | |
overlap_first_context | character(len=99) | Call site of the first overlap. | |
ngc | integer(kind=I4P) | pointer | Number of ghost cells. |
ni | integer(kind=I4P) | pointer | Number of cells in i direction. |
nj | integer(kind=I4P) | pointer | Number of cells in j direction. |
nk | integer(kind=I4P) | pointer | Number of cells in k direction. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
allocate_coil | pass(self) | Allocate coil data. |
description | pass(self) | Return pretty-printed object description. |
initialize | pass(self) | Initialize IC. |
load_coils_number | pass(self) | Load coils number from file. |
load_from_file | pass(self) | Load config from file. |
adimensionalize_coils_parameters | pass(self) | Adimensionalize coils parameters. |
build_support | pass(self) | Build the coil support and its plasma slots. |
invalidate_support | pass(self) | Mark the support stale (J_vec recomputed). |
record_overlap | pass(self) | Record plasma deposited on coil cells. |
capture_plasma | pass(self) | Keep the plasma current of the coil support. |
detect_plasma | pass(self) | Plasma on the interior coil support. |
restore_plasma | pass(self) | Write the kept plasma current back. |
support_cells | pass(self) | Interior cells where J_vec /= 0. |
Subroutines
allocate_coil
Allocate coil data.
fortran
subroutine allocate_coil(self, field, grid)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_coil_object) | inout | Coils. | |
field | type(field_object) | in | Field (sibling realm component, threaded in). | |
grid | type(grid_object) | in | target | Grid (sibling realm component, threaded in). |
Call graph
initialize
Initialize the equation.
fortran
subroutine initialize(self, field, grid, physics, file_parameters)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_coil_object) | inout | Coils. | |
field | type(field_object) | in | Field (sibling realm component, threaded in). | |
grid | type(grid_object) | in | target | Grid (sibling realm component, threaded in). |
physics | type(prism_physics_object) | in | PRISM physics. | |
file_parameters | type(file_ini) | in | Simulation parameters ini file handler. |
Call graph
load_coils_number
Load the number of coils of each kind from file, and their total.
Separate from load_from_file because it needs no grid or field: the solver reads it before the blocks budget is computed, since the coils current density is a block-sized field per coil.
fortran
subroutine load_coils_number(self, file_parameters)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_coil_object) | inout | Coils. | |
file_parameters | type(file_ini) | in | Simulation parameters ini file handler. |
Call graph
load_from_file
Load config from file.
fortran
subroutine load_from_file(self, field, grid, physics, file_parameters)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_coil_object) | inout | coils. | |
field | type(field_object) | in | Field (sibling realm component, threaded in). | |
grid | type(grid_object) | in | target | Grid (sibling realm component, threaded in). |
physics | type(prism_physics_object) | in | PRISM physics. | |
file_parameters | type(file_ini) | in | Simulation parameters ini file handler. |
Call graph
adimensionalize_coils_parameters
Adimensionalize coils parameters.
fortran
subroutine adimensionalize_coils_parameters(self, physics)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_coil_object) | inout | Coils | |
physics | type(prism_physics_object) | in | PRISM physics. |
Call graph
build_support
Build the coil support from the current J_vec and (re)allocate its plasma slots, empty.
fortran
subroutine build_support(self, blocks_number)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_coil_object) | inout | Coils. | |
blocks_number | integer(kind=I4P) | in | Number of blocks in use. |
Call graph
invalidate_support
Mark the support stale: J_vec was recomputed (initialization, AMR), the support and the kept plasma current with it.
fortran
subroutine invalidate_support(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_coil_object) | inout | Coils. |
Call graph
record_overlap
Record that a PIC deposit put plasma on coil cells: a warning at the first time (repeated at the end of the run by prism_common_object%report_plasma_on_coils), the iteration range kept.
fortran
subroutine record_overlap(self, it, context)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_coil_object) | inout | Coils. | |
it | integer(kind=I4P) | in | Current iteration. | |
context | character(len=*) | in | Call site. |
Call graph
detect_plasma
Right after a PIC deposit into q: plasma current (and charge) on the interior cells of the coil support (the deposit owns them after its fold; the ghost ones may hold an earlier state). Local to this rank.
fortran
subroutine detect_plasma(self, q, var_jx, var_jy, var_jz, check_current, check_charge, blocks_number, overlap_current, overlap_charge)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_coil_object) | inout | Coils. | |
q | real(kind=R8P) | in | Deposited field. | |
var_jx | integer(kind=I4P) | in | Index of Jx. | |
var_jy | integer(kind=I4P) | in | Index of Jy. | |
var_jz | integer(kind=I4P) | in | Index of Jz. | |
check_current | logical | in | The J rows hold a fresh deposit. | |
check_charge | logical | in | The charge row holds a fresh deposit. | |
blocks_number | integer(kind=I4P) | in | Number of blocks in use. | |
overlap_current | logical | out | Plasma current on the support. | |
overlap_charge | logical | out | Plasma charge on the support. |
Call graph
capture_plasma
Keep the J rows of the support cells (interior and ghost, the ghosts refreshed by the caller) in slot, or empty the slot (no plasma current on the support: the stamp then works exactly as before).
fortran
subroutine capture_plasma(self, q, slot, var_jx, var_jy, var_jz, active)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_coil_object) | inout | Coils. | |
q | real(kind=R8P) | in | Deposited field. | |
slot | integer(kind=I4P) | in | COIL_SLOT_COMMITTED or COIL_SLOT_STAGE. | |
var_jx | integer(kind=I4P) | in | Index of Jx. | |
var_jy | integer(kind=I4P) | in | Index of Jy. | |
var_jz | integer(kind=I4P) | in | Index of Jz. | |
active | logical | in | Plasma current on the support (of some rank). |
Call graph
restore_plasma
Inside the coil stamp, after the support was cleared: write back the plasma current kept in slot (nothing when the slot is empty), the coil current is then added on top.
fortran
subroutine restore_plasma(self, q, slot, var_jx, var_jy, var_jz)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_coil_object) | in | Coils. | |
q | real(kind=R8P) | inout | Field. | |
slot | integer(kind=I4P) | in | COIL_SLOT_COMMITTED or COIL_SLOT_STAGE. | |
var_jx | integer(kind=I4P) | in | Index of Jx. | |
var_jy | integer(kind=I4P) | in | Index of Jy. | |
var_jz | integer(kind=I4P) | in | Index of Jz. |
Call graph
support_cells
Cells (b,i,j,k) where some coil has J_vec /= 0, the interior ones first and then the ghost ones, in a fixed order (the FNL twin pushes the same list).
fortran
subroutine support_cells(self, blocks_number, cells, interior)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_coil_object) | in | Coils. | |
blocks_number | integer(kind=I4P) | in | Number of blocks in use. | |
cells | integer(kind=I4P) | out | allocatable | Support cells (4,n). |
interior | integer(kind=I4P) | out | Number of interior support cells (the first ones). |
Call graph
Functions
description
Return a pretty-formatted object description.
Attributes: pure
Returns: character(len=:)
fortran
function description(self) result(desc)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(prism_coil_object) | in | IC. |
Call graph