File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
- Autograd support for local field projections using ` FieldProjectionKSpaceMonitor ` .
12
12
- Function ` components.geometry.utils.flatten_groups ` now also flattens transformed groups when requested.
13
13
14
+ ### Changed
15
+ - ` CustomMedium ` design regions require far less data when performing inverse design by reducing adjoint field monitor size for dims with one pixel.
16
+
14
17
### Fixed
15
18
- Regression in local field projection leading to incorrect results for ` far_field_approx=True ` .
16
19
- Bug when differentiating with respect to ` Cylinder.center ` .
Original file line number Diff line number Diff line change @@ -222,6 +222,20 @@ def make_adjoint_monitors(
222
222
if isinstance (self .geometry , PolySlab ):
223
223
size [self .geometry .axis ] = 0
224
224
225
+ # custom medium only needs fields at center locations of unit cells.
226
+ if isinstance (self .medium , CustomMedium ):
227
+ for axis , dim in enumerate ("xyz" ):
228
+ if self .medium .permittivity is not None :
229
+ if len (self .medium .permittivity .coords [dim ]) == 1 :
230
+ size [axis ] = 0
231
+ if self .medium .eps_dataset is not None :
232
+ zero_size = True
233
+ for _ , fld in self .medium .eps_dataset .field_components .items ():
234
+ if len (fld .coords [dim ]) != 1 :
235
+ zero_size = False
236
+ if zero_size :
237
+ size [axis ] = 0
238
+
225
239
mnt_fld = FieldMonitor (
226
240
size = size ,
227
241
center = center ,
You can’t perform that action at this time.
0 commit comments