Verifies that the CW fields via the modal volume of a ring resonator are the same for the CW solver and time stepping using a pulsed source.
(self)
| 7 | |
| 8 | class TestArrayMetadata(ApproxComparisonTestCase): |
| 9 | def test_array_metadata(self): |
| 10 | """ |
| 11 | Verifies that the CW fields via the modal volume of a ring resonator |
| 12 | are the same for the CW solver and time stepping using a pulsed source. |
| 13 | """ |
| 14 | resolution = 25 |
| 15 | |
| 16 | n = 3.4 |
| 17 | w = 1 |
| 18 | r = 1 |
| 19 | pad = 4 |
| 20 | dpml = 2 |
| 21 | |
| 22 | sxy = 2 * (r + w + pad + dpml) |
| 23 | cell_size = mp.Vector3(sxy, sxy) |
| 24 | |
| 25 | nonpml_vol = mp.Volume( |
| 26 | mp.Vector3(), size=mp.Vector3(sxy - 2 * dpml, sxy - 2 * dpml) |
| 27 | ) |
| 28 | |
| 29 | geometry = [ |
| 30 | mp.Cylinder(radius=r + w, material=mp.Medium(index=n)), |
| 31 | mp.Cylinder(radius=r), |
| 32 | ] |
| 33 | |
| 34 | fcen = 0.118 |
| 35 | df = 0.08 |
| 36 | |
| 37 | symmetries = [mp.Mirror(mp.X, phase=-1), mp.Mirror(mp.Y, phase=+1)] |
| 38 | |
| 39 | pml_layers = [mp.PML(dpml)] |
| 40 | |
| 41 | # CW source |
| 42 | src = [ |
| 43 | mp.Source( |
| 44 | mp.ContinuousSource(fcen, fwidth=df), |
| 45 | mp.Ez, |
| 46 | mp.Vector3(r + 0.1), |
| 47 | ), |
| 48 | mp.Source( |
| 49 | mp.ContinuousSource(fcen, fwidth=df), |
| 50 | mp.Ez, |
| 51 | mp.Vector3(-(r + 0.1)), |
| 52 | amplitude=-1, |
| 53 | ), |
| 54 | ] |
| 55 | |
| 56 | sim = mp.Simulation( |
| 57 | cell_size=cell_size, |
| 58 | geometry=geometry, |
| 59 | sources=src, |
| 60 | resolution=resolution, |
| 61 | force_complex_fields=True, |
| 62 | symmetries=symmetries, |
| 63 | boundary_layers=pml_layers, |
| 64 | ) |
| 65 | |
| 66 | sim.init_sim() |
nothing calls this directly
no test coverage detected