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
CG Intended potential solve with field boundary conditions Unavailable Parser-visible, but construction deliberately fails

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 and all three PARFFT* flags set to TRUE.

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.

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.

GREENSF selects the free-space kernel:

  • INTEGRATED is the default integrated-cell Green function.
  • STANDARD uses 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.

18.1.4 CG

WarningNot usable on current master

TYPE=CG is accepted by the input parser, but solver construction throws Cannot use CGSolver yet, not fully implemented. The generic all-face Dirichlet boundary setting therefore has no runnable backend at present.

P3M is not an accepted FIELDSOLVER.TYPE on current master. Historical or development-branch references to it do not describe a released OPALX input.

18.2 FIELDSOLVER parameters

Parameter Default Accepted values / unit Current effect
TYPE required NONE, FFT, OPEN, CG Selects the backend described above.
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 points in \(x\), \(y\), and \(z\). The parser stores real values; use integers.
PARFFTX FALSE Boolean Domain decomposition in \(x\). Must currently be TRUE.
PARFFTY FALSE Boolean Domain decomposition in \(y\). Must currently be TRUE.
PARFFTZ TRUE Boolean Domain decomposition in \(z\). Must currently be TRUE.
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.
BBOXINCR 2.0 percent Adds this fraction of the particle span to each side of the moving mesh.

The compiled PARFFTX and PARFFTY defaults are not usable defaults: current OPALX rejects any definition unless PARFFTX, PARFFTY, and PARFFTZ are all TRUE. Mixed boundary conditions, such as periodic \(x,y\) with open \(z\), are also rejected.

18.3 Mesh and particle-in-cell cycle

The runtime objects share one distributed field layout containing charge density, electric field, potential, and scratch fields. Each active space-charge evaluation performs the following cycle:

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 / OPEN / CG]
    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

The mesh follows the particle bounds. 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
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; select the matching TYPE explicitly.

18.4.2 Generic all-face Dirichlet boundaries

The parser accepts BCFFTX=DIRICHLET, BCFFTY=DIRICHLET, and BCFFTZ=DIRICHLET together. These values would impose zero potential on all six mesh faces for the CG potential solver. Since CG is currently disabled, this is not a usable mode on current master.

Cathode-plane Dirichlet corrections are different: keep TYPE=OPEN and all three BCFFT* values OPEN, then select one correction on EMISSIONSOURCE.

18.5 Space-charge modes

TYPE chooses a backend. BINS independently chooses whether OPALX performs one lab-frame electrostatic solve or several rest-frame solves. An emission source can additionally request one cathode-plane correction.

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.

