Mercurial > repos > public > sbplib_julia
comparison test/SbpOperators/stencil_test.jl @ 769:0158c3fd521c operator_storage_array_of_table
Merge in default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 15 Jul 2021 00:06:16 +0200 |
parents | 6114274447f5 |
children | 4433be383840 |
comparison
equal
deleted
inserted
replaced
768:7c87a33963c5 | 769:0158c3fd521c |
---|---|
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 |