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

Method __init__

python/adjoint/wrapper.py:95–119  ·  view source on GitHub ↗
(
        self,
        simulation: mp.Simulation,
        sources: List[mp.Source],
        monitors: List[EigenmodeCoefficient],
        design_regions: List[DesignRegion],
        frequencies: List[float],
        dft_threshold: float = 1e-11,
        minimum_run_time: float = 0,
        maximum_run_time: float = onp.inf,
        until_after_sources: bool = True,
        finite_difference_step: float = utils.FD_DEFAULT,
    )

Source from the content-addressed store, hash-verified

93 _log_fn = print
94
95 def __init__(
96 self,
97 simulation: mp.Simulation,
98 sources: List[mp.Source],
99 monitors: List[EigenmodeCoefficient],
100 design_regions: List[DesignRegion],
101 frequencies: List[float],
102 dft_threshold: float = 1e-11,
103 minimum_run_time: float = 0,
104 maximum_run_time: float = onp.inf,
105 until_after_sources: bool = True,
106 finite_difference_step: float = utils.FD_DEFAULT,
107 ):
108 self.simulation = simulation
109 self.sources = sources
110 self.monitors = monitors
111 self.design_regions = design_regions
112 self.frequencies = frequencies
113 self.dft_threshold = dft_threshold
114 self.minimum_run_time = minimum_run_time
115 self.maximum_run_time = maximum_run_time
116 self.until_after_sources = until_after_sources
117 self.finite_difference_step = finite_difference_step
118
119 self._simulate_fn = self._initialize_callable()
120
121 def __call__(self, designs: List[jnp.ndarray]) -> jnp.ndarray:
122 """Performs a Meep simulation, taking a list of designs and returning mode overlaps.

Callers

nothing calls this directly

Calls 1

_initialize_callableMethod · 0.95

Tested by

no test coverage detected