-
Notifications
You must be signed in to change notification settings - Fork 25
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
Inverse Laplace ∇⁻²! via kernel in ∇²! #142
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
@@ -182,8 +181,6 @@ function SpectralTransform( ::Type{NF}, # Number format NF | |||
|
|||
# EIGENVALUES (on unit sphere, hence 1/radius²-scaling is omitted) | |||
eigenvalues = [-l*(l+1) for l in 0:lmax+1] | |||
eigenvalues⁻¹ = inv.(eigenvalues) | |||
eigenvalues⁻¹[1] = 0 # set the integration constant to 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realised that we shouldn't replace eigenvalues⁻¹
by 1/eigenvalues
as that makes the integration constant infinity. We currently don't test for this (and it's not used by the dynamical core atm) hence the tests still pass
julia> alms = LowerTriangularMatrix(randn(ComplexF32,33,32));
julia> alms[:,1] .= real.(alms[:,1]);
julia> ∇⁻²alms = copy(alms)
julia> S = SpectralTransform(alms);
julia> SpeedyWeather.∇²!(∇⁻²alms,alms,S,inverse=true)
33×32 LowerTriangularMatrix{ComplexF32}:
-Inf+NaN*im 0.0+0.0im … 0.0+0.0im
-0.369622-0.0im 0.199208-0.408254im 0.0+0.0im
...
I am on vacation for a week. I can look into it when I am back, if you don’t do it until then. |
Don't worry, I'll resolve that, just don't merge it yet. Enjoy your vacation 🌴 |
Also @maximilian-gelbrecht, a little change I made in |
Great, thanks @milankl |
fixes #141