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,
)
| 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: |