comparison test/SbpOperators/stencil_test.jl @ 1057:0728e84af0dc feature/nested_stencils

Add length method for stencils (grafted from 0be29e65521e8a5183c81d90c1163fe7c93dfffe)
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 07 Feb 2022 14:34:03 +0100
parents df498ce0cf52
children 54e36688dab8
comparison
equal deleted inserted replaced
1056:fe83ea1db953 1057:0728e84af0dc
7 @testset "Stencil" begin 7 @testset "Stencil" begin
8 s = Stencil((-2,2), (1.,2.,2.,3.,4.)) 8 s = Stencil((-2,2), (1.,2.,2.,3.,4.))
9 @test s isa Stencil{Float64, 5} 9 @test s isa Stencil{Float64, 5}
10 10
11 @test eltype(s) == Float64 11 @test eltype(s) == Float64
12
13 @test length(s) == 5
14 @test length(Stencil((-1,2), (1,2,3,4))) == 4
15
12 @test SbpOperators.scale(s, 2) == Stencil((-2,2), (2.,4.,4.,6.,8.)) 16 @test SbpOperators.scale(s, 2) == Stencil((-2,2), (2.,4.,4.,6.,8.))
13 17
14 @test Stencil(1,2,3,4; center=1) == Stencil((0, 3),(1,2,3,4)) 18 @test Stencil(1,2,3,4; center=1) == Stencil((0, 3),(1,2,3,4))
15 @test Stencil(1,2,3,4; center=2) == Stencil((-1, 2),(1,2,3,4)) 19 @test Stencil(1,2,3,4; center=2) == Stencil((-1, 2),(1,2,3,4))
16 @test Stencil(1,2,3,4; center=4) == Stencil((-3, 0),(1,2,3,4)) 20 @test Stencil(1,2,3,4; center=4) == Stencil((-3, 0),(1,2,3,4))