Skip to content

PRISM ​

PRISM (Plasma Research usIng Simulation Methods) is the electromagnetics and plasma application of ADAM. It solves Maxwell's equations for the electric displacement D and the magnetic induction B with centred finite differences or finite volumes on block-structured adaptive grids, optionally coupled to charged macro-particles by a particle-in-cell (PIC) method, on CPUs (MPI + OpenMP) and on GPUs (MPI + OpenACC).

What is implemented ​

AreaCapabilitiesDetails
PhysicsMaxwell's equations in SI or non-dimensional form, with a prescribed current density (coils) or the current and charge of PIC macro-particles; hyperbolic (GLM) divergence cleaning of D, B or bothPhysical models
SpaceCentred finite differences or finite volumes of order 2–10 ([fdv]); WENO flux splitting (CPU only)Numerical methods
TimeRunge–Kutta (SSP 11/22/33/54, low-storage 1/2/3, Yoshida on the CPU), CFL time step on the speed of lightNumerical methods
GridOctree/quadtree of Cartesian blocks, AMR at initialization (box and current-variation markers), 2:1 coarse–fine faces, FV refluxNumerical methods
CouplingMulti-realm runs glued by a forest manifest, α or β seam cadenceNumerical methods
SourcesRectangular, circular, solenoid and helicon coils, DC or AC, with a smooth ramp; external rotating or uniform fields (acting on the particles)Initial conditions and sources
BoundariesExtrapolation, Neumann, Dirichlet (zero), first-order Silver–Müller, PEC, periodic; perfectly matched layers (four formulations) and a far-wave damping layerBoundary conditions, Absorbing layers
ParticlesPlasma (uniform, cylinder, slab, box) or a single test particle; Maxwellian or drift velocities; charge and current deposition from NGP to sixth order and Gaussian; charge-conserving currents with periodic faces; Runge–Kutta pushParticle-in-cell
t0 fieldsThe electric field of the initial charge and the magnetic field of the initial current, solved by FLAIL with PRISM's own operatorNumerical methods
InputOne INI file per realm, every value checked, refusals at initializationInput reference
OutputXDMF + HDF5 field files (ParaView), restart files, slices, probes, residual, energy, divergence, RMS-field and charge-conservation historiesOutputs
VerificationRegression digests on both backends; oracle checks on AMR seamsVerification

Quick start ​

Build (FoBiS, from the repository root):

bash
fobis build --mode prism-cpu-gnu                         # CPU backend
fobis build --mode prism-fnl-nvf --varset local_nvf      # GPU backend (OpenACC, NVIDIA HPC SDK)

Run the rotating-magnetic-field regression case:

bash
cd src/tests/prism/regression/rmf
mpirun -np 2 ../../../../../exe/adam_prism_cpu input.ini

Without an argument the executable reads input.ini in the working directory. A file with a [forest] section is a forest manifest and runs several realms.

Outputs ​

FileContentEnabled by
<basename>-<it>-procNNNNNN.h5 + <basename>-<it>.xdmfField files: the state ([IO] save_fields = all) or D and B only (em), plus residuals, curls, divergences and the coils' current densities on request[IO] it_save and the save_*_fields flags (input)
restart filesState and time, same rank count and grid to restart[IO] restart_save
<basename>-residuals.datL2 norm of every residual[IO] residuals_save
<basename>-energy_history.datthe electric and magnetic energies 12∑|D|2/ε0ΔV and 12∑|B|2/μ0ΔV, the coil power and the Poynting fluxevery 10 steps (fixed)
<basename>-divergence_history.datmax |∇⋅D| (|∇⋅D−ρ| with PIC), |∇⋅B|, |∇⋅J| outside the absorbing layers, and the residual of the current solverevery step
<basename>-charge_conservation_history.datPIC: particle and deposited charge, continuity and Gauss residualsPIC models
<basename>-grms_history.dat, <basename>-magnetic_field_at_center_domain.datRMS of the field over a region; B at the domain centre[grms], [magnetic_field_at_center_domain]
<basename>-probe_NN.datThe state at a fixed point, trilinear[probes]
<basename>-plane_NN.datThe state on a plane of probes (per save one row per probe), trilinear[probes]
rectangular_current_coil_N.dat, helicon_current_coil_N.datThe current of rectangular and helicon coilsevery step, when such a coil exists
single_particle_output.datPosition, velocity and fields of the test particleproblem_type = single_particle

Pages ​

Known limitations ​

  • Seam div(B). At a 2:1 AMR face the centred operators no longer commute, and the seam injects an O(hp)∇⋅B source that converges under refinement but grows in time at fixed h (#29, accepted as truncation; an upwinded GLM coupling is #99). [IO] seam_divB_tol makes it visible (numerics).
  • Refinement at initialization only. PRISM has no runtime regrid; the t0 elliptic solves refuse a refined grid.
  • Time integration. Only Runge–Kutta runs: leapfrog, Blanes–Moan and commutator-free Magnus are refused, for the fields and for the particles (#55).
  • The GPU backend has no WENO and no Yoshida; its PML needs the FD operators and an SSP scheme (backends).
  • The CPU charge-conserving deposit and the CPU coherent matched gather run on one block and one rank only.
  • Coils (defects, #108): a circular coil injects no current, and the coils after the first take the first coil's amplitude, not their own Amplitude.
  • The PML and far-wave-layer profiles are computed per rank, so a layer that spans the blocks of several ranks gives results that depend on the decomposition (#108).
  • Verification. Analytic oracles (plane wave, cavity, PML reflection, Biot–Savart, Larmor orbit, plasma frequency) are #106.