Skip to content

Commit c401d29

Browse files
dbochkov-flexcomputemomchil-flex
authored andcommitted
polishing automatic simulation reduction for mode solver
1 parent 5b64306 commit c401d29

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

tidy3d/plugins/mode/mode_solver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ def reduced_simulation_copy(self):
973973
This might significantly reduce upload time in the presence of custom mediums.
974974
"""
975975

976-
# we preserve extracells along the normal direction to ensure there is enough data for
976+
# we preserve extra cells along the normal direction to ensure there is enough data for
977977
# subpixel
978978
extended_grid = self._get_solver_grid(preserve_layer_behind=True, truncate_symmetry=False)
979979
grids_1d = extended_grid.boundaries

tidy3d/web/api/mode.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ def run(
8686
console = get_logging_console()
8787

8888
if reduce_simulation == "auto":
89-
sim = mode_solver.simulation
90-
contains_custom = any(isinstance(s.medium, AbstractCustomMedium) for s in sim.structures)
91-
contains_custom = contains_custom or isinstance(sim.medium, AbstractCustomMedium)
89+
sim_mediums = mode_solver.simulation.scene.mediums
90+
contains_custom = any(isinstance(med, AbstractCustomMedium) for med in sim_mediums)
9291
reduce_simulation = contains_custom
9392

9493
if reduce_simulation:

0 commit comments

Comments
 (0)