Skip to content
Snippets Groups Projects
Verified Commit b77fb320 authored by Paul Dechamps's avatar Paul Dechamps :speech_balloon:
Browse files

(refactor) Fewer lines of code for smoothing

parent 794a4714
No related branches found
No related tags found
No related merge requests found
Pipeline #52428 failed
......@@ -518,15 +518,14 @@ class SolversInterface:
data_lw = np.delete(data_lw, np.where(np.isnan(data_lw[:, ndim-1])), axis=0)
dummy = np.row_stack((data_up, np.flip(data_lw, axis=0)))
# Ensure that there is only one point at the leading edge
dummy[0,ndim-1] = 0.5*(dummy[0,ndim-1] + dummy[-1,ndim-1])
dummy[-1,ndim-1] = dummy[0, ndim-1]
# Smooth leading edge
mask = dummy[:,0] < (0.1*(np.max(dummy[:,0]) - np.min(dummy[:,0])) + np.min(dummy[:,0]))
if 'smooth_sections' in self.cfg:
_s = self.cfg['smooth_sections']
else:
_s = 0.0
_s = self.cfg['smooth_sections'] if 'smooth_sections' in self.cfg else 0.0
spl_n, u_n = make_splprep([dummy[mask,0], dummy[mask,2]], s=_s)
dummy[mask, 0] = spl_n(u_n)[0]
dummy[mask, 2] = spl_n(u_n)[1]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment