Avoid dirty trick if unnecessary
This commit is contained in:
parent
1311db53f7
commit
797f6f0cd4
|
|
@ -177,7 +177,9 @@ function calculateNucleonDensity(p::Bool, s::system)::Tuple{Vector{Float64}, Vec
|
|||
|
||||
r2s = s.r_mesh.r .^ 2
|
||||
ρ = ρr2 ./ transpose(r2s)
|
||||
ρ[:, 1] .= ρ[:, 2] # dirty fix for NaN at r=0
|
||||
if !all(isfinite.(ρ[:, 1]))
|
||||
ρ[:, 1] .= ρ[:, 2] # dirty fix for NaN at r=0
|
||||
end
|
||||
|
||||
ρ_s = ρ[1, :] - ρ[2, :] # g^2 - f^2
|
||||
ρ_v = ρ[1, :] + ρ[2, :] # g^2 + f^2
|
||||
|
|
|
|||
Loading…
Reference in New Issue