MCPcopy Create free account
hub / github.com/NanoComp/meep / __init__

Method __init__

python/adjoint/objective.py:311–343  ·  view source on GitHub ↗

Initialize an instance of differentiable Fourier fields instance. Args: sim: the Meep simulation object of the problem. volume: the volume over which the eigenmode coefficient is calculated. Due to an unresolved bug, the size must not be zero in at least one

(
        self,
        sim: mp.Simulation,
        volume: mp.Volume,
        component: int,
        yee_grid: Optional[bool] = False,
        decimation_factor: Optional[int] = 0,
        subtracted_dft_fields: Optional[FluxData] = None,
    )

Source from the content-addressed store, hash-verified

309 """A differentiable frequency-dependent Fourier fields (dft_fields)"""
310
311 def __init__(
312 self,
313 sim: mp.Simulation,
314 volume: mp.Volume,
315 component: int,
316 yee_grid: Optional[bool] = False,
317 decimation_factor: Optional[int] = 0,
318 subtracted_dft_fields: Optional[FluxData] = None,
319 ):
320 """Initialize an instance of differentiable Fourier fields instance.
321
322 Args:
323 sim: the Meep simulation object of the problem.
324 volume: the volume over which the eigenmode coefficient is calculated. Due to an unresolved bug,
325 the size must not be zero in at least one direction.
326 component: field component (e.g. mp.Ex, mp.Hz, etc.) of the Fourier fields
327 yee_grid: if True, the Fourier fields are evaluated at the corresponding Yee grid points;
328 otherwise, they are interpolated fields at the center of each voxel. Default is False
329 decimation_factor: An integer used to specify the number of timesteps between updates of
330 the DFT fields. The default is 0, at which the value is automatically determined from the
331 Nyquist rate of the bandwidth-limited sources and the DFT monitor. It can be turned off
332 by setting it to 1.
333 subtracted_dft_fields: the DFT fields obtained using `get_flux_data` from
334 a previous normalization run. This is subtracted from the DFT fields
335 of this mode monitor in order to improve the accuracy of the
336 reflectance measurement (i.e., the $S_{11}$ scattering parameter). Default is None.
337 """
338 super().__init__(sim)
339 self.volume = sim._fit_volume_to_simulation(volume)
340 self.component = component
341 self.yee_grid = yee_grid
342 self.decimation_factor = decimation_factor
343 self.subtracted_dft_fields = subtracted_dft_fields
344
345 def register_monitors(self, frequencies):
346 self._frequencies = np.asarray(frequencies)

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45

Tested by

no test coverage detected