Skip to content

Commit

Permalink
periods for near2far adjoint (#2321)
Browse files Browse the repository at this point in the history
* periods for near2far adjoint

* periods for near2far adjoint

Co-authored-by: Mo Chen <[email protected]>
  • Loading branch information
mochen4 and Mo Chen authored Dec 1, 2022
1 parent 7adcc84 commit 9473d31
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/adjoint/objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ def __init__(
sim: mp.Simulation,
Near2FarRegions: List[mp.Near2FarRegion],
far_pts: List[mp.Vector3],
nperiods: Optional[int] = 1,
decimation_factor: Optional[int] = 0,
norm_near_fields: Optional[NearToFarData] = None,
):
Expand All @@ -400,12 +401,14 @@ def __init__(
self._nfar_pts = len(far_pts)
self.decimation_factor = decimation_factor
self.norm_near_fields = norm_near_fields
self.nperiods = nperiods

def register_monitors(self, frequencies):
self._frequencies = np.asarray(frequencies)
self._monitor = self.sim.add_near2far(
self._frequencies,
*self.Near2FarRegions,
nperiods=self.nperiods,
decimation_factor=self.decimation_factor,
)
if self.norm_near_fields is not None:
Expand Down

0 comments on commit 9473d31

Please sign in to comment.