PLUV.jl take computation of I outside of loop

This commit is contained in:
Gaspard Jankowiak 2024-03-15 13:43:38 +01:00
parent 94c05c3d6f
commit 248db3bc68

View file

@ -280,11 +280,12 @@ function intensity(P::AbstractArray{Float64}, q)
############### Ensemble average ############### Ensemble average
# multiply each columns of Am by Normal and sum along the columns, # multiply each columns of Am by Normal and sum along the columns,
# then multiply by integration step # then multiply by integration step
I = vec(sum(Am .^ 2 .* Normal'; dims=2)) * integration_step
alp = Rm / (Z + 1)
return @. (Norm * nv * 1e-6) * I * (16 * pi^2 * mu4(q, Z, alp)) + Con * (0.99 * (1.0 / (1 + exp(-8 * (q - 1.0)))) + 0.01)
end end
I = vec(sum(Am .^ 2 .* Normal'; dims=2)) * integration_step
alp = Rm / (Z + 1)
return @. (Norm * nv * 1e-6) * I * (16 * pi^2 * mu4(q, Z, alp)) + Con * (0.99 * (1.0 / (1 + exp(-8 * (q - 1.0)))) + 0.01)
end end
################## ##################