Skip to content

adam_prism_coil_object ​

ADAM, PRISM coil source definition, CPU backend.

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

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
INI_SECTION_NAMEcharacter(len=11)parameterINI (config) file section name containing coils configs.
COIL_TYPE_RECTANGULARcharacter(len=11)parameterRectangular shape coil.
COIL_TYPE_CIRCULARcharacter(len=8)parameterCircular shape coil.
COIL_TYPE_SOLENOIDcharacter(len=8)parameterSolenoid shape coil.
COIL_TYPE_HELICONcharacter(len=8)parameterHelicon shape coil.
CURRENT_TYPE_DCcharacter(len=10)parameterDC current.
CURRENT_TYPE_ACcharacter(len=10)parameterAC current
NORMAL_P_Xcharacter(len=2)parameterNormal versor along positive x axis.
NORMAL_M_Xcharacter(len=2)parameterNormal versor along negative x axis.
NORMAL_P_Ycharacter(len=2)parameterNormal versor along positive y axis.
NORMAL_M_Ycharacter(len=2)parameterNormal versor along negative y axis.
NORMAL_P_Zcharacter(len=2)parameterNormal versor along positive z axis.
NORMAL_M_Zcharacter(len=2)parameterNormal versor along negative z axis.
COIL_SLOT_COMMITTEDinteger(kind=I4P)parameterPlasma-current slot of the committed state q.
COIL_SLOT_STAGEinteger(kind=I4P)parameterPlasma-current slot of the stage state.

Derived Types ​

prism_coil_object ​

ADAM, PRISM coil source definition, CPU backend.

Components

NameTypeAttributesDescription
coil_typecharacter(len=99)allocatableCoil type.
current_typecharacter(len=99)allocatableCurrent type.
normalcharacter(len=2)allocatableVersore normale alla spira, che identifica anche verso
Areal(kind=R8P)allocatableCurrent amplitude (A)
coil_amplitudereal(kind=R8P)allocatableCurrent amplitude (A) for each coil, corrected for Gaussian current distribution.
freal(kind=R8P)allocatableCurrent frequency, if AC (Hz)
phasereal(kind=R8P)allocatableCurrent initial phase, if AC
x_centerreal(kind=R8P)allocatableCoil center
y_centerreal(kind=R8P)allocatableCoil center
z_centerreal(kind=R8P)allocatableCoil center
lxreal(kind=R8P)allocatableRectangle's sizes (if rectangular coil)
lyreal(kind=R8P)allocatableRectangle's sizes (if rectangular coil)
r_coilreal(kind=R8P)allocatableCircle's radius (if circular coil)
l_solenoidreal(kind=R8P)allocatableSolenoid length (if solenoidal coil)
windingsreal(kind=R8P)allocatableWindings number (if solenoidal coil)
N_pointsinteger(kind=I4P)allocatableNumber of points for coil representation (for helicon coil setting)
x_pointsreal(kind=R8P)allocatableCoil points coordinates (for helicon coil setting)
y_pointsreal(kind=R8P)allocatableCoil points coordinates (for helicon coil setting)
z_pointsreal(kind=R8P)allocatableCoil points coordinates (for helicon coil setting)
rectangular_current_fluxreal(kind=R8P)allocatablePer-side unit-current flux for rectangular coils.
helicon_current_fluxreal(kind=R8P)allocatablePer-segment unit-current flux for helicon coils.
sigmareal(kind=R8P)allocatableGaussian current distribution sigma
J_vecreal(kind=R8P)allocatableMatrice contenente versori corrente spire (se assente
tdreal(kind=R8P)Delay di accensione della spira
circular_coils_numberinteger(kind=I4P)Number of circular coils
rectangular_coils_numberinteger(kind=I4P)Number of rectangular coils
solenoid_coils_numberinteger(kind=I4P)Number of solenoid coils
helicon_coils_numberinteger(kind=I4P)Number of helicon coils
total_coils_numberinteger(kind=I4P)Number of coils
j_vec_nametype(string)allocatableJ vec names.
supportinteger(kind=I4P)allocatableCells (b,i,j,k) with J_vec /= 0: interior first, then ghost.
support_interiorinteger(kind=I4P)Number of interior support cells.
support_validlogicalSupport built from the current J_vec.
plasma_jreal(kind=R8P)allocatablePlasma current on the support (3,n,slot).
plasma_j_activelogicalSlot holds a plasma current.
overlap_first_itinteger(kind=I4P)First iteration with plasma on coil cells.
overlap_last_itinteger(kind=I4P)Last iteration with plasma on coil cells.
overlap_first_contextcharacter(len=99)Call site of the first overlap.
ngcinteger(kind=I4P)pointerNumber of ghost cells.
niinteger(kind=I4P)pointerNumber of cells in i direction.
njinteger(kind=I4P)pointerNumber of cells in j direction.
nkinteger(kind=I4P)pointerNumber of cells in k direction.

Type-Bound Procedures

NameAttributesDescription
allocate_coilpass(self)Allocate coil data.
descriptionpass(self)Return pretty-printed object description.
initializepass(self)Initialize IC.
load_coils_numberpass(self)Load coils number from file.
load_from_filepass(self)Load config from file.
adimensionalize_coils_parameterspass(self)Adimensionalize coils parameters.
build_supportpass(self)Build the coil support and its plasma slots.
invalidate_supportpass(self)Mark the support stale (J_vec recomputed).
record_overlappass(self)Record plasma deposited on coil cells.
capture_plasmapass(self)Keep the plasma current of the coil support.
detect_plasmapass(self)Plasma on the interior coil support.
restore_plasmapass(self)Write the kept plasma current back.
support_cellspass(self)Interior cells where J_vec /= 0.

Subroutines ​

allocate_coil ​

Allocate coil data.

fortran
subroutine allocate_coil(self, field, grid)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_coil_object)inoutCoils.
fieldtype(field_object)inField (sibling realm component, threaded in).
gridtype(grid_object)intargetGrid (sibling realm component, threaded in).

