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

Method initialize_field

python/simulation.py:2529–2541  ·  view source on GitHub ↗

Initialize the component `c` fields using the function `func` which has a single argument, a `Vector3` giving a position and returns a complex number for the value of the field at that point.

(
        self,
        cmpnt: int = None,
        amp_func: Callable[[Vector3Type], Union[float, complex]] = None,
    )

Source from the content-addressed store, hash-verified

2527 return not (self.force_complex_fields or cond1 or cond2 or cond5)
2528
2529 def initialize_field(
2530 self,
2531 cmpnt: int = None,
2532 amp_func: Callable[[Vector3Type], Union[float, complex]] = None,
2533 ):
2534 """
2535 Initialize the component `c` fields using the function `func` which has a single
2536 argument, a `Vector3` giving a position and returns a complex number for the value
2537 of the field at that point.
2538 """
2539 if self.fields is None:
2540 self.init_sim()
2541 self.fields.initialize_field(cmpnt, amp_func)
2542
2543 def require_dimensions(self):
2544 if self.structure is None:

Callers 2

test_multilevel_atomMethod · 0.95
multilevel-atom.pyFile · 0.45

Calls 1

init_simMethod · 0.95

Tested by 1

test_multilevel_atomMethod · 0.76