Skip to content

Add convolutional PML (CPML) and fix PEC-mask handling at the PML interface - #163

Merged
ajnonaka merged 3 commits into
AMReX-Microelectronics:developmentfrom
ajnonaka:CPML
Nov 9, 2026
Merged

ajnonaka merged 3 commits into
AMReX-Microelectronics:developmentfrom
ajnonaka:CPML

Conversation

@ajnonaka

@ajnonaka ajnonaka commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Adds an unsplit convolutional PML (Roden & Gedney) for the Yee FDTD solver, selected with warpx.pml_type = convolutional. The default remains split.

Also fixes a bug in how the PEC mask (algo.use_PEC_mask) is applied, which affects split-field runs too (see below).

CPML
-CPML E, B and H (LLG) updates in the existing PML boxes, using the same σ profile as the split-field PML (warpx.pml_ncell, warpx.pml_delta). The total field is stored in component 0, so the existing exchange, fill-boundary, PEC and checkpoint code is reused.
-Works with spatially varying ε, μ and σ, using the same Lax-Wendroff or backward-Euler material update as the interior.
-Supports the PEC mask and its extension into the PML, including a second layer (sigma_npy_file2, npy_k_index2).
Optional stretching parameters warpx.cpml_kappa_max and warpx.cpml_alpha_max, plus their grading orders.
-The CPML auxiliary variables are written to checkpoints, so restarts reproduce an uninterrupted run exactly.
Aborts for unsupported combinations: CKC, nodal or PSATD solvers, divergence cleaning in the PML, J-damping, moving window.

PEC-mask fix (changes results of existing use_PEC_mask runs)
-Before: the main-grid E was masked only after the guard-cell/PML exchange. The exchange therefore sent unmasked tangential E on PEC edges to the PML and to neighbouring grid boxes. The next B update saw inconsistent E across the PML interface along the PEC layer. This caused an instability that showed up as NaNs at the PEC layer next to the PML in long runs.
-Now: the main-grid E is masked right after its update, before the exchange. It is still masked again after the excitation, so masked edges stay exactly zero.
-This applies to both PML types, so results of existing PEC-mask runs will change slightly.

New inputs
warpx.pml_type: split (default) or convolutional
warpx.cpml_kappa_max (default 1), warpx.cpml_alpha_max (1/s, default 0), warpx.cpml_grading_order (default 2), warpx.cpml_alpha_grading_order (default 1)
algo.extend_PEC_mask_into_pml (default 1, same behaviour as before; 0 = no PEC mask in the PML)

All are documented in parameters.rst.

Testing (3D, GCC, CPU)
-Reflection compared against a large-domain reference for vacuum, uniform ε_r = 11.7, a layered substrate, and a microstrip defined by a PEC mask. With default settings the CPML matches the split-field PML in each case. Tuned settings (pml_delta = 17 plus small κ/α) reduce reflection by up to about 3×.
-PEC strip running into a lo-x CPML (5.5 GHz soft source):
--before the fix, the PML field blew up within 30k (tuned) to 180k (default) steps;
--after the fix, it stayed stable to 500k steps (tuned) and 210k steps (default, end of run).
-Two PEC layers: stable for 60k steps.
-Restart: checkpoint/restart is bit-identical.
-Other builds: LLG and 2D XZ syntax-checked only, not run. GPU and Windows builds not tested locally.

…e the exchange. The mask after the excitation is still applied, so masked edges stay exactly zero.

new feature: algo.extend_PEC_mask_into_pml (default 1, same behaviour as before). Set it to 0 to have no PEC mask in the PML.
@ajnonaka
ajnonaka marked this pull request as ready for review November 9, 2026 19:18
@ajnonaka ajnonaka changed the title CPML Add convolutional PML (CPML) and fix PEC-mask handling at the PML interface Nov 9, 2026
@ajnonaka
ajnonaka merged commit 3f55573 into AMReX-Microelectronics:development Nov 9, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant