Skip to content

C9 Stage currents ​

IDGroupTypeBackendsFigureProgram
C9ContractsCCPU (gfortran, nvfortran, ifx; R8P and R4P); GPUnoselah_test_stage_current

Case and scope ​

lookahead(k) and stage_current(k) make the weighted sums of a field's stage currents the charge-conserving current of the particles' displacement to each stage (guide), so that Gauss's law holds at every stage and step. The case checks it on a stencil-free model, every Runge–Kutta scheme.

Setup ​

ItemValue
Modela particle x′=v, v′=−x (a companion), a field D′=−J (one cell), the deposit H(xn→X)=(sin⁡X−sin⁡xn)/Δt: a nonlinear stand-in for Esirkepov's current; the conserved charge is D+sin⁡x
Stage kthe particle's residual; lookahead(k) →X; H; stage_current(k) →Jk; the field's residual −Jk
Steps10 of Δt=0.3, x0=0.7, v0=0.4, D0=0.2
Admissibilitythe catalogue; ssp-33 with a32=0; strang

Program ​

bash
./exe/selah_test_stage_current

Results ​

CheckResultBound
|D+sin⁡x−(D+sin⁡x)0| in every stage state and after every stepat most 3.3e-16 (ssp-104), 0 for euler64 ε
lookahead(k) against the state of stage k+1bitwise, every schemeexact
lookahead(s) against the step's resultto round-off8 ε
admissibilityevery catalogue scheme yes; a32=0 no; strang noexact

Four mutants each fail it: the row k in place of k+1, the look-ahead without the current stage's residual, the current not divided by ak+1,k, one term of the sum dropped.

Findings ​

  • The construction keeps the discrete Gauss law to round-off at every stage, in every scheme of the catalogue, with a nonlinear deposit: it needs nothing of the deposit but that it be a function of the end points.

GPL-3.0-or-later, BSD-2-Clause, BSD-3-Clause or MIT, at your choice