File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -249,16 +249,17 @@ def make_adjoint_monitors(
249
249
) -> (FieldMonitor , PermittivityMonitor ):
250
250
"""Generate the field and permittivity monitor for this structure."""
251
251
252
- box = self .geometry .bounding_box
252
+ geometry = self .geometry
253
+ box = geometry .bounding_box
253
254
254
255
# we dont want these fields getting traced by autograd, otherwise it messes stuff up
255
256
256
257
size = [get_static (x ) for x in box .size ] # TODO: expand slightly?
257
258
center = [get_static (x ) for x in box .center ]
258
259
259
260
# polyslab only needs fields at the midpoint along axis
260
- if isinstance (self . geometry , PolySlab ):
261
- size [self . geometry .axis ] = 0
261
+ if isinstance (geometry , PolySlab ) and not isinstance ( self . medium , AbstractCustomMedium ):
262
+ size [geometry .axis ] = 0
262
263
263
264
mnt_fld = FieldMonitor (
264
265
size = size ,
You can’t perform that action at this time.
0 commit comments