mirror of
https://igit.ific.uv.es/alramos/latticegpu.jl.git
synced 2025-05-14 11:13:42 +02:00
Added test for flow adaptive integrators
This commit is contained in:
parent
178a58d586
commit
dc2e9fa6c9
2 changed files with 52 additions and 0 deletions
49
test/flow/test_adapt.jl
Normal file
49
test/flow/test_adapt.jl
Normal file
|
@ -0,0 +1,49 @@
|
|||
###
|
||||
### "THE BEER-WARE LICENSE":
|
||||
### Alberto Ramos wrote this file. As long as you retain this
|
||||
### notice you can do whatever you want with this stuff. If we meet some
|
||||
### day, and you think this stuff is worth it, you can buy me a beer in
|
||||
### return. <alberto.ramos@cern.ch>
|
||||
###
|
||||
### file: test_adapt.jl
|
||||
### created: Mon Jun 6 12:01:36 2022
|
||||
###
|
||||
|
||||
using LatticeGPU, Test, CUDA
|
||||
|
||||
T = Float64
|
||||
lp = SpaceParm{4}((16,16,16,16), (4,4,4,4), BC_PERIODIC, (0,0,0,0,0,0))
|
||||
gp = GaugeParm{T}(SU3{T}, 6.1, 1.0)
|
||||
ymws = YMworkspace(SU3, T, lp)
|
||||
|
||||
randomize!(ymws.mom, lp, ymws)
|
||||
U = exp.(ymws.mom)
|
||||
|
||||
Ucp = deepcopy(U)
|
||||
# First Integrate very precisely up to t=2 (Wilson)
|
||||
println(" # Very precise integration ")
|
||||
wflw = wfl_rk3(Float64, 0.0004, 1.0E-7)
|
||||
flw(U, wflw, 5000, gp, lp, ymws)
|
||||
pl_exact = Eoft_plaq(U, gp, lp, ymws)
|
||||
cl_exact = Eoft_clover(U, gp, lp, ymws)
|
||||
println(" - Plaq: ", pl_exact)
|
||||
println(" - Clover: ", cl_exact)
|
||||
Ufin = deepcopy(U)
|
||||
|
||||
|
||||
# Now use Adaptive step size integrator:
|
||||
for tol in (1.0E-4, 1.0E-5, 1.0E-6, 1.0E-7, 1.0E-8)
|
||||
local wflw = wfl_rk3(Float64, 0.0001, tol)
|
||||
U .= Ucp
|
||||
ns, eps = flw_adapt(U, wflw, 2.0, gp, lp, ymws)
|
||||
pl = Eoft_plaq(U, gp, lp, ymws)
|
||||
cl = Eoft_clover(U, gp, lp, ymws)
|
||||
|
||||
println(" # Adaptive integrator (tol=$tol): ", ns, " steps")
|
||||
U .= U ./ Ufin
|
||||
maxd = CUDA.mapreduce(dev_one, max, U, init=0.0)
|
||||
println(" - Plaq: ", pl," [diff: ", abs(pl-pl_exact), "; ",
|
||||
maxd, "]")
|
||||
println(" - Clover: ", cl, " [diff: ", abs(cl-cl_exact), "; ",
|
||||
maxd, "]")
|
||||
end
|
3
test/runtests.jl
Normal file
3
test/runtests.jl
Normal file
|
@ -0,0 +1,3 @@
|
|||
|
||||
#include("SAD/test_sad.jl")
|
||||
include("flow/test_adapt.jl")
|
Loading…
Add table
Add a link
Reference in a new issue