Call graph

initialize ​

Initialize the equation.

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

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_coil_object)inoutCoils.
fieldtype(field_object)inField (sibling realm component, threaded in).
gridtype(grid_object)intargetGrid (sibling realm component, threaded in).
physicstype(prism_physics_object)inPRISM physics.
file_parameterstype(file_ini)inSimulation 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

NameTypeIntentAttributesDescription
selfclass(prism_coil_object)inoutCoils.
file_parameterstype(file_ini)inSimulation 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

NameTypeIntentAttributesDescription
selfclass(prism_coil_object)inoutcoils.
fieldtype(field_object)inField (sibling realm component, threaded in).
gridtype(grid_object)intargetGrid (sibling realm component, threaded in).
physicstype(prism_physics_object)inPRISM physics.
file_parameterstype(file_ini)inSimulation parameters ini file handler.

Call graph

adimensionalize_coils_parameters ​

Adimensionalize coils parameters.

fortran
subroutine adimensionalize_coils_parameters(self, physics)

Arguments

NameTypeIntentAttributesDescription
selfclass(prism_coil_object)inoutCoils
physicstype(prism_physics_object)inPRISM 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

NameTypeIntentAttributesDescription
selfclass(prism_coil_object)inoutCoils.
blocks_numberinteger(kind=I4P)inNumber 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

NameTypeIntentAttributesDescription
selfclass(prism_coil_object)inoutCoils.

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

NameTypeIntentAttributesDescription
selfclass(prism_coil_object)inoutCoils.
itinteger(kind=I4P)inCurrent iteration.
contextcharacter(len=*)inCall 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

NameTypeIntentAttributesDescription
selfclass(prism_coil_object)inoutCoils.
qreal(kind=R8P)inDeposited field.
var_jxinteger(kind=I4P)inIndex of Jx.
var_jyinteger(kind=I4P)inIndex of Jy.
var_jzinteger(kind=I4P)inIndex of Jz.
check_currentlogicalinThe J rows hold a fresh deposit.
check_chargelogicalinThe charge row holds a fresh deposit.
blocks_numberinteger(kind=I4P)inNumber of blocks in use.
overlap_currentlogicaloutPlasma current on the support.
overlap_chargelogicaloutPlasma 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

NameTypeIntentAttributesDescription
selfclass(prism_coil_object)inoutCoils.
qreal(kind=R8P)inDeposited field.
slotinteger(kind=I4P)inCOIL_SLOT_COMMITTED or COIL_SLOT_STAGE.
var_jxinteger(kind=I4P)inIndex of Jx.
var_jyinteger(kind=I4P)inIndex of Jy.
var_jzinteger(kind=I4P)inIndex of Jz.
activelogicalinPlasma 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

NameTypeIntentAttributesDescription
selfclass(prism_coil_object)inCoils.
qreal(kind=R8P)inoutField.
slotinteger(kind=I4P)inCOIL_SLOT_COMMITTED or COIL_SLOT_STAGE.
var_jxinteger(kind=I4P)inIndex of Jx.
var_jyinteger(kind=I4P)inIndex of Jy.
var_jzinteger(kind=I4P)inIndex 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

NameTypeIntentAttributesDescription
selfclass(prism_coil_object)inCoils.
blocks_numberinteger(kind=I4P)inNumber of blocks in use.
cellsinteger(kind=I4P)outallocatableSupport cells (4,n).
interiorinteger(kind=I4P)outNumber 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

NameTypeIntentAttributesDescription
selfclass(prism_coil_object)inIC.

Call graph