From 3be89321ee1300b00797efc827a75cc85f80e8fa Mon Sep 17 00:00:00 2001 From: Edoardo Vergerio Date: Sun, 24 May 2026 22:45:15 +0200 Subject: [PATCH] the stop condition on the normalization run needs to be better analyzed. Specifically, we should understand where to position the monitor point. Before, it was in a far field point, outside the simulation cell. I've seen the simulation does not converge, at first glance. Now I'll try position it in a real physical point inside the cell. Let's see if it converges in a different way. --- metapeg_v2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metapeg_v2.py b/metapeg_v2.py index 69be6a2..c6395aa 100644 --- a/metapeg_v2.py +++ b/metapeg_v2.py @@ -75,7 +75,7 @@ xs = ys = np.linspace(-ff_monitor_size.x/2, ff_monitor_size.x/2, NX_DESIGN_GRID) #collection of points in the far-field monitor ff_points = [mp.Vector3(x_p,y_p,ff_monitor_center.z) for x_p in xs for y_p in ys] -stop_cond = mp.stop_when_fields_decayed(50, mp.Ex, ff_monitor_center, 1e-6) +stop_cond = mp.stop_when_fields_decayed(50, mp.Ex, NEAR_REGION_MONITOR_CENTER, 1e-6) pml_layers = [mp.PML(PML_UM)] frequencies = [1/wavelength for wavelength in DESIGN_WAVELENGTHS_UM]