Skip to content

Commit

Permalink
Add unit_U! for MPI
Browse files Browse the repository at this point in the history
  • Loading branch information
o-morikawa authored Dec 18, 2024
1 parent cd86b51 commit 10c4d31
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions src/4D/gaugefields_4D_mpi_nowing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,72 @@ function clear_U!(
set_wing_U!(U)
end

function unit_U!(U::Gaugefields_4D_nowing_mpi{NC}) where {NC}
for it = 1:U.PN[4]
for iz = 1:U.PN[3]
for iy = 1:U.PN[2]
for ix = 1:U.PN[1]
for jc = 1:NC
@simd for ic = 1:NC
v = 1
@inbounds setvalue!(U, v, ic, jc, ix, iy, iz, it)
#@inbounds Uμ[k1,k2,ix,iy,iz,it] = 0
end
end
end
end
end
end
set_wing_U!(U)
end

function unit_U!(U::Gaugefields_4D_nowing_mpi{NC}, iseven::Bool) where {NC}
for it = 1:U.PN[4]
for iz = 1:U.PN[3]
for iy = 1:U.PN[2]
for ix = 1:U.PN[1]
evenodd = ifelse((ix + iy + iz + it) % 2 == 0, true, false)
if evenodd == iseven
for k2 = 1:NC
for k1 = 1:NC
v = 1
@inbounds setvalue!(U, v, k1, k2, ix, iy, iz, it)
end
end
end
end
end
end
end
set_wing_U!(U)
end

function unit_U!(
U::Gaugefields_4D_nowing_mpi{NC},
filternumber::N,
filterindex::N,
) where {NC,N<:Integer}
for it = 1:U.PN[4]
for iz = 1:U.PN[3]
for iy = 1:U.PN[2]
for ix = 1:U.PN[1]
filter = ((ix + iy + iz + it)) % filternumber
#evenodd = ifelse( (ix+iy+iz+it) % filternumber ==0, true,false)
if filter == filterindex
for k2 = 1:NC
for k1 = 1:NC
v = 1
@inbounds setvalue!(U, v, k1, k2, ix, iy, iz, it)
end
end
end
end
end
end
end
set_wing_U!(U)
end

function add_U!(c::Gaugefields_4D_nowing_mpi{NC}, a::T1) where {NC,T1<:Abstractfields}
for it = 1:c.PN[4]
for iz = 1:c.PN[3]
Expand Down

0 comments on commit 10c4d31

Please sign in to comment.