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

Method integrate_field_function

python/simulation.py:4366–4384  ·  view source on GitHub ↗

Returns the integral of the complex-valued function `func` over the `Volume` specified by `where` (defaults to entire cell) for the `meep::fields` contained in the `Simulation` instance that calls this method. `func` is a function of position (a `Vector3`, its first

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

Source from the content-addressed store, hash-verified

4364 return where
4365
4366 def integrate_field_function(self, cs, func, where=None, center=None, size=None):
4367 """
4368 Returns the integral of the complex-valued function `func` over the `Volume`
4369 specified by `where` (defaults to entire cell) for the `meep::fields` contained in
4370 the `Simulation` instance that calls this method. `func` is a function of position
4371 (a `Vector3`, its first argument) and zero or more field components specified by
4372 `cs`: a list of `component` constants. `func` can be real- or complex-valued. The
4373 volume can optionally be specified via the `center` and `size` arguments.
4374
4375 If any dimension of `where` is zero, that dimension is not integrated over. In
4376 this way you can specify 1d, 2d, or 3d integrals.
4377
4378 Note: in cylindrical coordinates $(r,\\phi,z)$, the integrand is
4379 [multiplied](https://en.wikipedia.org/wiki/Cylindrical_coordinate_system#Line_and_volume_elements)
4380 by the circumference $2\\pi r$, or equivalently the integral is over an annular
4381 volume.
4382 """
4383 where = self._get_field_function_volume(where, center, size)
4384 return self.fields.integrate([cs, func], where)
4385
4386 def integrate2_field_function(
4387 self, fields2, cs1, cs2, func, where=None, center=None, size=None

Callers 6

test_array_metadataMethod · 0.95
convex_circleMethod · 0.95
spiral_gdsMethod · 0.95

Calls 2

integrateMethod · 0.80

Tested by 6

test_array_metadataMethod · 0.76
convex_circleMethod · 0.76
spiral_gdsMethod · 0.76