Skip to content
Development documentation — This site follows the main branch and may differ from an installed release. View the changelog.

Field evaluation

At the start of each batch, BEACH constructs a field from the current element charges, q_elem, and uses that same field for all particles tracked in the batch. Charge carried to a surface is committed at the end of the batch, so it changes the field starting with the next batch.

Element charge is always represented as a constant density over its triangle. Users select how interactions are evaluated and which field boundary is applied.

ChoiceRoleValues
element kernelCharge distribution on one elementtriangle_p0 (fixed)
solverHow interactions from many sources are accumulateddirect / treecode / fmm / auto
field boundaryHow periodic images and the far field are includedfree / periodic2
SolverMain useField boundaryApproximation
DirectSmall problems, reference results, and split referencesfree, constrained periodic2Evaluates the analytic panel kernel for every element
TreecodeMedium free-space problemsfreeUses monopoles for far nodes and the analytic panel kernel in near leaves
FMMLarge problems and many targetsfree, periodic2Approximates far interactions with multipole and local expansions
autoSelect by element count for a free boundaryfreeDirect or FMM

With auto, Direct is used when nelem < tree_min_nelem and FMM is used at and above the threshold. The default threshold is 256. Runtime depends not only on the element count, but also on the number of particles, number of steps, and target distribution, so measure a reduced case representative of the production run.

This table is the canonical compatibility reference for solvers and field boundaries.

Solverfreeperiodic2
directSupportedSplit reference only. Requires periodic2.nonzero_mode_backend="panel_spectral_reference", zero_mode_policy="exclude_k0", and a supported lower-boundary model
treecodeSupportedUnsupported
fmmSupportedSupported. Infinite-periodic production runs use cached_kneq0
autoSupportedUnsupported

periodic2 requires a [domain] box, periodic_axes=["x", "y"], and a nonperiodic z axis. The Direct split reference is for reduced validation cases; the normal periodic2 production path uses FMM.

Separate domain topology from the field boundary

Section titled “Separate domain topology from the field boundary”
[domain]
box_origin = [0.0, 0.0, 0.0]
box_size = [1.0, 1.0, 1.0]
periodic_axes = ["x", "y"]
[field_boundary]
mode = "periodic2"

[domain] owns the simulation cell and periodic topology; [field_boundary] owns field closure. mode="free" selects a free-space field, while mode="periodic2" uses the domain’s x/y periodicity. The current periodic2 implementation accepts only x/y periodic and z nonperiodic. Species boundary settings may select open, reflect, or redistributed_reflect on nonperiodic faces, but cannot add, remove, or override periodic axes.

Discretize element charge with triangle P0

Section titled “Discretize element charge with triangle P0”

BEACH distributes each element’s total charge with constant density over its triangle. triangle_p0 is the only element kernel and is implicit rather than selected in a [field] table. It requires finite non-degenerate triangles and a resolved vacuum side for every element. Treecode evaluates near leaves with the analytic panel kernel and distant nodes as monopoles for both field and potential. See Direct, Treecode, and FMM for details.

The former [field] table and sim.softening key have been removed. Leaving either in an input fails as an unknown table or key; BEACH does not reinterpret it as another element model.

Normalize length to control numerical scale

Section titled “Normalize length to control numerical scale”

sim.field_normalization selects the representative internal length L0L_0. It does not change input or output units.

ValueL0L_0Origin x0\mathbf{x}_0
si1 m0
lengthfield_length_scale0
boxLargest extent in [domain]domain.box_min
meshLargest mesh-bounding-box extentMesh-bounding-box minimum

The internal calculation uses

x=xx0L0,\mathbf{x}'=\frac{\mathbf{x}-\mathbf{x}_0}{L_0},

then multiplies electric field by kc/L02k_c/L_0^2 and potential by kc/L0k_c/L_0 to restore SI units. box requires a [domain] with positive extents. mesh falls back to field_length_scale only when the mesh is empty.

Combine the solver with boundary components in periodic2

Section titled “Combine the solver with boundary components in periodic2”

periodic2 combines a finite- or infinite-image nonzero mode with a physical zero mode. Production uses FMM; reduced split references use a Direct panel spectral backend. See periodic2 electrostatics for component ownership.

Measure solver and mesh-discretization errors separately

Section titled “Measure solver and mesh-discretization errors separately”

For a new mesh, first compare a reduced identical case against Direct. Then vary the source-mesh resolution to measure discretization error and vary solver controls to measure approximation error. Compare not only fields at a few points, but also the observables used in the study, such as impact locations, accumulated charge, and conserved quantities. See Validating results for the complete workflow.