-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in FourierFlows.getaliasedwavenumbers
?
#284
Comments
Doesn't |
Yes, but |
Perhaps when this function was first made we were only thinking of |
It's independent of the direction. We have But it certainly would throw an error that I was just confused about what the issue was. The issue is not that |
Yes, but the function was not throwing any error. However, when I called it as malias, _ = getaliasedwavenumbers(nm, nm, aliasfraction) to get the aliased wavenumbers in Sorry, I should have been more explicit in the bug description. |
I don't see FourierFlows.jl/src/domains.jl Lines 302 to 316 in a4bcb46
What am I missing? |
Perhaps we do not have a test that accesses the second branch in line 312? It would seem that we usually call line 313 in which case there is no error. Fine to merge either way of course. |
You are asking why the function does not complain? I guess because we always call it from within the grid constructor and |
Actually now that I'm thinking about it, what is this second branch? I'd expect that a better structure of this function should be: aliasfraction < 1 || error("`aliasfraction` must be less than 1") # aliasfraction=1 is not sensible.
aliasfraction >= 0 || error("`aliasfraction` must be non-negative")
kalias = iL:iR
kralias = iL:nkr |
What about the case |
Shouldn't the second branch then be:
because as it is now, it returns just the number |
Hmm I think that's reversed logic: if |
I feel that
FourierFlows.jl/src/domains.jl
Line 312 in a4bcb46
contains a typo and it should instead be
Int(nk/2+1)
.The text was updated successfully, but these errors were encountered: