flowchart LR
RUN[RUN.FIELDSOLVER] --> PB[Particle bunch]
PB --> FC[One moving field layout]
PB --> BFS[Self-field controller]
TYPE[FIELDSOLVER.TYPE] --> BACKEND[NONE / FFT / P3M / OPEN]
BINS[FIELDSOLVER.BINS] --> PATH[Monolithic / binned]
SOURCE[EMISSIONSOURCE] --> CORR[No correction / image / shifted Green]
BFS --> BACKEND
BFS --> PATH
BFS --> CORR
FC --> PIC[Scatter - solve - transform - gather]
BACKEND --> PIC
PATH --> PIC
CORR --> PIC
18 Field Solvers
Shared particle-mesh model
Both manuals use FIELDSOLVER to connect a particle-mesh space-charge model to tracking. Charge is deposited on a mesh, Poisson’s equation
\[ \nabla^2\phi=-\frac{\rho}{\epsilon_0}, \qquad \mathbf E=-\nabla\phi, \]
is solved with the selected boundary model, and the field is interpolated back to the particles. The version-specific sections below describe the available backends, parameters, and compatibility restrictions.
FIELDSOLVER selects the mesh Poisson backend and the space-charge mode used by a tracking run. Define the object before TRACK, then attach it by name on RUN:
FS1: FIELDSOLVER, TYPE=OPEN,
NX=64, NY=64, NZ=128,
PARFFTX=TRUE, PARFFTY=TRUE, PARFFTZ=TRUE,
BCFFTX=OPEN, BCFFTY=OPEN, BCFFTZ=OPEN,
GREENSF=INTEGRATED, BBOXINCR=2.0;
TRACK, LINE=Line1, BEAM=Beam1,
DT={1e-11}, MAXSTEPS={1000}, ZSTOP={2.0};
RUN, METHOD=PARALLEL, FIELDSOLVER=FS1;
ENDTRACK;
For an active solver, BEAM.BCHARGE must be nonzero once more than one macroparticle is present. Use TYPE=NONE when self-fields should be disabled.
18.1 Solver types
OPALX deposits particle charge on one distributed mesh, solves Poisson’s equation, and interpolates the resulting field back to the particles:
\[ \nabla^2\phi=-\frac{\rho}{\epsilon_0}, \qquad \mathbf E=-\nabla\phi. \]
The configured backend controls how the mesh boundary is interpreted. Binning and cathode-plane corrections are additional modes described below.
TYPE |
Boundary model | Current status | Typical use |
|---|---|---|---|
NONE |
No solve | Available no-op | External fields only |
FFT |
Periodic in all three axes | Available | A periodically repeated charge distribution |
OPEN |
Isolated free space | Available | Finite bunches; recommended default |
P3M |
Open or periodic in all three axes | Available | Open or periodic P3M calculations |
FFT2D5 |
Open in transverse, open or periodic longitudinally | Available; tracking validation pending | Long finite bunches in rings |
The retained OPAL SAAMG and adaptive-mesh-refinement (AMR) solvers are unavailable in OPALX. Their legacy attributes, including FSTYPE, MX, MY, MT, and AMR_*, are not accepted by the current FIELDSOLVER command.
18.1.1 NONE
NONE skips binning, charge deposition, the field solve, and field gathering. Particle self-fields remain zero. A syntactically complete FIELDSOLVER definition is still required by the current construction path, including positive mesh sizes.
18.1.2 FFT
FFT uses IPPL’s periodic FFT Poisson solver and returns the electric-field gradient directly. Set all three BCFFT* values to PERIODIC. Before the solve, OPALX subtracts the mean charge density so the periodic domain has zero net charge.
FSPeriodic: FIELDSOLVER, TYPE=FFT,
NX=64, NY=64, NZ=64,
PARFFTX=TRUE, PARFFTY=TRUE, PARFFTZ=TRUE,
BCFFTX=PERIODIC, BCFFTY=PERIODIC, BCFFTZ=PERIODIC;
This solver represents an infinite periodic repetition of the simulation box; it is not an approximation to an isolated bunch. Set PERIODICBOX to keep the box size constant during tracking.
18.1.3 OPEN
OPEN uses IPPL’s Hockney free-space FFT solver. The doubled-grid convolution removes the periodic wraparound of an ordinary FFT solve. Set all three BCFFT* values to OPEN.
In historical OPAL input, the corresponding isolated solver is written as FSTYPE=FFT together with open boundaries. Do not translate that name literally to OPALX TYPE=FFT: OPALX uses TYPE=FFT for a periodic solver and TYPE=OPEN for the isolated Hockney solve.
GREENSF selects the free-space kernel:
INTEGRATEDis the default integrated-cell Green function.STANDARDuses the point-sampled Green function.
Both choices are forwarded only to the OPEN backend. Establish mesh convergence for the selected kernel rather than assuming identical finite-grid results.
Set REPEATS to add the field of identical neighbouring bunches in a bunch train. It also works with TYPE=P3M and open boundaries.
18.1.4 P3M
P3M splits the Coulomb interaction at a cutoff radius \(r_c\), with \(\alpha=2/r_c\): a smooth long-range part is solved on the mesh, and a short-range particle-particle correction is added for pairs closer than \(r_c\). It supports open and periodically repeated domains. Select one uniform boundary configuration:
| Domain | Boundary settings |
|---|---|
| Open | BCFFTX=OPEN, BCFFTY=OPEN, BCFFTZ=OPEN |
| Periodic | BCFFTX=PERIODIC, BCFFTY=PERIODIC, BCFFTZ=PERIODIC |
By default the cutoff follows the mesh: \(r_c\) is RCUT_CELLS (default 2) times the largest mesh spacing and is updated with the moving mesh. Set RCUT instead for a fixed cutoff in metres; setting both is an error.
FSP3M: FIELDSOLVER, TYPE=P3M,
NX=64, NY=64, NZ=64,
PARFFTX=TRUE, PARFFTY=TRUE, PARFFTZ=TRUE,
BCFFTX=OPEN, BCFFTY=OPEN, BCFFTZ=OPEN,
RCUT=2.5e-4, BBOXINCR=2.0;
P3M can use the binned rest-frame mode with any MAXBINS. The mesh part is then solved for each bin in the rest frame of that bin, on the longitudinally stretched mesh. The particle part uses the velocity of each source particle instead: its pair field is the short-range part of the field of a charge moving with its own momentum, with laboratory \(\mathbf E\) and \(\mathbf B\). The pair sum runs once per step for all bins. The cutoff keeps its value in metres and acts as the rest-frame cutoff of both parts.
The rest-frame mesh spacing along \(z\) is \(\gamma h_z\), so a mesh that resolves the split in the laboratory can be too coarse in the rest frame. OPALX warns once when \(\gamma h_z\) is at least twice the largest laboratory spacing and \(\alpha h\) exceeds \(1\). Increase NZ by about the reported ratio, at most \(\gamma\), for a near-isotropic rest-frame mesh.
The force split, its error parameters, and the neighbour search are described in the physics manual.
18.1.5 FFT2D5
The current FFT2D5MODEL=ORIGINAL uses independent open transverse Poisson slices on a doubled mesh with a cell-integrated logarithmic Green function. IPPL/heFFTe supplies the FFT infrastructure. Its longitudinal field is calculated from the local line-density derivative:
\[ E_s(s)=-\frac{g}{4\pi\varepsilon_0\gamma^2}\frac{d\lambda}{ds}(s). \]
PIPEMODE selects OPEN, CIRCULAR, PLATES or NONE; NONE disables this longitudinal field. Transverse slices remain open. FFT2D5MODEL=ORIGINAL is the default and only current model.
Particles are projected onto the reference path and their fields are expressed in its local coordinates. The current solver supports the planar curved reference paths used for bends and rings. This coordinate transformation does not add a three-dimensional curvature-correction operator.
Distributed FFT2D5
Parallel decomposition is along the reference-path coordinate only. Set PARFFTX=FALSE, PARFFTY=FALSE, PARFFTZ=TRUE. Every rank owns complete transverse planes. NZ must be at least the rank count; avoid one-plane local slabs and choose multiple slices per rank for the current halo exchange and numerical resolution. The example below has ample slices for two ranks.
FS2D5: FIELDSOLVER, TYPE=FFT2D5, FFT2D5MODEL=ORIGINAL,
NX=64, NY=64, NZ=128, BINS=NONE,
PARFFTX=FALSE, PARFFTY=FALSE, PARFFTZ=TRUE,
BCFFTX=OPEN, BCFFTY=OPEN, BCFFTZ=OPEN,
PIPEMODE=NONE, BEAMR=0.005,
PIPESIZEX=0.04, PIPESIZEY=0.04,
CLOSEDRING=FALSE, REFPATHFNAME="reference.dat";
Attach FS2D5 to the existing beam/tracking setup using RUN,FIELDSOLVER=FS2D5. The reference file must cover the full bunch throughout tracking as described below. For an input named case.in:
Batched transverse solves
--2D5BatchSize n groups up to n occupied local slices per batch on CPUs and GPUs; capacity is capped by the local slab size. Supply a positive integer; explicit zero is invalid. With one rank, omitting the option retains serial slice solves. With multiple ranks, the default local batch size is one.
A final partial batch is handled automatically. Batching retains the slice model and transforms transverse coordinates only. Workspace memory grows with batch size and transverse mesh area; compare runtime and memory use for the intended mesh and machine. A larger batch does not guarantee a faster run.
FFT2D5 passes the current unit tests, which check solver operation and individual numerical stages. Its accuracy in end-to-end particle tracking has not yet been validated against independent physics benchmarks. Treat tracking results as provisional until this validation is complete.
Keep BINS=NONE and all three BCFFT* values OPEN. CLOSEDRING=TRUE selects longitudinal periodicity. Cathode-plane corrections and fixed Cartesian domains are unavailable; transverse decomposition is rejected.
Development model notes — unavailable in the current version
The retained notes below describe separate development models. Their CIRCULAR_UNIFORM, PIPERADIUS and finite-source OPEN settings are unavailable in the current ORIGINAL model and are not current input syntax.
FFT2D5 uses a mesh along its reference path. PIPEMODE="OPEN" calculates the finite-source free-space potential and all three electric-field components with a nonlocal convolution on that thin mesh. It includes the finite bunch ends and the leading transverse curvature terms; it has no fitted geometry factor.
OPEN accepts a straight path or a horizontal circular arc shorter than one turn. The path is fitted exactly and used consistently for deposition and field gathering; unsupported paths cause an error. It requires CLOSEDRING=FALSE, a half-cell deposition margin around every particle, and \(|u/R|\le0.01\) across the numerical mesh and its field halo. Increase the transverse widths or extend the path when a particle leaves that margin. BEAMR does not prescribe the free-space source profile.
For a curved path the calculation is instantaneous electrostatics. The current implementation rejects particles with \(\beta>0.1\); this cutoff does not certify a tracking accuracy. The frozen-field benchmark uses \(\beta=0.001\). A straight path uses the usual common-velocity rest-frame scaling; all active containers must have the same mean Lorentz factor.
The nonlocal operator uses three-dimensional FFTs on the thin reference-path mesh, rather than a Cartesian mesh covering the whole orbit. Its workspace is larger than that of the slice models. Converge NZ near sharp bunch ends as well as the transverse mesh sizes.
The other PIPEMODE values retain separate open transverse Poisson slices. NONE disables their longitudinal field. CIRCULAR, CIRCULAR_UNIFORM and PLATES use the local model
\[ E_s(r,s)=-\frac{g(r)}{4\pi\varepsilon_0 \gamma^2}\frac{d\lambda}{ds}(s). \]
Here \(s\) is distance along the reference path, \(r\) is transverse distance from it, and \(\lambda\) is the laboratory line charge. The slice-centred density derivative uses the same longitudinal interpolation as deposition. These local modes can wrap their interpolation with CLOSEDRING=TRUE.
PIPEMODE="CIRCULAR_UNIFORM" selects a pointwise field for a uniform circular beam of fixed radius BEAMR, centred on the reference path, in a coaxial grounded circular pipe. Set the physical pipe radius with PIPERADIUS in metres; it is required and must be at least BEAMR. The model includes the radial dependence of the longitudinal field and its vacuum annulus, and rejects particles beyond the physical pipe radius. It does not impose a transverse conducting boundary. The formula and limits are given in the physics chapter.
PIPESIZEX and PIPESIZEY are full numerical transverse widths, independent of PIPERADIUS. Keep the physical radius fixed when changing these widths for a numerical-domain check. For example:
FS2D5: FIELDSOLVER, TYPE="FFT2D5",
NX=128, NY=128, NZ=128,
PARFFTX=FALSE, PARFFTY=FALSE, PARFFTZ=FALSE,
PIPEMODE="CIRCULAR_UNIFORM", BEAMR=0.005, PIPERADIUS=0.020,
PIPESIZEX=0.040, PIPESIZEY=0.040,
REFPATHFNAME="straight-reference.dat";
The retained CIRCULAR mode uses a scalar equivalent-moment model rather than the pointwise uniform-round-beam field. It accepts PIPERADIUS; when that attribute is absent, it retains the historical use of min(PIPESIZEX,PIPESIZEY) in its geometry factor. PLATES retains its scalar model. PIPERADIUS is rejected for OPEN, PLATES, NONE, and solver types other than FFT2D5.
| Development parameter | Default | Values / unit | Development meaning |
|---|---|---|---|
PIPEMODE |
OPEN |
OPEN, CIRCULAR, CIRCULAR_UNIFORM, PLATES, NONE |
OPEN: nonlocal finite-source fields. Other values: open transverse slices and selected local longitudinal model. TYPE=FFT2D5 only. |
BEAMR |
1.0 |
positive length | Beam radius in metres; fixed uniform-round radius for CIRCULAR_UNIFORM. TYPE=FFT2D5 only. |
PIPERADIUS |
unset | positive length, at least BEAMR |
Physical circular-pipe radius in metres. Required for CIRCULAR_UNIFORM, optional for CIRCULAR, rejected otherwise. Independent of the numerical mesh widths. |
CLOSEDRING |
FALSE |
Boolean | Longitudinal periodicity for local slice modes. Must be FALSE for PIPEMODE=OPEN. |
PIPESIZEX |
1.0 |
positive length | Full horizontal numerical mesh width in metres. Legacy scalar geometry factors also use these widths unless CIRCULAR has an explicit PIPERADIUS. TYPE=FFT2D5 only. |
PIPESIZEY |
1.0 |
positive length | Full vertical numerical mesh width in metres, with the same legacy geometry-factor convention as PIPESIZEX. TYPE=FFT2D5 only. |
18.2 FIELDSOLVER parameters
| Parameter | Default | Accepted values / unit | Current effect |
|---|---|---|---|
TYPE |
required | NONE, FFT, P3M, OPEN, FFT2D5 |
Selects the backend described above. |
FFT2D5MODEL |
ORIGINAL |
ORIGINAL |
Current 2.5D slice model; an explicit setting requires TYPE=FFT2D5. |
BINS |
NONE |
NONE or a BINNING name |
Selects monolithic or per-bin rest-frame space charge. |
NX, NY, NZ |
none | positive integer cell counts | Number of mesh cells in \(x\), \(y\), and \(z\). Each value must be a finite positive integer that fits a 32-bit signed integer. |
PARFFTX |
FALSE |
Boolean | Split the \(x\) mesh axis over MPI ranks. |
PARFFTY |
FALSE |
Boolean | Split the \(y\) mesh axis over MPI ranks. |
PARFFTZ |
TRUE |
Boolean | Split the \(z\) mesh axis over MPI ranks. |
BCFFTX, BCFFTY, BCFFTZ |
OPEN |
OPEN, PERIODIC, DIRICHLET |
Mesh boundary selection. All three values must match. See Boundary conditions. |
GREENSF |
INTEGRATED |
INTEGRATED, STANDARD |
Green-function discretization for TYPE=OPEN; otherwise ineffective. |
RCUT |
unset | positive length | Fixed P3M cutoff in metres; excludes RCUT_CELLS. Leave unset for every other type. |
RCUT_CELLS |
2 |
positive number | P3M cutoff in units of the largest mesh spacing, used unless RCUT is set. Leave unset for every other type. |
REPEATS |
0 |
non-negative integer | Number of identical neighbouring bunches on each side of the tracked bunch. 0 disables them. Needs TYPE=OPEN or TYPE=P3M with all BCFFT*=OPEN. |
REPEAT_SPACING |
0 |
positive length | Laboratory-frame distance in metres between neighbouring bunches. Required when REPEATS is positive; ignored otherwise. |
PERIODICBOX |
0 |
non-negative length | Edge length in metres of a fixed periodic cube. 0 lets the periodic domain follow the particles. Needs all BCFFT*=PERIODIC and BINS=NONE. |
BBOXINCR |
2.0 |
percent | Adds this fraction of the particle span to each side of the moving mesh. |
PIPEMODE |
OPEN |
OPEN, CIRCULAR, PLATES, NONE |
Local longitudinal-field model for TYPE=FFT2D5; transverse slices remain open. |
BEAMR |
1.0 |
positive length | Beam radius in metres used by the current longitudinal closure; TYPE=FFT2D5 only. |
CLOSEDRING |
FALSE |
Boolean | Wrap longitudinal interpolation around the reference path for TYPE=FFT2D5. |
SCATTERLONGITUDINALLY |
TRUE |
Boolean | TRUE uses linear cloud-in-cell deposition across adjacent longitudinal slices; FALSE deposits into one longitudinal slice. Field gathering uses the matching longitudinal shape. TYPE=FFT2D5 only. |
PIPESIZEX |
1.0 |
positive length | Full horizontal numerical mesh width in metres for FFT2D5. |
PIPESIZEY |
1.0 |
positive length | Full vertical numerical mesh width in metres for FFT2D5. |
REFPATHFNAME |
"" |
string | Reference-path filename for TYPE=FFT2D5. If empty, uses <input-basename>_DesignPath.dat in the auxiliary output directory. |
REFPATHFNAME must name a readable design-path file. The reader skips one header line and then expects numeric columns s rx ry rz px py pz ex ey ez bx by bz ke time. At least two distinct position samples are required. The transverse mesh spans PIPESIZEX and PIPESIZEY; the longitudinal mesh spans the length of this reference path.
For an open reference path, its endpoints must cover the full bunch throughout tracking, including particles behind the initial reference-particle position. Particles beyond either endpoint cause an error before charge deposition. Provide an extended REFPATHFNAME if the generated design path does not cover the bunch; endpoint clamping would otherwise concentrate charge artificially.
The transverse slice source uses laboratory positions and line charge. Its Poisson electric field is already the laboratory transverse field; the magnetic self-field is \(\mathbf B_\perp=\beta\,\hat{\mathbf t}\times\mathbf E_\perp/c\). For comoving paraxial particles, the resulting transverse Lorentz force is \(\mathbf F_\perp=q\mathbf E_\perp/\gamma^2\).
For the three-dimensional backends, PARFFTX, PARFFTY, and PARFFTZ select the mesh axes split over ranks; the defaults split only \(z\). With more than one rank, at least one flag must be TRUE, and the product of the split mesh sizes must be at least the number of ranks. ORB load balancing (OPTION, REPARTFREQ) moves rank boundaries only along the split axes. It needs a power-of-two rank count and keeps the current decomposition when a region has fewer than four mesh points along the axis it would cut. Mixed boundary conditions, such as periodic \(x,y\) with open \(z\), are rejected.
FFT2D5 owns fixed reference-path slabs and its particle migration; the Cartesian ORB settings above do not repartition those slabs.
18.3 Mesh and particle-in-cell cycle
The three-dimensional backends share one distributed field layout containing charge density, electric field, potential, and scratch fields. Each active three-dimensional space-charge evaluation performs the following cycle. FFT2D5 instead uses a thin mesh along its reference path.
The mesh follows the particle bounds unless PERIODICBOX fixes it. BBOXINCR=p expands both the lower and upper bound by \(p\) percent of the unpadded span, so the total width grows by \(2p\) percent. A degenerate span is clamped to \(1\,\mu\mathrm m\). If load balancing repartitions the field layout, OPALX updates fields and particles before refreshing backend-owned FFT state.
Zero or one global particle produces zero self-field without a solve. For two or more particles, an active backend rejects zero per-particle charge; this usually means BCHARGE is missing from BEAM.
18.4 Boundary conditions
18.4.1 Open and periodic boundaries
Use matching solver and boundary settings:
| Physical model | Configuration |
|---|---|
| Isolated finite bunch | TYPE=OPEN; all BCFFT*=OPEN |
| Periodically repeated box | TYPE=FFT; all BCFFT*=PERIODIC |
| Open P3M domain | TYPE=P3M; all BCFFT*=OPEN |
| Periodic P3M domain | TYPE=P3M; all BCFFT*=PERIODIC |
| No self-field | TYPE=NONE; all BCFFT*=OPEN is conventional |
The three axes must use the same boundary value. The boundary attributes set mesh periodicity, but they do not change FFT into an open solver or OPEN into a periodic solver. P3M explicitly supports either uniformly open or uniformly periodic boundaries.
18.4.2 Generic all-face Dirichlet boundaries
Generic all-face DIRICHLET boundaries are not a supported tracking mode. Use the open or periodic boundary combinations above.
Cathode-plane Dirichlet corrections are different: keep TYPE=OPEN, or TYPE=P3M for the shifted-Green correction, and all three BCFFT* values OPEN, then select one correction on EMISSIONSOURCE.
18.4.3 Fixed periodic box
With all three BCFFT* values PERIODIC, the period is the extent of the mesh. By default that extent is recomputed from the particle bounds at every solve, so the period changes with the particle distribution, and a homogeneous plasma cannot keep its density. PERIODICBOX=L fixes the period to a cube of edge length \(L\) in metres:
FSBox: FIELDSOLVER, TYPE=P3M,
NX=32, NY=32, NZ=32,
PARFFTX=TRUE, PARFFTY=TRUE, PARFFTZ=TRUE,
BCFFTX=PERIODIC, BCFFTY=PERIODIC, BCFFTZ=PERIODIC,
PERIODICBOX=4.0e-7, RCUT=1.6e-7;
- The cube spans \(-L/2\le x,y,z\le L/2\) in the space-charge solve frame. Each axis has \(N_i\) cells of width \(L/N_i\), so the period is exactly \(L\) along all three axes.
BBOXINCRhas no effect. - Particles that leave the cube re-enter through the opposite face, and only positions modulo \(L\) enter the self-field. Place the initial particles inside the cube.
- Use it with
TYPE=FFTorTYPE=P3M. OPALX rejects a negative value, anyBCFFT*value other thanPERIODIC, and a namedBINS. - ORB load balancing (
OPTION, REPARTFREQ) remains available.
18.4.4 Bunch trains
In a linac every RF bucket can hold a bunch, and the neighbouring bunches add to the space-charge field of the tracked one. REPEATS=K adds the field of \(K\) identical bunches on each side of the tracked bunch. REPEAT_SPACING=a is their distance in metres along the \(z\) axis of the space-charge solve frame; for bunches in adjacent RF buckets, \(a=\beta c/f_\mathrm{RF}\).
FSTrain: FIELDSOLVER, TYPE=OPEN,
NX=32, NY=32, NZ=64,
PARFFTX=TRUE, PARFFTY=TRUE, PARFFTZ=TRUE,
BCFFTX=OPEN, BCFFTY=OPEN, BCFFTZ=OPEN,
REPEATS=8, REPEAT_SPACING=0.0542;
- The neighbouring bunches are shifted copies in the Green function, \(G_K(\mathbf r)=\sum_{|k|\le K}G(\mathbf r-ka\,\hat{\mathbf z})\), so one solve gives the field of all \(2K+1\) bunches on the mesh of the tracked one. The physics manual gives the derivation.
- Every copy has the same charge distribution and velocity as the tracked bunch and moves with it. The copies are not tracked, and their field is evaluated only at the tracked particles.
- In the binned rest-frame mode, the spacing is stretched with the mesh: the solve for bin \(b\) uses \(\gamma_b a\).
- With
TYPE=OPEN, the copies use theGREENSFkernel. WithTYPE=P3M, they use the full Coulomb kernel, because they receive no short-range particle-particle correction. - If the mesh is longer than \(a\) along \(z\), the singularity of a copy falls inside the mesh. The point-sampled kernels (
GREENSF=STANDARDand theP3Mcopies) are regularized there; useTYPE=OPENwith the defaultGREENSF=INTEGRATEDfor such meshes. - OPALX rejects a negative or non-integer
REPEATS, a missing or non-positiveREPEAT_SPACING, anyBCFFT*value other thanOPEN, and other solver types. Cathode-plane corrections (ZEROFACE_R0Z,SHIFTED_GREENS_FUNCTION) are also rejected, because the image solve does not include the copies.
18.5 Space-charge modes
For the three-dimensional backends, TYPE chooses a backend and BINS chooses between a lab-frame electrostatic solve and binned rest-frame solves. An emission source can additionally request one cathode-plane correction. FFT2D5 uses its own reference-path algorithm and does not support these binning or cathode-plane modes.
18.5.1 Monolithic electrostatic mode
BINS=NONE performs one scatter, one solve, and one electric-field gather for the entire bunch. It applies no rest-frame transformation and does not create a self-magnetic field. This is the least expensive mode and is appropriate only when that electrostatic approximation is adequate.
Either cathode-plane correction can be included in this path.
18.5.2 Binned rest-frame mode
Set BINS to a named BINNING definition. At every field evaluation OPALX rebins particles, then for each populated bin:
- computes its mean normalized momentum \(\mathbf p_b\) and the mean Lorentz factor \(\gamma_b\) of its particles;
- stretches the longitudinal mesh spacing by \(\gamma_b\);
- deposits that bin’s charge and solves in its approximate rest frame;
- transforms the result to the laboratory frame; and
- accumulates electric and magnetic contributions from all bins.
The bin table’s gammaBin reports \(\gamma_b\). This is an average over the particles, not the Lorentz factor of the bin’s centre-of-momentum frame, and the two agree closely when the momentum spread inside the bin is small. See the physics derivation and assumptions.
For \(\mathbf v_b=c\mathbf p_b/\gamma_b\) and \(\hat{\mathbf w}_b=\mathbf v_b/|\mathbf v_b|\), the transformation is
\[ \mathbf E_b=\gamma_b\mathbf E'_b -(\gamma_b-1)(\mathbf E'_b\cdot\hat{\mathbf w}_b)\hat{\mathbf w}_b, \qquad \mathbf B_b=\frac{\gamma_b}{c^2}\mathbf v_b\times\mathbf E'_b. \]
Use binning when velocity varies substantially through the bunch, especially during emission or in a chirped beam. Check convergence with respect to both mesh resolution and binning parameters. With P3M, only the mesh part is binned; see P3M for its short-range term. The physics manual derives the approximation and the adaptive bin merge.
The charge mesh is aligned with the bunch mean momentum before a binned solve. Particle positions and normalized momenta are rotated into this same mesh frame before bin selection and relativistic field reconstruction, then rotated back after the solve. A rotation changes components but preserves momentum magnitude, energy, and the Lorentz factor.
For a nearly monoenergetic cyclotron bunch, one explicit bin enables this relativistic beam-frame treatment without subdividing the bunch:
SCBin: BINNING, MAXBINS=1, PARAMETER=GAMMAZ,
ADAPTIVEBINNING=FALSE;
FSOpen: FIELDSOLVER, TYPE=OPEN, BINS=SCBin,
NX=32, NY=32, NZ=32,
PARFFTX=TRUE, PARFFTY=TRUE, PARFFTZ=TRUE,
BCFFTX=OPEN, BCFFTY=OPEN, BCFFTZ=OPEN,
GREENSF=STANDARD, BBOXINCR=2;
This is a starting configuration, not a converged resolution. Increase the particle count and each mesh dimension independently. The time at which the self-field is evaluated is selected separately by RUN.SCFIELDUPDATE.
18.5.3 Explicit image-charge Dirichlet correction
Set ZEROFACE_R0Z to TRUE on one emission source to model a grounded plane at that source’s R0Z. For each real charge \(q\) at \(z\), OPALX deposits a mirror charge \(-q\) at \(2R0Z-z\). Their superposed potential is zero on the plane.
Source: EMISSIONSOURCE, DISTRIBUTION=Dist,
R0Z=0.0,
ZEROFACE_R0Z=TRUE,
ZEROFACE_MAXSTEPS=500,
ZEROFACEPLANEDUMP=0;
The mode is implemented for monolithic and binned execution and requires the OPEN backend; other backends, including P3M, are rejected. In binned mode the real and mirror charges require separate solves per bin.
The moving mesh must span both the bunch and its mirror. Once the bunch is far from the cathode, this can make the mesh unnecessarily large or lose the required resolution. Set ZEROFACE_MAXSTEPS to a positive cutoff when the correction becomes negligible; 0 means unlimited. ZEROFACEPLANEDUMP is a diagnostic frequency. Its output is available only for the explicit-image mode without binning and currently writes only in single-rank runs.
18.5.4 Shifted-Green Dirichlet correction
Set SHIFTED_GREENS_FUNCTION to TRUE to impose the same grounded plane without placing mirror particles on the mesh. It repeats each primary deposition using a shifted free-space Green function, reflects the resulting field in \(z\), and adds the image contribution with the required component signs.
Source: EMISSIONSOURCE, DISTRIBUTION=Dist,
R0Z=0.0,
SHIFTED_GREENS_FUNCTION=TRUE,
ZEROFACE_MAXSTEPS=500;
This mode requires TYPE=OPEN, or TYPE=P3M with all three BCFFT*=OPEN. It works in monolithic and binned mode. Its kernel shift is computed from the laboratory-frame mesh centre \(z_c\), the plane \(z_p\), and the bin Lorentz factor \(\gamma_b\) (\(1\) without binning) as
\[ \mathbf s=(0,0,2\gamma_b(z_c-z_p)). \]
Unlike explicit images, the mesh need not extend from the bunch to the mirror distribution, so the method remains usable at larger bunch-plane separation. It does not support ZEROFACEPLANEDUMP. The physics manual derives both image constructions.
The explicit-image and shifted-Green modes are mutually exclusive across the entire run. Only one emission source may select either method, and both use the same ZEROFACE_MAXSTEPS convention.
18.6 Compatibility and selection
| Goal | Backend and boundaries | Space-charge mode | Cathode correction |
|---|---|---|---|
| Disable self-fields | NONE; conventionally OPEN boundaries |
BINS=NONE |
none |
| Periodic electrostatics | FFT; all PERIODIC |
monolithic or binned | none |
| Periodic P3M | P3M; all PERIODIC |
monolithic or binned | none |
| Isolated, nearly mono-velocity bunch | OPEN; all OPEN |
monolithic | optional explicit images |
| Open P3M | P3M; all OPEN |
monolithic or binned | none or shifted Green |
| Isolated bunch with velocity spread | OPEN; all OPEN |
named BINS |
none or explicit images |
| Emission near a grounded plane | OPEN; all OPEN |
named BINS |
shifted Green recommended for separation from the plane |
| Bunch in a train of identical bunches | OPEN or P3M; all OPEN |
monolithic or binned | none |
Do not select generic DIRICHLET for a current production input. Do not combine cathode corrections with periodic physics. P3M supports only the shifted-Green correction, and only with open boundaries.
18.7 Accuracy, cost, and reproducibility
- A monolithic step performs one Poisson solve. A binned step performs one per populated bin; either cathode correction doubles that count.
- Increase
NX,NY, andNZindependently and compare physical observables. A visually smooth field is not a convergence test. - Vary
BBOXINCR: too little padding places particles close to the mesh edge; too much padding lowers resolution for fixed mesh dimensions. - For
P3M, check convergence in both mesh resolution and the cutoff (RCUTorRCUT_CELLS). With binning, judge theNZresolution by the rest-frame spacing \(\gamma_b h_z\) of the most energetic bin. - For binned runs, vary the
BINNINGcontrols and check that observables do not depend materially on the chosen partition. - Compare correction cutoffs and confirm that fields are negligible before
ZEROFACE_MAXSTEPSdisables the cathode model. - With
REPEATS, increase the number of copies until the observables no longer change. The copies do not change the cost of a solve, but the time to build the Green function, which is repeated whenever the mesh spacing changes, grows in proportion toREPEATS. - Start from a maintained regression input with the intended backend. Record all mesh, boundary, Green-function, binning, and correction settings with the result.
18.8 Binning
BINNING defines a longitudinal histogram used by the binned space-charge solver. Define it separately and attach it to a FIELDSOLVER with BINS:
Bins1: BINNING,
MAXBINS=120,
DESIREDWIDTH=0.2,
BINNINGALPHA=1.1,
BINNINGBETA=1.6,
PARAMETER=VELOCITYZ,
ADAPTIVEBINNING=TRUE,
TABLEPRINTFREQ=10;
FS1: FIELDSOLVER, TYPE=OPEN, BINS=Bins1,
NX=32, NY=32, NZ=32,
PARFFTX=TRUE, PARFFTY=TRUE, PARFFTZ=TRUE,
BCFFTX=OPEN, BCFFTY=OPEN, BCFFTZ=OPEN;
Use BINS=NONE, the field-solver default, to disable binning.
Parameters
| Parameter | Default | Current behavior |
|---|---|---|
MAXBINS |
128 |
Number of bins in the initial uniform histogram and upper bound after merging. The real input is converted to an integer; use a positive value. |
DESIREDWIDTH |
0.1 |
Target-width bias used by the adaptive merge cost function. |
BINNINGALPHA |
1.0 |
Weight penalizing wide merged bins. |
BINNINGBETA |
1.5 |
Weight biasing the cost toward DESIREDWIDTH. |
PARAMETER |
VELOCITYZ |
Bunch quantity used to assign particles to bins. |
ADAPTIVEBINNING |
TRUE |
Merge the initial uniform histogram adaptively. FALSE retains the uniform MAXBINS histogram. |
DUMPBINSFILE |
NONE |
JSON output name. Empty or NONE disables output; .json is appended when missing. |
DUMPBINSFREQ |
1 |
JSON dump frequency in global steps. Must be at least one when file output is enabled. |
TABLEPRINTFREQ |
10 |
Console bin-statistics frequency in global steps. 0 disables it; negative values are rejected. |
The parser accepts VELOCITYZ, GAMMAZ.
With normalized momentum \(P_z=p_z/(mc)\), the implemented selectors are
\[ \mathrm{VELOCITYZ}=\frac{|P_z|}{\sqrt{1+P_z^2}}, \qquad \mathrm{GAMMAZ}=\sqrt{1+P_z^2}. \]
GAMMAZ is therefore a longitudinal proxy based only on \(P_z\), not the full Lorentz factor when transverse momentum is nonzero.
Adaptive merging
OPALX first creates a uniform histogram over the selected quantity. With ADAPTIVEBINNING=TRUE, adjacent bins are merged using a cost function based on particle fraction, combined width, DESIREDWIDTH, BINNINGALPHA, and BINNINGBETA. With FALSE, the uniform histogram remains unchanged. The physics manual gives the cost function and the role of each parameter.
DESIREDWIDTH must be finite and positive. BINNINGALPHA and BINNINGBETA must be finite; they are not restricted to [0,1]. In particular, the default BINNINGBETA is 1.5.
Runtime notes
Binning is enabled only when a field solver resolves a named
BINNINGdefinition throughBINS.The current bin object is constructed from the primary particle container.
DUMPBINSFILErecords counts and widths for reproducibility; generated JSON is simulation output and does not belong in the manual repository.
Space-charge effects are attached to the tracking setup through a FIELDSOLVER command and then referenced from RUN as described in the tracking chapter. The standard model is fully three-dimensional. The field solve is based on Poisson’s equation with open boundaries, either through FFT-based convolution, iterative irregular-domain solvers, or adaptive mesh refinement.
18.9 FFT Based Particle-Mesh (PM) Solver
The classical particle-mesh solver discretizes the charge density on a regular Cartesian mesh
\[ \Omega = [-L_x, L_x] \times [-L_y, L_y] \times [-L_t, L_t] \]
with the corresponding grid points. Instead of computing all pairwise particle-particle interactions, the charge is distributed across the mesh and Poisson’s equation is solved there.
For isolated bunches the potential satisfies
\[ \nabla^2 \phi = -\rho / \epsilon_0 \tag{18.1}\]
and can be written as a convolution of the charge density with the open-space Green function. The FFT-based solver uses the Hockney zero-padding construction so that the open-boundary convolution can be evaluated with periodic FFTs on an enlarged mesh.
18.9.1 FFT-based Convolutions and Zero Padding
The key idea is:
- deposit the physical charge density on the unpadded mesh
- enlarge the mesh so the convolution can be represented as a periodic one
- construct the periodic Green-function array
- solve the convolution in Fourier space
- retain the potential and field only in the physical region
This gives the physical open-boundary solution while preserving the efficiency of FFTs.
18.9.2 Algorithm
In practical terms, the FFT space-charge solve proceeds as:
- deposit charge to the mesh
- build or reuse the Green-function array
- perform the FFT-based convolution solve
- compute the electric field on the mesh
- interpolate the field back to particles
The method scales much better than direct particle-particle summation and is the standard stable space-charge path.
18.9.3 Interpolation Schemes
The interpolation from mesh fields back to particles follows the standard particle-mesh deposition/interpolation choices used. The legacy manual reserves the detailed interpolation discussion for later revisions, but the solver is intended for ordinary 3D PIC workflows.
18.10 Particle-Particle-Particle-Mesh (P3M) Solver
The P3M solver splits the total electrostatic force into a short-range direct part and a long-range mesh part,
\[ F = F_{\mathrm{sr}} + F_{\mathrm{lr}} \tag{18.2}\]
so that close encounters are handled by direct summation inside a cutoff radius, while the smooth long-range contribution is handled on the mesh.
In this formulation the Green function is likewise split into short-range and long-range components. OPAL supports two practical choices:
STANDARD: the Ewald-type splitting with interaction parameterALPHAINTEGRATED: an integrated polynomial form with a convenient closed-form cell integration
18.10.1 Use of P^3M solver
The legacy implementation notes are important:
P3Mis only available inOPAL-T- emission must not be active
- the solver uses
OPENboundary conditions ALPHAis only used together withGREENSF=STANDARD
Example:
REAL inter_rad = 3.125e-5;
FS_P3M: FIELDSOLVER, FSTYPE="P3M", MX=64, MY=64, MT=64,
PARFFTX=decx, PARFFTY=decy, PARFFTT=decz,
RC=inter_rad, GREENSF=INTEGRATED;
18.11 Iterative Space Charge Solver
The iterative Poisson solver is intended for irregular geometries where the plain FFT open-boundary solve is not the best model. The discretization is based on finite differences, and the resulting linear system is solved by a preconditioned iterative method with smoothed-aggregation algebraic multigrid preconditioning.
Compilation requirements:
ENABLE_SAAMG_SOLVER=ON- Parmetis
- Trilinos
This is the solver family behind FSTYPE=SAAMG.
18.12 Energy Binning
When the bunch energy spread is too large for a single boosted-frame electrostatic approximation, OPAL can split the bunch into several energy bins and perform multiple field solves. This is the basis of the multi-Lorentz-frame approximation.
In cyclotron multi-bunch mode the number of energy bins should be at least the number of neighboring bunches represented by NNEIGHBB. The companion control parameter MINSTEPFORREBIN defines after how many integration steps the energy bins are merged again.
18.13 The FIELDSOLVER Command
The FIELDSOLVER command selects the solver type, mesh resolution, domain decomposition, boundary conditions, and optional solver-specific parameters.
18.13.1 Core command attributes
| Attribute | Meaning |
|---|---|
FSTYPE |
Solver type: FFT, FFTPERIODIC, SAAMG, P3M, NONE |
PARFFTX |
Distribute the x direction over MPI ranks |
PARFFTY |
Distribute the y direction over MPI ranks |
PARFFTT |
Distribute the z direction over MPI ranks |
MX |
Number of mesh points in x |
MY |
Number of mesh points in y |
MT |
Number of mesh points in z |
BCFFTX |
Boundary condition in x |
BCFFTY |
Boundary condition in y |
BCFFTZ |
Boundary condition in z |
GREENSF |
Green-function choice for FFT-based solvers |
BBOXINCR |
Bounding-box enlargement factor in percent |
GEOMETRY |
Geometry list for irregular-domain solves |
ITSOLVER |
Iterative linear solver |
INTERPL |
Boundary-point interpolation scheme |
TOL |
Iterative solver tolerance |
MAXITERS |
Maximum number of iterations |
PRECMODE |
Preconditioner reuse policy |
RC |
P3M short-range cutoff radius |
ALPHA |
P3M interaction splitting parameter |
ENBINS |
Number of energy bins |
MINSTEPFORREBIN |
Merge energy bins after this many steps |
18.13.2 Fieldsolver type
FSTYPE selects the actual solver backend.
FFT: standard open-boundary FFT-based particle-mesh solverFFTPERIODIC: FFT solver with periodic longitudinal treatmentSAAMG: iterative irregular-domain solverP3M: mixed mesh plus short-range direct solverNONE: disable space-charge field solving
FFT solver is the most stable default path.
18.13.3 Domain Decomposition
PARFFTX, PARFFTY, and PARFFTT decide whether the corresponding mesh direction is distributed over MPI processes.
Legacy default:
PARFFTX = FALSEPARFFTY = FALSEPARFFTT = TRUE
So the conventional decomposition is serial in x and y, parallel in z.
18.13.4 Number of Grid Points
MX, MY, and MT define the rectangular mesh resolution in x, y, and z. These values determine both the field resolution and the FFT problem size, so they are the main tuning parameters for accuracy and cost.
18.13.5 Boundary Conditions
Boundary conditions are specified independently per axis:
BCFFTX:OPENBCFFTY:OPENBCFFTZ:OPENorPERIODIC
Using PERIODIC in z is the standard way to model a DC beam rather than an isolated bunch.
18.13.6 Greens Function
GREENSF controls the Green-function model for FFT-based solvers and P3M.
Allowed values:
INTEGRATEDSTANDARD
The default is INTEGRATED. This is the usual recommendation for FFT-based space-charge calculations.
18.13.7 Bounding Box Enlargement
The solver constructs a minimal rectangular box that encloses all particles. BBOXINCR enlarges that box by a user-specified percentage before the solve.
Default:
BBOXINCR = 2.0
This is often used to avoid an overly tight computational box around the bunch.
18.13.8 Geometry
GEOMETRY attaches a list of geometry objects that define the boundary of the computational domain for the irregular-domain solver. This option is relevant to SAAMG workflows.
18.13.9 Iterative Solver
ITSOLVER selects the Krylov or direct linear solver used by the iterative field-solver family.
For SAAMG, the retained alternatives include:
BICGSTABGMRES
18.13.10 Interpolation for Boundary Points
INTERPL controls how grid points near the irregular boundary are interpolated.
Allowed values:
CONSTANTLINEAR(default)QUADRATIC
This parameter is specific to SAAMG.
18.13.11 Tolerance
TOL is the convergence tolerance for the iterative solver.
Default:
TOL = 1e-8
18.13.12 Maximal Iterations
MAXITERS limits the number of iterations taken by the iterative solver.
Default:
MAXITERS = 100
18.13.13 Preconditioner Behavior
PRECMODE controls how aggressively the SAAMG preconditioner is rebuilt or reused.
| Value | Behavior |
|---|---|
STD |
Rebuild the preconditioner every step |
HIERARCHY |
Reuse the hierarchy only; this is the default |
REUSE |
Reuse the full preconditioner |
This parameter should only be changed deliberately, because it affects both performance and solver robustness.
18.13.14 Cut-off Radius
RC is the short-range cutoff radius for the P3M solver in the boosted frame. Particles separated by less than this radius are included in the direct particle-particle correction.
Default:
RC = 0
This corresponds to disabling the direct short-range correction.
18.13.15 Interaction splitting parameter
ALPHA controls the balance between the short-range and mesh parts of the P3M Green-function split. Large ALPHA gives greater weight to the mesh part; small ALPHA gives greater weight to the particle-particle part.
It is commonly chosen as
\[ \alpha = C / r_c \tag{18.3}\]
with C of order one and r_c the cutoff radius.
Default:
ALPHA = 1e8
This parameter is only used for GREENSF=STANDARD.
18.13.16 Number of Energy Bins
ENBINS selects how many energy bins are used when the bunch is split for multi-frame space-charge treatment. In cyclotron multi-bunch mode this should not be smaller than NNEIGHBB.
MINSTEPFORREBIN defines after how many steps the temporarily split energy-bin representation is merged back into one.
18.14 Adaptive Mesh Refinement (AMR) Solver
The AMR path extends the FIELDSOLVER command with hierarchy and refinement controls. It is enabled by compiling OPAL with ENABLE_AMR=ON and enabling OPTION, AMR=TRUE.
The legacy interface describes three AMR solver types:
FMGMLAMR_MG
The hierarchy is defined from the base grid by the number of AMR levels, refinement ratios, blocking factors, and maximum grid sizes.
18.14.1 AMR extensions to FIELDSOLVER
| Attribute | Meaning |
|---|---|
AMR_MAXLEVEL |
Maximum AMR refinement level |
AMR_REFX, AMR_REFY, AMR_REFZ |
Refinement ratio per coordinate |
AMR_MAXGRIDX, AMR_MAXGRIDY, AMR_MAXGRIDZ |
Maximum base-level box size |
AMR_BFX, AMR_BFY, AMR_BFZ |
Blocking factors |
AMR_TAGGING |
Mesh-refinement rule |
AMR_DENSITY |
Density threshold for CHARGE_DENSITY tagging |
AMR_MAX_NUM_PART |
Threshold for MAX_NUM_PARTICLES tagging |
AMR_MIN_NUM_PART |
Threshold for MIN_NUM_PARTICLES tagging |
AMR_SCALING |
Scaling threshold for POTENTIAL, EFIELD, MOMENTA |
AMR_DOMAIN_RATIO |
Computational-domain aspect ratio |
18.14.2 Mesh refinement strategies
The manual documents these tagging modes:
AMR_TAGGING |
Refinement criterion |
|---|---|
POTENTIAL |
refine where the potential exceeds a scaled level maximum |
EFIELD |
refine where any field component exceeds a scaled level maximum |
MOMENTA |
refine cells containing particles above a scaled momentum threshold |
CHARGE_DENSITY |
refine cells whose density exceeds AMR_DENSITY |
MIN_NUM_PARTICLES |
refine cells based on AMR_MIN_NUM_PART |
MAX_NUM_PARTICLES |
refine cells based on AMR_MAX_NUM_PART |
AMR_TAGGING is a string attribute and therefore must be quoted in the input deck.
18.14.3 Hardware-Architecture Independent AMR Poisson Solver
The AMR_MG path is the Trilinos-based AMR Poisson solver. It requires ENABLE_AMR_MG_SOLVER=ON and a working Trilinos installation. The legacy manual lists these core packages:
- Tpetra
- Ifpack2
- Amesos2
- Belos
- MueLu
Some base-level linear solvers require additional third-party packages such as SUPERLU, UMFPACK, PARDISO_MKL, MUMPS, or LAPACK.
The AMR multigrid extensions are:
| Attribute | Meaning |
|---|---|
AMR_MG_SMOOTHER |
GS, JACOBI, or SGS; default GS |
AMR_MG_NSWEEPS |
Number of smoothing sweeps; default 8 |
AMR_MG_PREC |
Bottom-level preconditioner; default NONE |
AMR_MG_INTERP |
Prolongation operator; default PC |
AMR_MG_NORM |
Convergence norm; default LINF_NORM |
AMR_MG_VERBOSE |
Write solver diagnostics; default FALSE |
AMR_MG_REBALANCE |
Rebalance solver/preconditioner communicators; default FALSE |
AMR_MG_REUSE |
MueLu reuse mode; default RAP |
AMR_MG_TOL |
Solver tolerance; default 1e-10 |
ITSOLVER |
Base-level linear solver |
For ITSOLVER on the AMR base level, retained alternatives include:
BICGSTABMINRESPCPGGMRESRECYCLING_GMRESKLU2SUPERLUUMFPACKPARDISO_MKLMUMPSLAPACKSA
18.14.4 Use of AMR
The legacy manual states that AMR is available only in OPAL-cycl multi-bunch mode. Once more than one bunch is present, the AMR hierarchy is built. In this setup the AMR backend manages the MPI parallelism itself, so the other Poisson-solver backends are not combined with the AMR run mode.
18.14.5 AMR Example
OPTION, AMR = TRUE;
OPTION, AMR_REGRID_FREQ = 10;
OPTION, AMR_YT_DUMP_FREQ = 100000;
REAL Edes = .072;
REAL turns = 8;
REAL nstep = 360;
REAL frequency = 50.650;
ring: CYCLOTRON, ...;
rf0: RFCAVITY, ...;
rf1: RFCAVITY, ...;
rf2: RFCAVITY, ...;
rf3: RFCAVITY, ...;
rf4: RFCAVITY, ...;
l1: LINE = (ring, rf0, rf1, rf2, rf3, rf4);
Dist1: DISTRIBUTION, ...;
Fs1: FIELDSOLVER, FSTYPE=AMR_MG,
MX=128, MY=128, MT=128,
PARFFTX=TRUE, PARFFTY=TRUE, PARFFTT=TRUE,
BCFFTX=OPEN, BCFFTY=OPEN, BCFFTZ=OPEN,
BBOXINCR=20, AMR_MAXLEVEL=2,
AMR_MAXGRIDX=32, AMR_MAXGRIDY=32, AMR_MAXGRIDZ=32,
AMR_BFX=16, AMR_BFY=16, AMR_BFZ=16,
AMR_REFX=2, AMR_REFY=2, AMR_REFZ=2,
AMR_DOMAIN_RATIO={1.0, 0.75, 0.75},
AMR_TAGGING="CHARGE_DENSITY", AMR_DENSITY=1.0e-9,
AMR_MG_VERBOSE=TRUE, AMR_MG_REBALANCE=TRUE, AMR_MG_REUSE=FULL,
ITSOLVER=SA, AMR_MG_NORM=LINF_NORM, AMR_MG_NSWEEPS=12;
beam1: BEAM, PARTICLE=PROTON, PC=P0, NPART=1e5, BCURRENT=2.0E-3, CHARGE=1.0, BFREQ=frequency;
TRACK, LINE=l1, BEAM=beam1, MAXSTEPS=nstep*turns, STEPSPERTURN=nstep;
RUN, METHOD="CYCLOTRON-T", BEAM=beam1, FIELDSOLVER=Fs1, DISTRIBUTION=Dist1,
MBMODE=FORCE, TURNS=11, MB_BINNING=GAMMA_BINNING, MB_ETA=0.25;
ENDTRACK;
STOP;