Explicit image charges can be included in this path. A requested shifted-Green correction is not applied without binning; OPALX emits a warning and proceeds with the uncorrected monolithic solve.

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:

  1. computes its mean normalized momentum \(\mathbf p_b\) and mean \(\gamma_b\);
  2. stretches the longitudinal mesh spacing by \(\gamma_b\);
  3. deposits that bin’s charge and solves in its approximate rest frame;
  4. transforms the result to the laboratory frame; and
  5. accumulates electric and magnetic contributions from all bins.

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.

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. Use it with the OPEN backend; this is the physically consistent and maintained setup, though the current input checks do not reject other backends. 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 non-negative diagnostic frequency, is available only for this explicit-image mode, 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 binned 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 both TYPE=OPEN and a named BINS definition. Without binning the correction is skipped. Its kernel shift is computed from the rest-frame mesh centre \(z_c'\) and plane \(z_p\) as

\[ \mathbf s=(0,0,2(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 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
Isolated, nearly mono-velocity bunch OPEN; all OPEN monolithic optional explicit images
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

Do not select CG, generic DIRICHLET, or P3M for a current production input. Do not combine cathode corrections with FFT periodic physics.

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, and NZ independently 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 binned runs, vary the BINNING controls and check that observables do not depend materially on the chosen partition.
  • Compare correction cutoffs and confirm that fields are negligible before ZEROFACE_MAXSTEPS disables the cathode model.
  • Start from a maintained regression input with the intended backend. Record all mesh, boundary, Green-function, binning, and correction settings with the result.

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.8 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.8.1 FFT-based Convolutions and Zero Padding

The key idea is:

  1. deposit the physical charge density on the unpadded mesh
  2. enlarge the mesh so the convolution can be represented as a periodic one
  3. construct the periodic Green-function array
  4. solve the convolution in Fourier space
  5. retain the potential and field only in the physical region

This gives the physical open-boundary solution while preserving the efficiency of FFTs.

18.8.2 Algorithm

In practical terms, the FFT space-charge solve proceeds as:

  1. deposit charge to the mesh
  2. build or reuse the Green-function array
  3. perform the FFT-based convolution solve
  4. compute the electric field on the mesh
  5. 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.8.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.9 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 parameter ALPHA
  • INTEGRATED: an integrated polynomial form with a convenient closed-form cell integration

18.9.1 Use of P^3M solver

The legacy implementation notes are important:

  • P3M is only available in OPAL-T
  • emission must not be active
  • the solver uses OPEN boundary conditions
  • ALPHA is only used together with GREENSF=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.10 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.11 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.12 The FIELDSOLVER Command

The FIELDSOLVER command selects the solver type, mesh resolution, domain decomposition, boundary conditions, and optional solver-specific parameters.

18.12.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.12.2 Fieldsolver type

FSTYPE selects the actual solver backend.

  • FFT: standard open-boundary FFT-based particle-mesh solver
  • FFTPERIODIC: FFT solver with periodic longitudinal treatment
  • SAAMG: iterative irregular-domain solver
  • P3M: mixed mesh plus short-range direct solver
  • NONE: disable space-charge field solving

FFT solver is the most stable default path.

18.12.3 Domain Decomposition

PARFFTX, PARFFTY, and PARFFTT decide whether the corresponding mesh direction is distributed over MPI processes.

Legacy default:

  • PARFFTX = FALSE
  • PARFFTY = FALSE
  • PARFFTT = TRUE

So the conventional decomposition is serial in x and y, parallel in z.

18.12.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.12.5 Boundary Conditions

Boundary conditions are specified independently per axis:

  • BCFFTX: OPEN
  • BCFFTY: OPEN
  • BCFFTZ: OPEN or PERIODIC

Using PERIODIC in z is the standard way to model a DC beam rather than an isolated bunch.

18.12.6 Greens Function

GREENSF controls the Green-function model for FFT-based solvers and P3M.

Allowed values:

  • INTEGRATED
  • STANDARD

The default is INTEGRATED. This is the usual recommendation for FFT-based space-charge calculations.

18.12.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.12.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.12.9 Iterative Solver

ITSOLVER selects the Krylov or direct linear solver used by the iterative field-solver family.

For SAAMG, the documented choices are:

  • CG (default)
  • BICGSTAB
  • GMRES

18.12.10 Interpolation for Boundary Points

INTERPL controls how grid points near the irregular boundary are interpolated.

Allowed values:

  • CONSTANT
  • LINEAR (default)
  • QUADRATIC

This parameter is specific to SAAMG.

18.12.11 Tolerance

TOL is the convergence tolerance for the iterative solver.

Default:

  • TOL = 1e-8

18.12.12 Maximal Iterations

MAXITERS limits the number of iterations taken by the iterative solver.

Default:

  • MAXITERS = 100

18.12.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.12.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.12.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.12.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.13 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:

  • FMG
  • ML
  • AMR_MG

The hierarchy is defined from the base grid by the number of AMR levels, refinement ratios, blocking factors, and maximum grid sizes.

18.13.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.13.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.13.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; default CG

For ITSOLVER on the AMR base level, the legacy interface documents:

  • BICGSTAB
  • MINRES
  • PCPG
  • CG
  • GMRES
  • STOCHASTIC_CG
  • RECYCLING_CG
  • RECYCLING_GMRES
  • KLU2
  • SUPERLU
  • UMFPACK
  • PARDISO_MKL
  • MUMPS
  • LAPACK
  • SA

18.13.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.13.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;

SELECT, LINE=l1;

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;