mirror of
https://igit.ific.uv.es/alramos/latticegpu.jl.git
synced 2025-05-14 19:23:42 +02:00
CartesianIndex in reduction of Scalar action
This commit is contained in:
parent
4601626b5b
commit
6104bd7276
1 changed files with 6 additions and 3 deletions
|
@ -37,7 +37,7 @@ function krnl_act!(act, U::AbstractArray{TG}, Phi::AbstractArray{TS}, sp::Scalar
|
||||||
end
|
end
|
||||||
sync_threads()
|
sync_threads()
|
||||||
|
|
||||||
act[b,r] = zero(act[b,r])
|
S = zero(eltype(act))
|
||||||
for id in 1:N
|
for id in 1:N
|
||||||
bu, ru = up((b, r), id, lp)
|
bu, ru = up((b, r), id, lp)
|
||||||
|
|
||||||
|
@ -48,15 +48,18 @@ function krnl_act!(act, U::AbstractArray{TG}, Phi::AbstractArray{TS}, sp::Scalar
|
||||||
Pup = Phi[bu,i,ru]
|
Pup = Phi[bu,i,ru]
|
||||||
end
|
end
|
||||||
|
|
||||||
act[b,r] += -2*sp.kap[i]*dot(Psh[b,i],Ush[b,id]*Pup)
|
S += -2*sp.kap[i]*dot(Psh[b,i],Ush[b,id]*Pup)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for i in 1:NP
|
for i in 1:NP
|
||||||
sdot = dot(Psh[b,i],Psh[b,i])
|
sdot = dot(Psh[b,i],Psh[b,i])
|
||||||
act[b,r] += sdot + sp.eta[i]*(sdot - 1)^2
|
S += sdot + sp.eta[i]*(sdot - 1)^2
|
||||||
end
|
end
|
||||||
|
|
||||||
|
I = point_coord((b,r), lp)
|
||||||
|
act[I] = S
|
||||||
|
|
||||||
return nothing
|
return nothing
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue