Skip to content

PIC: periodic faces and the Fresnel slab ​

CasesIssuesTypeBackendsFigureRegression
pic-periodic, pic-slab-pulse#111, #112 (#105 open)PCPU, FNLnogolden-check/{cpu,fnl} (digest + residuals, compared by pic_check.sh)

Case and scope ​

Two cases run the PIC path of the production runs: TSC particle weighting, the charge-conserving current esirkepov_Q10 with the coherent gather, the t0 FLAIL solves of D and B, FD6, SSP (5,4), two macroparticles per cell per species, a fixed seed and no pairing.

  • pic-periodic: a uniform plasma periodic on every face, with a plane wave of one box length. It exercises the periodic current fold and the particle wrap on three axes (particle boundaries).
  • pic-slab-pulse: the Fresnel pilot at Δx=c/(8ωpe). A plasma slab 3c/ωpe thick, PEC along x and periodic in y, z; a single-cycle gaussian_derivative_pulse crosses the slab.

The charge-conserving CPU current is single-block and single-rank, so each case runs as legs: the CPU on one block for the first 4 steps; FNL at 1 rank on one block; FNL at 2 ranks on the same grid as 64 blocks. On the FNL virtual block the multi-block result equals the single-block one by construction, up to the order of the atomic adds, so the 2-rank leg checks the halos, the migration and the decomposition against the 1-rank leg.

What the cases catch:

  • a deposit that does not conserve charge: the charge-conservation history must stay at round-off;
  • a t0 field that violates Gauss's law;
  • a change of the particle path beyond the digest tolerance (the push, the deposit, the gather, the wrap);
  • a decomposition-dependent result on FNL.

pic-slab-pulse also carries the one PRISM measurement against an exact physical solution: run to tωpe=32 with three probe planes, the same input matches the exact cold slab.

Models and numerics ​

ItemChoiceCode
Modelphysical_model = PIC, electrons and ions, Maxwellian (Te=30000 K, Ti=300 K), density 5.663678⋅1031 m⁻³particle-in-cell
WeightingTSC charge; conserving current esirkepov_Q10; field gather esirkepov_Q10 (coherent)deposit_matched_current, adam_prism_cpu_object.F90; adam_prism_fnl_pic_conserving_object.F90; charge-conserving currents
Particle facesperiodic → fold and end-of-step wrap; other kinds → legacyadam_prism_pic_bc_object.F90
t0 fieldsFLAIL solves of ϕ and A; closure grounded (pic-periodic), isolated (pic-slab-pulse)the fields at t0
TimeSSP Runge–Kutta (5,4); CFL 0.5 (pic-periodic), 0.25 (pic-slab-pulse: at CFL 0.5 ωmaxΔt≈0.07 hits the plasma-frequency limit)adam_prism_plasma_frequencies_object.F90
Diagnosticcharge_conservation_save = 1: Q_deposition_error, dQ_num_net per stepcharge conservation diagnostic

Initial and boundary conditions ​

Itempic-periodicpic-slab-pulse
Domain (m)x∈[0,2⋅10−9], y,z∈[−7.5,7.5]⋅10−10x∈[0,4.8⋅10−8], y,z∈[−1.5,1.5]⋅10−9
Grid32×24×24, one block (Δx=c/(16ωpe)); 2-rank leg: 64 blocks of 8×6×6384×24×24, one block (Δx=c/(8ωpe)); 2-rank leg: 64 blocks
Plasmauniformslab normal to x, thickness 3⋅10−9 m, centre x=2.45⋅10−8 m
Field initial conditionplane wave along x, λ=2⋅10−9 m (one box length)Gaussian-derivative pulse along +x, r0 = 1.5e-8, sigma = 1e-9
Facesperiodic on all sixPEC in x, periodic in y, z
Steps40 (CPU leg: 4)1152, tωpe=18 (CPU leg: 4)
Macroparticles2 per cell per species, weight 3.457, seed 123452 per cell per species, weight 27.65, seed 12345

Run times: CPU 1 rank about 2.5 / 2 min; FNL 1 rank about 35 s / 10 min (RTX 4070 laptop); FNL 2 ranks about 1.5 / 10 min (two A30).

Input files ​

FileRole
src/tests/prism/regression/pic-{periodic,slab-pulse}/input.inione block (CPU and FNL at 1 rank)
src/tests/prism/regression/pic-{periodic,slab-pulse}/input-np2.inithe same grid as 64 blocks (FNL at 2 ranks)
src/tests/prism/regression/pic-{periodic,slab-pulse}/check.sh <cpu|fnl> [--capture]call the shared driver
src/tests/prism/regression/pic_check.shthe legs: charge, Gauss at t0, digest, residuals
src/tests/prism/regression/pic-*/golden-check/{cpu,fnl}/the goldens (not golden/: run.sh runs a goldened case at 2 ranks, which the CPU leg refuses)
src/tests/prism/fnl/fd/PIC/Fresnel_test/pilot/pulse/input.inithe Fresnel pilot the slab case derives from
bash
cd src/tests/prism/regression/pic-periodic && ./check.sh cpu
FNL_NP=1 ./check.sh fnl                     # FNL, 1 rank (WSL); FNL_NP="1 2" on a cluster node
PIC_CHECK_LAUNCH="srun --mpi=pmix -u -n" ./check.sh fnl   # under Slurm

Results ​

Each leg asserts, as coded:

CheckBoundpic-periodic CPUpic-periodic FNLpic-slab-pulse CPUpic-slab-pulse FNL
run exits 0—pass, np 1pass, np 1, 2pass, np 1pass, np 1, 2
charge: max |Q_deposition_error|, |dQ_num_net| over the run, relative to one species' charge≤10−121.0⋅10−167.3⋅10−189.3⋅10−171.3⋅10−17
Gauss at t0: max |∇⋅D−ρ+cχ|/max|ρ|≤10−128.9⋅10−155.0⋅10−156.3⋅10−155.2⋅10−15
digest against golden-check/<backend>rtol = 1e-6, atol = 1e-3; sums on the scale n∑q248 rows, 0 outside48 + 42 rows (np 1, 2), 0 outside48 rows, 0 outside96 + 84 rows (np 1, 2), 0 outside
residuals against the golden (1-rank legs)rtol = 1e-6, atol = 1e-31 row, match1 row, match1 row, match3 rows, match

At 2 ranks the digest skips the per-block metadata rows (origin, dxdydz, time_iteration) and the residuals log, which depend on the block layout, not on the fields.

The Fresnel slab against the exact cold slab, plane-mean L2 error (pic-slab-pulse input run to tωpe=32 with three probe planes; not a leg):

Probe planepic-slab-pulse inputPilot plane study, same Δx
reflected3.3 %2.7 %
inside the slab3.3 %4.2 %
transmitted6.2 %7.0 %

The error is second order in Δx.

Related pages: t0 elliptic solves for the t0 fields on their own; the comparison with the exact spectral solution is open as #105.

Findings ​

  • The 2-rank FNL leg is compared with the 1-rank golden: the virtual block makes the multi-block result equal to the single-block one up to the order of the atomic adds, so any halo, migration or decomposition defect shows.
  • The digest compares the sum of a zero-mean field (J, ρ, the residuals) on its own scale, n∑q2: its last digits follow the order of the atomic adds.
  • The slab pulse runs at CFL 0.25: at CFL 0.5 the plasma-frequency time-step limit would bind. The case doubled its step count for it (576 → 1152).
  • The Fresnel slab matches the exact cold slab to 3.3 / 3.3 / 6.2 %, second order in Δx.