tidy3d.plugins.adjoint.utils.penalty.RadiusPenalty#
- class RadiusPenalty[source]#
- Bases: - Penalty- Computes a penalty for small radius of curvature determined by a fit of points in a 2D plane. - Parameters:
- min_radius (float = 0.15) – [units = um]. Radius of curvature value below which the penalty ramps to its maximum value. 
- alpha (float = 1.0) – Parameter controlling the strength of the penalty. 
- kappa (float = 10.0) – [units = 1/um]. Parameter controlling the steepness of the penalty evaluation. 
- wrap (bool = False) – Whether to consider the first set of points as connected to the last. 
 
 - Note \[p(r) = \frac{\mathrm{exp}(-\kappa(r - r_{min}))}{1 + \mathrm{exp}(-\kappa(r - r_{min}))}\]- Note - This formula was described by A. Micheals et al. “Leveraging continuous material averaging for inverse electromagnetic design”, Optics Express (2018). - Attributes - Methods - evaluate(points)- Get the average penalty as a function of supplied (x, y) points by fitting a spline to the curve and evaluating local radius of curvature compared to a desired minimum value. - min_radius#
 - alpha#
 - kappa#
 - wrap#
 - evaluate(points)[source]#
- Get the average penalty as a function of supplied (x, y) points by fitting a spline to the curve and evaluating local radius of curvature compared to a desired minimum value. If - wrap, it is assumed that the points wrap around to form a closed geometry instead of an isolated line segment.
 - __hash__()#
- Hash method.