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

Method update_design

python/adjoint/optimization_problem.py:539–554  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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."""

Callers 3

__call__Method · 0.95
run_shape_optimizationFunction · 0.80

Calls 3

update_betaMethod · 0.80
reset_meepMethod · 0.80

Tested by

no test coverage detected