Skip to content

Commit

Permalink
Reduce computation time massively in large het_map objects by avoidin…
Browse files Browse the repository at this point in the history
…g the recalculation of the delaunay triangulation for every findex
  • Loading branch information
Bartdoekemeijer committed Nov 13, 2024
1 parent 440549c commit 8122a09
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions floris/core/flow_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,18 +290,21 @@ def generate_heterogeneous_wind_map(self):
# Compute the 3-dimensional interpolants for each wind direction
# Linear interpolation is used for points within the user-defined area of values,
# while the freestream wind speed is used for points outside that region
in_region = [
self.interpolate_multiplier_xyz(x, y, z, multiplier, fill_value=1.0)
for multiplier in speed_multipliers
]
F = self.interpolate_multiplier_xyz(x, y, z, speed_multipliers[0], fill_value=1.0)
in_region = []
for multiplier in speed_multipliers:
F.values = multiplier
in_region.append(copy.deepcopy(F))

else:
# Compute the 2-dimensional interpolants for each wind direction
# Linear interpolation is used for points within the user-defined area of values,
# while the freestream wind speed is used for points outside that region
in_region = [
self.interpolate_multiplier_xy(x, y, multiplier, fill_value=1.0)
for multiplier in speed_multipliers
]
self.interpolate_multiplier_xy(x, y, multiplier, fill_value=1.0)
in_region = []
for multiplier in speed_multipliers:
F.values = multiplier
in_region.append(copy.deepcopy(F))

self.het_map = in_region

Expand Down

0 comments on commit 8122a09

Please sign in to comment.