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

periodic2 electrostatics

For an x/y-periodic, z-nonperiodic slab, field_boundary.mode="periodic2" computes finite images, infinite-periodic k\ne0, and plane-average k=0 separately and adds each component exactly once.

The zero in zero mode refers to the x/y wave numbers kx=ky=0k_x=k_y=0. This component is the height-dependent plane-average field, determined by the lower boundary condition and Gauss’s law. It is one of the physical components handled by the field solver.

[domain]
box_min = [0.0, 0.0, 0.0]
box_max = [1.0, 1.0, 1.0]
periodic_axes = ["x", "y"]
[field_boundary]
mode = "periodic2"

Periodicity belongs to [domain] topology. [field_boundary] selects the free or periodic2 field closure applied to that cell. The current periodic2 implementation accepts only x/y periodic and z nonperiodic; a species or [particle_boundary] cannot override periodic axes.

ComponentPhysical meaningProduction path
Primary and near imagesStrong local field near the primary cellFinite-image Direct/FMM sum
Far k\ne0Infinite-periodic far field varying in x/ycached_kneq0 operator
Surface k=0Plane-average field from total charge below each heightTriangle-height cumulative polynomial

cached_kneq0 returns only the nonzero modes; field composition adds the physical boundary-conditioned surface k=0 exactly once. See Finite-image periodic2 configuration for a complete run configuration.

Select the computation path for nonzero modes

Section titled “Select the computation path for nonzero modes”
Nonzero-mode constructionUseConstraint
Finite imagesSmall comparison and finite-image modelContains nothing outside the image range
panel_spectral_referenceSmall triangle-P0 referenceDirect and mode/quadrature convergence
cached_kneq0Infinite-periodic nonzero modes for FMM productionx/y periodic, z nonperiodic, and exclude_k0

field_periodic_far_correction="auto" has compatibility behavior equivalent to none. Infinite-periodic production must select cached_kneq0 explicitly. Startup validation checks high-level settings against typed [periodic2] configuration and rejects contradictory zero-mode ownership. Removed [outer_plasma] and [coupling] tables are unknown input. m2l_root_oracle has been removed and is rejected at startup.

The Ewald2P teacher, root-multipole-to-local operator, cache, and FMM-state connection are documented separately in periodic2 Far Correction. This page treats that implementation as the nonzero component of the complete field.

Define the range included by a finite-image sum

Section titled “Define the range included by a finite-image sum”

Sources are added explicitly for primary cell and configured image layer NN,

(i,j)[N,N]2.(i,j)\in[-N,N]^2.

This evaluates near interactions with the original kernel but omits the smooth field of infinitely many images outside the range. Therefore field_periodic_far_correction="none" is a finite-image model and must not be interpreted as an infinite-periodic solution without convergence as NN increases.

The near-image layer in FMM must match the shell subtracted when fitting the far operator. The cache fingerprint includes image layer for this reason.

Separate the infinite-periodic far field with Ewald2P

Section titled “Separate the infinite-periodic far field with Ewald2P”

cached_kneq0 applies the difference between an Ewald2P teacher and finite-image shell as an operator and removes the teacher’s symmetric k=0. Field composition adds the selected physical k=0 exactly once:

Ksurface=(Kshell+REwaldfullK0sym)+K0physical.K_\mathrm{surface} =\left(K_\mathrm{shell}+R_\mathrm{Ewald}^{\mathrm{full}}-K_0^\mathrm{sym}\right) +K_0^\mathrm{physical}.

The expression in parentheses belongs to the nonzero backend. zero_mode_policy="exclude_k0" prevents double counting; it does not discard the mean field. See periodic2 Far Correction for Ewald splitting, operator fitting, the FMM insertion point, and cache lifecycle.

Add the physical k=0 component exactly once

Section titled “Add the physical k=0 component exactly once”

For triangle total charge qiq_i, let Fi(z)F_i(z) be the fraction of its area at or below height zz. Plane-average cumulative charge is

C(z)=iqiFi(z).C(z)=\sum_iq_iF_i(z).

FiF_i is piecewise quadratic between the three vertex heights. A geometry plan sorts all vertex heights into breakpoints and stores quadratic coefficients contributed by each triangle in each interval. Horizontal triangles are separate sheet charges; evaluation on a sheet distinguishes minus trace, plus trace, and principal value.

When qiq_i changes, stored geometry coefficients are multiplied by charge into interval differences, then a prefix sum forms

C(z)=a0+a1z+a2z2C(z)=a_0+a_1z+a_2z^2

and its primitive. Geometry plan is not rebuilt.

Derive zero-mode field and potential from Gauss’s law

Section titled “Derive zero-mode field and potential from Gauss’s law”

For cell area A=LxLyA=L_xL_y and lower far field EbottomE_\mathrm{bottom}, Gauss’s law gives

E0(z)=Ebottom+C(z)ϵ0A.E_0(z)=E_\mathrm{bottom}+\frac{C(z)}{\epsilon_0A}.

Potential from gauge point (zg,ϕg)(z_g,\phi_g) is

ϕ0(z)=ϕgEbottom(zzg)1ϵ0AzgzC(ζ)dζ.\phi_0(z)=\phi_g-E_\mathrm{bottom}(z-z_g) -\frac1{\epsilon_0A}\int_{z_g}^zC(\zeta)\,d\zeta.

A binary search locates the breakpoint interval and evaluates its quadratic and cubic primitive, giving O(logNz)O(\log N_z) per point.

A nonneutral cell can retain constant far field and linearly growing potential in z. Zero mode is a physical Gauss-law component, not a numerical term that may be deleted.

Close the mean field with a z-boundary condition

Section titled “Close the mean field with a z-boundary condition”

For total surface charge Q=iqiQ=\sum_iq_i, current choices are:

lower_boundary_modelEbottomE_\mathrm{bottom}EtopE_\mathrm{top}Meaning
symmetric_vacuumQ/(2ϵ0A)-Q/(2\epsilon_0A)+Q/(2ϵ0A)+Q/(2\epsilon_0A)Equal vacuum half-spaces above and below with no external field
e_bottom_zero00Q/(ϵ0A)Q/(\epsilon_0A)Legacy closure fixing lower flux to zero

Neither solves dielectric screening or polarization. symmetric_vacuum is the minimal symmetric closure without an additional interface or permittivity; e_bottom_zero exists for legacy reproduction and is not a universal physical default.

With matching_plane_quasistatic, BEACH passes DH=ϵ0Ebottom+Q/AD_H=\epsilon_0E_\mathrm{bottom}+Q/A, derived from the same lower closure and complete surface charge, to the outer response. The returned (H,ΦH)(H,\Phi_H) becomes the zero-mode gauge point. This preserves the field and Gauss’s law while making the inner potential continuous with the outer sheath; it does not add the outer field profile inside BEACH. See Quasistatic Matching-Plane Coupling for configuration and the height-dependence test.

Search periodic images reachable by particle trajectories

Section titled “Search periodic images reachable by particle trajectories”

Field targets are wrapped into the primary periodic cell, while physical trajectory-event positions are retained. Mesh collision searches geometric periodic images required by a segment. Field near-image layer and collision image bound are distinct numerical concepts and do not share one fixed count. See Particle collision and boundary events.

  • Increase image layers and converge the observable for a finite-image model.
  • For cached models, compare cache miss/hit and thread/MPI configurations.
  • Vary Ewald α\alpha, real/reciprocal layers, and proxy/check settings to bound teacher/operator error.
  • Compare against an oracle to exclude duplicate primary, near, far, symmetric k=0 subtraction, or physical k=0 addition.
  • Inspect Gauss residual and lower/upper closure.
  • Do not interpret a finite-height potential difference in a nonneutral cell directly as escape energy to infinity.

See FMM internals for internal Ewald formulas and operator APIs.