Skip to content

Commit

Permalink
update interpolate_nu order to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrogantGao committed Apr 10, 2024
1 parent f1d5574 commit d840009
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/FFCT/interpolate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,18 @@ function interpolate_nu_cheb!(
q = qs[n]
revise_phase_neg!(phase_x, phase_y, k_x, k_y, x - L[1] / 2, y - L[2] / 2)

for k in 1:size(H_r, 3)
r_zk = r_z[k]
for j in 1:size(H_r, 2)
k_yj = k_y[j]
for i in 1:size(H_r, 1)
k_xi = k_x[i]
k2 = k_xi^2 + k_yj^2
if !(k2 zero(T))
phase = phase_x[i] * phase_y[j]
H_r[i, j, k] += q * phase * cheb_mat[i, j](abs(z - r_zk))

for j in 1:size(H_r, 2)
k_yj = k_y[j]
for i in 1:size(H_r, 1)
k_xi = k_x[i]
k2 = k_xi^2 + k_yj^2
if !(k2 zero(T))
phase = phase_x[i] * phase_y[j]
cheb_ij = cheb_mat[i, j]
for k in 1:size(H_r, 3)
r_zk = r_z[k]
H_r[i, j, k] += q * phase * cheb_ij(abs(z - r_zk))
end
end
end
Expand Down

0 comments on commit d840009

Please sign in to comment.