comparison test/testSbpOperators.jl @ 595:03ef4d4740ab refactor/toml_operator_format

Add a constructor for Stencil where you can specify the center of the stencil
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 02 Dec 2020 17:10:18 +0100
parents cc86b920531a
children fbff4009c08a 6901d5375311
comparison
equal deleted inserted replaced
594:cc86b920531a 595:03ef4d4740ab
11 s = SbpOperators.Stencil((-2,2), (1.,2.,2.,3.,4.)) 11 s = SbpOperators.Stencil((-2,2), (1.,2.,2.,3.,4.))
12 @test s isa SbpOperators.Stencil{Float64, 5} 12 @test s isa SbpOperators.Stencil{Float64, 5}
13 13
14 @test eltype(s) == Float64 14 @test eltype(s) == Float64
15 @test SbpOperators.scale(s, 2) == SbpOperators.Stencil((-2,2), (2.,4.,4.,6.,8.)) 15 @test SbpOperators.scale(s, 2) == SbpOperators.Stencil((-2,2), (2.,4.,4.,6.,8.))
16
17 @test SbpOperators.Stencil((1,2,3,4), center=1) == SbpOperators.Stencil((0, 3),(1,2,3,4))
18 @test SbpOperators.Stencil((1,2,3,4), center=2) == SbpOperators.Stencil((-1, 2),(1,2,3,4))
19 @test SbpOperators.Stencil((1,2,3,4), center=4) == SbpOperators.Stencil((-3, 0),(1,2,3,4))
16 end 20 end
17 21
18 # @testset "apply_quadrature" begin 22 # @testset "apply_quadrature" begin
19 # op = read_D2_operator(sbp_operators_path()*"standard_diagonal.toml"; order=4) 23 # op = read_D2_operator(sbp_operators_path()*"standard_diagonal.toml"; order=4)
20 # h = 0.5 24 # h = 0.5