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

Method _add_mode_monitor

python/simulation.py:3547–3571  ·  view source on GitHub ↗
(self, freq, fluxes, yee_grid, decimation_factor)

Source from the content-addressed store, hash-verified

3545 return flux
3546
3547 def _add_mode_monitor(self, freq, fluxes, yee_grid, decimation_factor):
3548 if self.fields is None:
3549 self.init_sim()
3550
3551 if len(fluxes) != 1:
3552 raise ValueError(
3553 "add_mode_monitor expected just one ModeRegion. Got {}".format(
3554 len(fluxes)
3555 )
3556 )
3557
3558 region = fluxes[0]
3559 centered_grid = not yee_grid
3560 v = mp.Volume(
3561 region.center,
3562 region.size,
3563 dims=self.dimensions,
3564 is_cylindrical=self.is_cylindrical,
3565 )
3566 d0 = region.direction
3567 d = self.fields.normal_direction(v.swigobj) if d0 < 0 else d0
3568
3569 return self.fields.add_mode_monitor(
3570 d, v.swigobj, freq, centered_grid, decimation_factor
3571 )
3572
3573 def display_fluxes(self, *fluxes):
3574 """

Callers

nothing calls this directly

Calls 3

init_simMethod · 0.95
normal_directionMethod · 0.45
add_mode_monitorMethod · 0.45

Tested by

no test coverage detected