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

Method max_abs_field_function

python/simulation.py:4421–4441  ·  view source on GitHub ↗

As `integrate_field_function`, but returns the maximum absolute value of `func` in the volume `where` instead of its integral. The integration is performed by summing over the grid points with a simple trapezoidal rule, and the maximum is similarly over the grid poi

(self, cs, func, where=None, center=None, size=None)

Source from the content-addressed store, hash-verified

4419 return self.fields.integrate2(fields2, [cs1, cs2, func], where)
4420
4421 def max_abs_field_function(self, cs, func, where=None, center=None, size=None):
4422 """
4423 As `integrate_field_function`, but returns the maximum absolute value of `func` in
4424 the volume `where` instead of its integral.
4425
4426 The integration is performed by summing over the grid points with a simple
4427 trapezoidal rule, and the maximum is similarly over the grid points. See [Field
4428 Functions](Field_Functions.md) for examples of how to call
4429 `integrate_field_function` and `max_abs_field_function`. See [Synchronizing the
4430 Magnetic and Electric Fields](Synchronizing_the_Magnetic_and_Electric_Fields.md)
4431 if you want to do computations combining the electric and magnetic fields. The
4432 volume can optionally be specified via the `center` and `size` arguments.
4433
4434 Occasionally, one wants to compute an integral that combines fields from two
4435 separate simulations (e.g. for nonlinear coupled-mode calculations). This
4436 functionality is supported in Meep, as long as the two simulations have the *same*
4437 cell, the same resolution, the same boundary conditions and symmetries (if any),
4438 and the same PML layers (if any).
4439 """
4440 where = self._get_field_function_volume(where, center, size)
4441 return self.fields.max_abs([cs, func], where)
4442
4443 def change_k_point(self, k):
4444 """

Callers 2

test_array_metadataMethod · 0.95

Calls 2

max_absMethod · 0.80

Tested by 2

test_array_metadataMethod · 0.76