(self, freq, fluxes, yee_grid, decimation_factor)
| 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 | """ |
nothing calls this directly
no test coverage detected