Mercurial > repos > public > sbplib_julia
comparison test/SbpOperators/stencil_test.jl @ 728:45966c77cb20 feature/selectable_tests
Split tests for SbpOperators over several files
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 17 Mar 2021 20:34:40 +0100 |
parents | |
children | 6114274447f5 |
comparison
equal
deleted
inserted
replaced
727:95b207729b7a | 728:45966c77cb20 |
---|---|
1 using Test | |
2 using Sbplib.SbpOperators | |
3 | |
4 @testset "Stencil" begin | |
5 s = Stencil((-2,2), (1.,2.,2.,3.,4.)) | |
6 @test s isa Stencil{Float64, 5} | |
7 | |
8 @test eltype(s) == Float64 | |
9 @test SbpOperators.scale(s, 2) == Stencil((-2,2), (2.,4.,4.,6.,8.)) | |
10 | |
11 @test Stencil(1,2,3,4; center=1) == Stencil((0, 3),(1,2,3,4)) | |
12 @test Stencil(1,2,3,4; center=2) == Stencil((-1, 2),(1,2,3,4)) | |
13 @test Stencil(1,2,3,4; center=4) == Stencil((-3, 0),(1,2,3,4)) | |
14 | |
15 @test CenteredStencil(1,2,3,4,5) == Stencil((-2, 2), (1,2,3,4,5)) | |
16 @test_throws ArgumentError CenteredStencil(1,2,3,4) | |
17 end |