comparison test/SbpOperators/stencil_test.jl @ 887:0be29e65521e feature/variable_derivatives

Add length method for stencils
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 07 Feb 2022 14:34:03 +0100
parents 011d3ff65e9f
children 54e36688dab8
comparison
equal deleted inserted replaced
886:0e170dcc6a9e 887:0be29e65521e
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))