Skip to content
Projects

Particle boundaries

The equations of simgeometry.simulation_domain, declared on the code that implements them and checked by the tests.

apply_bc_arrays

functionsource

Apply particle boundaries and return markers reinjected this push.

sides
below  ⟺  x<l,above  ⟺  x>u(x≥u on a periodic upper side)\text{below} \iff x < l, \qquad \text{above} \iff x > u \quad (x \ge u \text{ on a periodic upper side})
reflect
x←2b−x,v←−vx \leftarrow 2b - x, \qquad v \leftarrow -v
periodic
x←l+(x−l) mod (u−l),x=u↦lx \leftarrow l + (x - l) \bmod (u - l), \qquad x = u \mapsto l
kill
alive←alive∧l≤x<uafter every axis\text{alive} \leftarrow \text{alive} \land l \le x < u \quad \text{after every axis}
Assumes
  • per axis in order, on alive markers not flagged for reinjection; bb the side crossed
  • kill (code 0), reflect (1), periodic (2), reinject (3): a reinjected marker gets a new position from the injection zone
  • a marker on a non-periodic upper side is killed, not reflected; a reflection that still lands outside kills the marker