Skip to content

Commit

Permalink
fix pml post init validator and docstring test
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerflex authored and momchil-flex committed Mar 24, 2023
1 parent d3bac95 commit 6409f56
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tidy3d/components/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Simulation(Box): # pylint:disable=too-many-public-methods
>>> from tidy3d import GridSpec, AutoGrid
>>> from tidy3d import BoundarySpec, Boundary
>>> sim = Simulation(
... size=(2.0, 2.0, 2.0),
... size=(3.0, 3.0, 3.0),
... grid_spec=GridSpec(
... grid_x = AutoGrid(min_steps_per_wvl = 20),
... grid_y = AutoGrid(min_steps_per_wvl = 20),
Expand All @@ -82,7 +82,7 @@ class Simulation(Box): # pylint:disable=too-many-public-methods
... run_time=40e-11,
... structures=[
... Structure(
... geometry=Box(size=(1, 1, 1), center=(-1, 0, 0)),
... geometry=Box(size=(1, 1, 1), center=(0, 0, 0)),
... medium=Medium(permittivity=2.0),
... ),
... ],
Expand Down Expand Up @@ -824,11 +824,11 @@ def _validate_no_structures_pml(self) -> None:
bound_spec = self.boundary_spec.to_list
for i, structure in enumerate(self.structures):
geo_bounds = structure.geometry.bounds
for sim_bound, geo_bound, pml_thick, bound_dim in zip(
sim_bounds, geo_bounds, pml_thicks, bound_spec
for sim_bound, geo_bound, pml_thick, bound_dim, pm_val in zip(
sim_bounds, geo_bounds, pml_thicks, bound_spec, (-1, 1)
):
for sim_pos, geo_pos, pml, pm_val, bound_edge in zip(
sim_bound, geo_bound, pml_thick, (-1, 1), bound_dim
for sim_pos, geo_pos, pml, bound_edge in zip(
sim_bound, geo_bound, pml_thick, bound_dim
):
sim_pos_pml = sim_pos + pm_val * pml
in_pml_plus = (pm_val > 0) and (sim_pos < geo_pos <= sim_pos_pml)
Expand Down

0 comments on commit 6409f56

Please sign in to comment.