Mercurial > repos > public > sbplib_julia
comparison test/SbpOperators/stencil_test.jl @ 746:ddb52db10f37 feature/static_dict
Merge in default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 19 Mar 2021 13:41:25 +0100 |
parents | 6114274447f5 |
children | 4433be383840 |
comparison
equal
deleted
inserted
replaced
742:6377a5fba0a1 | 746:ddb52db10f37 |
---|---|
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 |