File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,17 @@ def is_plane(cls, val):
98
98
_freqs_not_empty = validate_freqs_not_empty ()
99
99
_freqs_lower_bound = validate_freqs_min ()
100
100
101
+ @pydantic .validator ("plane" , always = True )
102
+ def plane_in_sim_bounds (cls , val , values ):
103
+ """Check that the plane is at least partially inside the simulation bounds."""
104
+ sim_center = values .get ("simulation" ).center
105
+ sim_size = values .get ("simulation" ).size
106
+ sim_box = Box (size = sim_size , center = sim_center )
107
+
108
+ if not sim_box .intersects (val ):
109
+ raise SetupError ("'ModeSolver.plane' must intersect 'ModeSolver.simulation'." )
110
+ return val
111
+
101
112
@cached_property
102
113
def normal_axis (self ) -> Axis :
103
114
"""Axis normal to the mode plane."""
You can’t perform that action at this time.
0 commit comments