Construct a `CustomSource`. + **`src_func` [`function`]** — The function $f(t)$ specifying the time-dependence of the source. It should take one argument (the time in Meep units) and return a complex number. + **`start_time` [`number`]** — The starting
(
self,
src_func,
start_time=-1.0e20,
end_time=1.0e20,
is_integrated=False,
center_frequency=0,
fwidth=0,
**kwargs,
)
| 353 | """ |
| 354 | |
| 355 | def __init__( |
| 356 | self, |
| 357 | src_func, |
| 358 | start_time=-1.0e20, |
| 359 | end_time=1.0e20, |
| 360 | is_integrated=False, |
| 361 | center_frequency=0, |
| 362 | fwidth=0, |
| 363 | **kwargs, |
| 364 | ): |
| 365 | """ |
| 366 | Construct a `CustomSource`. |
| 367 | |
| 368 | + **`src_func` [`function`]** — The function $f(t)$ specifying the time-dependence |
| 369 | of the source. It should take one argument (the time in Meep units) and return a |
| 370 | complex number. |
| 371 | |
| 372 | + **`start_time` [`number`]** — The starting time for the source. Default is |
| 373 | -10<sup>20</sup>: turn on at $t=-\\infty$. Note, however, that the simulation |
| 374 | normally starts at $t=0$ with zero fields as the initial condition, so there is |
| 375 | implicitly a sharp turn-on at $t=0$ whether you specify it or not. |
| 376 | |
| 377 | + **`end_time` [`number`]** — The end time for the source. Default is |
| 378 | 10<sup>20</sup> (never turn off). |
| 379 | |
| 380 | + **`is_integrated` [`boolean`]** — If `True`, the source is the integral of the |
| 381 | current (the [dipole |
| 382 | moment](https://en.wikipedia.org/wiki/Electric_dipole_moment)) which is |
| 383 | guaranteed to be zero after the current turns off. In practice, there is little |
| 384 | difference between integrated and non-integrated sources *except* for |
| 385 | [planewaves extending into |
| 386 | PML](Perfectly_Matched_Layer.md#planewave-sources-extending-into-pml). Default |
| 387 | is `False`. |
| 388 | |
| 389 | + **`center_frequency` [`number`]** — Optional center frequency so that the |
| 390 | `CustomSource` can be used within an `EigenModeSource`. Defaults to 0. |
| 391 | |
| 392 | + **`fwidth` [`number`]** — Optional bandwidth in frequency units. |
| 393 | Default is 0. For bandwidth-limited sources, this parameter is used to |
| 394 | automatically determine the decimation factor of the time-series updates |
| 395 | of the DFT fields monitors (if any). |
| 396 | """ |
| 397 | super().__init__(is_integrated=is_integrated, **kwargs) |
| 398 | self.src_func = src_func |
| 399 | self.start_time = start_time |
| 400 | self.end_time = end_time |
| 401 | self.fwidth = fwidth |
| 402 | self.center_frequency = center_frequency |
| 403 | self.swigobj = mp.custom_py_src_time( |
| 404 | src_func, start_time, end_time, center_frequency, fwidth |
| 405 | ) |
| 406 | self.swigobj.is_integrated = self.is_integrated |
| 407 | |
| 408 | |
| 409 | class EigenModeSource(Source): |
nothing calls this directly
no test coverage detected