Commit 38723d59 authored by s.zitz's avatar s.zitz
Browse files

Okay now the test should do 😉

parent 738222c9
Pipeline #22871 failed with stage
in 5 minutes and 40 seconds
......@@ -248,14 +248,14 @@ end
benchres = @benchmark slippage!($f.x, $f.y, $mom.height, $mom.velocity.x, $mom.velocity.y, $col)
benchtime = median(benchres).time/10^6
t0 = 0.001
t0 = 0.01
@test benchtime t0
end
@testset "Thermal fluctuations" begin
col = JuThinFilm.collisionparams{Float64}(kᵦT=11/6, μ=2.0)
benchres = @benchmark thermalflutuations!($f, $mom, $col)
benchtime = median(benchres).time/10^6
t0 = 0.001
t0 = 0.01
@test benchtime t0
end
@testset "Pressure gradient" begin
......@@ -263,7 +263,7 @@ end
padpressure = padarray(pressure, Pad(:circular, 1, 1))
benchres = @benchmark h∇p!($f.x, $f.y, $mom.height, $padpressure)
benchtime = median(benchres).time/10^6
t0 = 0.001
t0 = 0.01
@test benchtime t0
end
@testset "Inclined plane" begin
......@@ -271,7 +271,7 @@ end
mag = 0.001
benchres = @benchmark inclinedplane!($f.x, $f.y, $mom.height, $t, $mag, $true, $true)
benchtime = median(benchres).time/10^6
t0 = 0.0005
t0 = 0.005
@test benchtime t0
end
@testset "Summation of forces" begin
......@@ -282,7 +282,7 @@ end
f2.y .= -0.2; f3.y .= -0.3; f4.y .= -0.4
benchres = @benchmark sumforces!($f.x, $f.y, $f2.x, $f2.y, $f3.x, $f3.y, $f4.x, $f4.y)
benchtime = median(benchres).time/10^6
t0 = 0.001
t0 = 0.005
@test benchtime t0
end
end
\ No newline at end of file
......@@ -15,7 +15,7 @@
# Add some velocity
mom = flatsurface(Float32, 5, 5, h=2, vx=0.1)
@test isa(mom, JuThinFilm.Moment)
@test isa(mom.velocity, velocity)
@test isa(mom.velocity, JuThinFilm.velocity)
@test all(mom.velocity.x .== 0.1f0)
end
......@@ -70,8 +70,8 @@ end
@testset "Default elliptical patch" begin
T = Float64
lx = ly = 100
stats = pressurestats{T}()
theta, P = JuThinFilm.ellipsepattern(lx, ly, stats) # with kw: center=(Int(lx/2), Int(ly/2)),δₐ=1/36, a=10, b=5
stats = JuThinFilm.pressurestats{T}()
theta, P = ellipsepattern(lx, ly, stats) # with kw: center=(Int(lx/2), Int(ly/2)),δₐ=1/36, a=10, b=5
@test isa(theta, Array{T, 2})
@test size(theta) == (lx, ly)
@test theta[50,50] == 1/9 + 1/36
......@@ -80,8 +80,8 @@ end
@testset "Off center elliptical patch" begin
T = Float64
lx = ly = 100
stats = pressurestats{T}()
theta, P = JuThinFilm.ellipsepattern(lx, ly, stats, center=(20,20)) # with kw: center=(Int(lx/2), Int(ly/2)),δₐ=1/36, a=10, b=5
stats = JuThinFilm.pressurestats{T}()
theta, P = ellipsepattern(lx, ly, stats, center=(20,20)) # with kw: center=(Int(lx/2), Int(ly/2)),δₐ=1/36, a=10, b=5
@test isa(theta, Array{T, 2})
@test size(theta) == (lx, ly)
@test theta[20,20] == 1/9 + 1/36
......@@ -90,8 +90,8 @@ end
@testset "Negative contrast elliptical patch" begin
T = Float64
lx = ly = 100
stats = pressurestats{T}()
theta, P = JuThinFilm.ellipsepattern(lx, ly, stats, δₐ=-1/36) # with kw: center=(Int(lx/2), Int(ly/2)),δₐ=1/36, a=10, b=5
stats = JuThinFilm.pressurestats{T}()
theta, P = ellipsepattern(lx, ly, stats, δₐ=-1/36) # with kw: center=(Int(lx/2), Int(ly/2)),δₐ=1/36, a=10, b=5
@test isa(theta, Array{T, 2})
@test size(theta) == (lx, ly)
@test theta[50,50] == 1/9 - 1/36
......@@ -100,8 +100,8 @@ end
@testset "Larger elliptical patch" begin
T = Float64
lx = ly = 100
stats = pressurestats{T}()
theta, P = JuThinFilm.ellipsepattern(lx, ly, stats, a=10, b=20) # with kw: center=(Int(lx/2), Int(ly/2)),δₐ=1/36, a=10, b=5
stats = JuThinFilm.pressurestats{T}()
theta, P = ellipsepattern(lx, ly, stats, a=10, b=20) # with kw: center=(Int(lx/2), Int(ly/2)),δₐ=1/36, a=10, b=5
@test isa(theta, Array{T, 2})
@test size(theta) == (lx, ly)
@test theta[40,50] == 1/9 + 1/36
......@@ -111,41 +111,41 @@ end
@testset "Polygon patch" begin
T = Float64
lx = ly = 100
stats = pressurestats{T}()
stats = JuThinFilm.pressurestats{T}()
@testset "Equilateral Triangle" begin
θₙ, P = JuThinFilm.trianglepattern(lx, ly, stats)
θₙ, P = trianglepattern(lx, ly, stats)
for i in eachindex(θₙ)
@test θₙ[i] > 0.0
end
@test θₙ[1,1] == 1/9 # the default value
@test θₙ[Int(lx/2), Int(ly/2)] == 1/9 + 1/36
θₙ, P = JuThinFilm.trianglepattern(lx, ly, stats, center=(lx/3, 2*ly/3))
θₙ, P = trianglepattern(lx, ly, stats, center=(lx/3, 2*ly/3))
@test θₙ[1,1] == 1/9 # the default value
@test θₙ[Int(round(lx/3)), Int(round(2*ly/3))] == 1/9 # Because the side became to large
@test θₙ[30, 20] == 1/9 + 1/36 # If too large stick to origin!
θₙ, P = JuThinFilm.trianglepattern(lx, ly, stats, δₐ = -1/36)
θₙ, P = trianglepattern(lx, ly, stats, δₐ = -1/36)
@test θₙ[1,1] == 1/9 # the default value
@test θₙ[Int(lx/2), Int(ly/2)] == 1/9 - 1/36
θₙ, P = JuThinFilm.trianglepattern(lx, ly, stats, side = 30) # Smaller triangle
θₙ, P = trianglepattern(lx, ly, stats, side = 30) # Smaller triangle
@test θₙ[1,1] == 1/9 # the default value
@test θₙ[Int(lx/2), Int(ly/2)] == 1/9 + 1/36
@test θₙ[50, 60] == 1/9 + 1/36
end
@testset "Box pattern" begin
θₙ, P = JuThinFilm.boxpattern(lx, ly, stats)
θₙ, P = boxpattern(lx, ly, stats)
for i in eachindex(θₙ)
@test θₙ[i] > 0.0
end
@test θₙ[1,1] == 1/9 # the default value
@test θₙ[Int(lx/2), Int(ly/2)] == 1/9 + 1/36
θₙ, P = JuThinFilm.boxpattern(lx, ly, stats, center=(lx/3, 2*ly/3))
θₙ, P = boxpattern(lx, ly, stats, center=(lx/3, 2*ly/3))
@test θₙ[1,1] == 1/9 # the default value
@test θₙ[Int(round(2*ly/3)), Int(round(lx/3))] == 1/9 + 1/36
θₙ, P = JuThinFilm.boxpattern(lx, ly, stats, δₐ = -1/36)
θₙ, P = boxpattern(lx, ly, stats, δₐ = -1/36)
@test θₙ[1,1] == 1/9 # the default value
@test θₙ[Int(lx/2), Int(ly/2)] == 1/9 - 1/36
θₙ, P = JuThinFilm.boxpattern(lx, ly, stats, side = 30) # Smaller triangle
θₙ, P = boxpattern(lx, ly, stats, side = 30) # Smaller triangle
@test θₙ[1,1] == 1/9 # the default value
@test θₙ[Int(lx/2), Int(ly/2)] == 1/9 + 1/36
@test θₙ[Int(lx/2) + Int(30/2), Int(ly/2) + Int(30/2)] == 1/9 + 1/36
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment