Skip to content

Commit 43891a8

Browse files
fix simulation
1 parent 44fc825 commit 43891a8

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

tidy3d/components/base_sim/simulation.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from ..medium import Medium, MediumType3D
1717
from ..scene import Scene
1818
from ..structure import Structure
19-
from ..types import TYPE_TAG_STR, Ax, Axis, Bound, LengthUnit, Symmetry
19+
from ..types import TYPE_TAG_STR, Ax, Axis, Bound, LengthUnit, PriorityMode, Symmetry
2020
from ..validators import assert_objects_in_sim_bounds, assert_unique_names
2121
from ..viz import (
2222
PlotParams,
@@ -115,6 +115,15 @@ class AbstractSimulation(Box, ABC):
115115
"include the desired unit specifier in labels.",
116116
)
117117

118+
structure_priority_mode: PriorityMode = pd.Field(
119+
"equal",
120+
title="Structure Priority Setting",
121+
description="This field only affects structures of `priority=None`. "
122+
"If `equal`, the priority of those structures is set to 0; if `conductor`, "
123+
"the priority of structures made of `LossyMetalMedium` is set to 90, "
124+
"`PECMedium` to 100, and others to 0.",
125+
)
126+
118127
""" Validating setup """
119128

120129
@pd.root_validator(pre=True)
@@ -184,7 +193,10 @@ def scene(self) -> Scene:
184193
"""Scene instance associated with the simulation."""
185194

186195
return Scene(
187-
medium=self.medium, structures=self.structures, plot_length_units=self.plot_length_units
196+
medium=self.medium,
197+
structures=self.structures,
198+
plot_length_units=self.plot_length_units,
199+
structure_priority_mode=self.structure_priority_mode,
188200
)
189201

190202
def get_monitor_by_name(self, name: str) -> AbstractMonitor:

0 commit comments

Comments
 (0)