[fdmath] correct Gridlock Yee spacing order

Use center-to-center intervals for forward E derivatives and base-cell widths for backward H derivatives in the Gridlock examples. Document the distinction from meshes defined directly by forward intervals and fix the random fixture's backward averaging direction.

Add coordinate-derivative regression coverage for graded periodic and nonperiodic Gridlock meshes using both functional and sparse operators.

Validation: 1689 tests passed, 586 skipped; no new Ruff findings in changed Python files.
This commit is contained in:
Forgejo Actions 2026-10-28 17:32:21 -07:00
commit 282ed2c38b
10 changed files with 50 additions and 9 deletions

View file

@ -119,7 +119,7 @@ def main(
# Add SCPML stretching to the FDFD grid; this matches the CPML-backed FDTD
# run below so the two solvers see the same absorbing boundary profile.
dxes = [grid.dxyz, grid.autoshifted_dxyz()]
dxes = [grid.autoshifted_dxyz(), grid.dxyz]
for a in (0, 1, 2):
for p in (-1, 1):
dxes = scpml.stretch_with_scpml(dxes, omega=omega, axis=a, polarity=p, thickness=pml_thickness)
@ -269,7 +269,7 @@ def main2():
ee = numpy.zeros_like(epsilon, dtype=complex)
hh = numpy.zeros_like(epsilon, dtype=complex)
dxes = [grid.dxyz, grid.autoshifted_dxyz()]
dxes = [grid.autoshifted_dxyz(), grid.dxyz]
# PMLs in every direction
pml_params = [