Update the design permittivity function. rho_vector ....... a list of numpy arrays that maps to each design region
(self, rho_vector: List[float], beta: float = None)
| 537 | return fd_gradient, fd_gradient_idx |
| 538 | |
| 539 | def update_design(self, rho_vector: List[float], beta: float = None) -> None: |
| 540 | """Update the design permittivity function. |
| 541 | |
| 542 | rho_vector ....... a list of numpy arrays that maps to each design region |
| 543 | """ |
| 544 | for bi, b in enumerate(self.design_regions): |
| 545 | if np.array(rho_vector[bi]).ndim > 1: |
| 546 | raise ValueError( |
| 547 | "Each vector of design variables must contain only one dimension." |
| 548 | ) |
| 549 | b.update_design_parameters(rho_vector[bi]) |
| 550 | if beta: |
| 551 | b.update_beta(beta) |
| 552 | |
| 553 | self.sim.reset_meep() |
| 554 | self.current_state = "INIT" |
| 555 | |
| 556 | def get_objective_arguments(self) -> List[float]: |
| 557 | """Return list of evaluated objective arguments.""" |
no test coverage detected