Mercurial > repos > public > sbplib_julia
diff test/SbpOperators/stencil_test.jl @ 1360:f59228534d3a tooling/benchmarks
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sat, 20 May 2023 15:15:22 +0200 |
parents | 14cb97284373 |
children | c779af4d02e5 |
line wrap: on
line diff
--- a/test/SbpOperators/stencil_test.jl Fri Apr 28 09:00:35 2023 +0200 +++ b/test/SbpOperators/stencil_test.jl Sat May 20 15:15:22 2023 +0200 @@ -62,6 +62,23 @@ end end +@testset "left_pad" begin + @test SbpOperators.left_pad(Stencil(1,1, center = 1), 2) == Stencil(1,1, center=1) + @test SbpOperators.left_pad(Stencil(1,1, center = 1), 3) == Stencil(0,1,1, center=2) + @test SbpOperators.left_pad(Stencil(2,3, center = 2), 4) == Stencil(0,0,2,3, center=4) + + @test SbpOperators.left_pad(Stencil(2.,3., center = 2), 4) == Stencil(0.,0.,2.,3., center=4) +end + +@testset "right_pad" begin + @test SbpOperators.right_pad(Stencil(1,1, center = 1), 2) == Stencil(1,1, center=1) + @test SbpOperators.right_pad(Stencil(1,1, center = 1), 3) == Stencil(1,1,0, center=1) + @test SbpOperators.right_pad(Stencil(2,3, center = 2), 4) == Stencil(2,3,0,0, center=2) + + @test SbpOperators.right_pad(Stencil(2.,3., center = 2), 4) == Stencil(2.,3.,0.,0., center=2) +end + + @testset "NestedStencil" begin @testset "Constructors" begin @@ -170,5 +187,4 @@ @inferred SbpOperators.apply_stencil_backwards(s_int, c_float, v_float, 2) @inferred SbpOperators.apply_stencil_backwards(s_float, c_float, v_int, 2) end - end