Boundary conditions

Aether.Boundary.PeriodicBCType
struct PeriodicBC <: BoundaryCondition
PeriodicBC()

Periodic boundary. Periodicity is connectivity, not a ghost-cell rule: a periodic face's neighbor is the far-side block, so the block-to-block exchange fills these ghost cells and no boundary kernel runs.

source
Aether.Boundary.ReflectBCType
struct ReflectBC <: BoundaryCondition
ReflectBC()

Reflecting wall: ghost cells mirror the interior across the face, and the normal vector component (variable 1 + d in direction d — the normal velocity or momentum) flips sign.

source
Aether.Boundary.OutflowBCType
struct OutflowBC <: BoundaryCondition
OutflowBC()

Zero-gradient outflow: every ghost cell copies the nearest interior cell on its normal line.

source
Aether.Boundary.PolarBCType
struct PolarBC <: BoundaryCondition
PolarBC()

The polar-axis boundary of a spherical-polar mesh, for the x2 (polar-angle) faces at $\theta = 0$ and $\theta = \pi$ only. A ghost cell at $(-\delta, \varphi)$ is the interior cell at $(\delta, \varphi + \pi)$ — the boundary is connectivity through the pole, not a wall — so ghosts copy the across-pole interior cell with the azimuth shifted by half the ring, and the $\theta$/$\varphi$ vector components flip sign because $\hat\theta$ and $\hat\varphi$ reverse there ($\hat r$ and the scalars do not). The degenerate axis face of a staggered field carries its flanking-face average. Constrained transport additionally makes the axis electric field single-valued (see average_polar_emfs!).

Supported domains: azimuthally complete meshes ($\varphi$ periodic over exactly $[0, 2\pi]$, even cell count, undecomposed in $\varphi$), where the mapping is exact, and axisymmetric meshes (nx3 == 1), where it reduces to a mirror with both transverse signs flipped. Partial-wedge domains in $\varphi$ are rejected: their across-pole image lies outside the domain.

source
Aether.Boundary.UserBCType
struct UserBC{F} <: BoundaryCondition
UserBC(func)

User-defined boundary. func is called from the host once per exchange as

func(u, direction, side, mesh, blocks)

with direction::Union{X1, X2, X3}, side = -1 (inner) or +1 (outer), and blocks the device vector of block slots whose face lies on this domain face; it is expected to launch its own kernel over the ghost slab (built-in conditions use for_each! over 1:size(u, d) transverse extents and the ng-deep ghost layer). The function type is a parameter, so dispatch stays concrete; the function itself never enters a kernel.

source
Aether.Boundary.BoundaryConditionsType
struct BoundaryConditions{X1I, X1O, X2I, X2O, X3I, X3O}
BoundaryConditions(; ix1 = PeriodicBC(), ox1 = PeriodicBC(),
                     ix2 = PeriodicBC(), ox2 = PeriodicBC(),
                     ix3 = PeriodicBC(), ox3 = PeriodicBC())

The boundary conditions of the six domain faces (i/o = inner/outer side, per direction), stored once for the whole domain — each block derives its face status from its position. Periodicity must pair up: both faces of a direction are periodic or neither is. Conditions on singleton directions are ignored.

using Aether

BoundaryConditions(ix1 = ReflectBC(), ox1 = OutflowBC())

# output
BoundaryConditions
├── x1: ReflectBC() / OutflowBC()
├── x2: PeriodicBC() / PeriodicBC()
└── x3: PeriodicBC() / PeriodicBC()
source