Skip to content

Fix division by zero in PolygonBoundaryComp

Ernestas Simutis requested to merge ernim/TopFarm2:fix-div-by-zero into master

I was running the wind_farm_cluster notebook and these warning are indicating division by zero:

c:\sandbox\repo\topfarm\topfarm2\topfarm\constraint_components\boundary.py:472: RuntimeWarning: invalid value encountered in divide
  ddist_dxy[:, use_B] = sign_use_B * (BP[:, use_B] / vec_len(BP[:, use_B]))

Just added an epsilon to the divisor

Merge request reports

Loading