diff 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
line wrap: on
line diff
--- a/test/testSbpOperators.jl	Wed Dec 02 15:26:13 2020 +0100
+++ b/test/testSbpOperators.jl	Wed Dec 02 17:10:18 2020 +0100
@@ -13,6 +13,10 @@
 
     @test eltype(s) == Float64
     @test SbpOperators.scale(s, 2) == SbpOperators.Stencil((-2,2), (2.,4.,4.,6.,8.))
+
+    @test SbpOperators.Stencil((1,2,3,4), center=1) == SbpOperators.Stencil((0, 3),(1,2,3,4))
+    @test SbpOperators.Stencil((1,2,3,4), center=2) == SbpOperators.Stencil((-1, 2),(1,2,3,4))
+    @test SbpOperators.Stencil((1,2,3,4), center=4) == SbpOperators.Stencil((-3, 0),(1,2,3,4))
 end
 
 # @testset "apply_quadrature" begin