-
Notifications
You must be signed in to change notification settings - Fork 27
Description
When reading boundary data, the points file isn't always read correctly and thus it stops at an assertion. The function that reads the points file has this comment:
https://github.com/NREL/windtools/blob/f18bbc11f7e883104443f7e8ffd6a7b519e073ad/windtools/SOWFA6/constant/boundaryData.py#L147-L149
but it does make assumptions on the ordering. In this function, the user can specify the number of points in the two directions and the code assumes certain order by doing
https://github.com/NREL/windtools/blob/f18bbc11f7e883104443f7e8ffd6a7b519e073ad/windtools/SOWFA6/constant/boundaryData.py#L158
If the user doesn't pass the number of points-- or rather, the points are in fact scrambled and the reshape above is not desirable-- it assumes one of the dimensions is varying faster in an ordered manner:
https://github.com/NREL/windtools/blob/f18bbc11f7e883104443f7e8ffd6a7b519e073ad/windtools/SOWFA6/constant/boundaryData.py#L159-L161
or,
The issue is that it assumes that the slow-varying dimension is ordered. The number of points in the slow-varying dimension, obtained with, for example, NY = np.nonzero(zlist > zlist[0])[0][0] only gives the correct number of points in that dimension when zlist is equal to np.sort(zlist). The re-ordering index obtained by reading points need to be carried forward and used when reading the actual files U, T,`k', etc.