comparison test/SbpOperators/stencil_test.jl @ 745:6dd9f97fc2be

Merge in feature/selectable_tests.
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 17 Mar 2021 22:21:01 +0100
parents 6114274447f5
children 4433be383840
comparison
equal deleted inserted replaced
718:05d8ea88c690 745:6dd9f97fc2be
1 using Test
2 using Sbplib.SbpOperators
3 import Sbplib.SbpOperators.Stencil
4
5 @testset "Stencil" begin
6 s = Stencil((-2,2), (1.,2.,2.,3.,4.))
7 @test s isa Stencil{Float64, 5}
8
9 @test eltype(s) == Float64
10 @test SbpOperators.scale(s, 2) == Stencil((-2,2), (2.,4.,4.,6.,8.))
11
12 @test Stencil(1,2,3,4; center=1) == Stencil((0, 3),(1,2,3,4))
13 @test Stencil(1,2,3,4; center=2) == Stencil((-1, 2),(1,2,3,4))
14 @test Stencil(1,2,3,4; center=4) == Stencil((-3, 0),(1,2,3,4))
15
16 @test CenteredStencil(1,2,3,4,5) == Stencil((-2, 2), (1,2,3,4,5))
17 @test_throws ArgumentError CenteredStencil(1,2,3,4)
18 end