Mercurial > repos > public > sbplib_julia
comparison test/SbpOperators/stencil_test.jl @ 896:004324d7ed35 feature/variable_derivatives
Add scale method for nested stencils
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 10 Feb 2022 11:26:28 +0100 |
parents | 54e36688dab8 |
children | 737cd68318c7 |
comparison
equal
deleted
inserted
replaced
895:d24b331547f3 | 896:004324d7ed35 |
---|---|
62 | 62 |
63 @testset "Error handling" begin | 63 @testset "Error handling" begin |
64 end | 64 end |
65 end | 65 end |
66 | 66 |
67 @testset "scale" begin | |
68 ns = NestedStencil((-1,1,0),(-1,0,1),(0,-1,1), center=2) | |
69 @test SbpOperators.scale(ns, 2) == NestedStencil((-2,2,0),(-2,0,2),(0,-2,2), center=2) | |
70 end | |
71 | |
67 @testset "conversion" begin | 72 @testset "conversion" begin |
68 ns = NestedStencil((-1,1,0),(-1,0,1),(0,-1,1), center=2) | 73 ns = NestedStencil((-1,1,0),(-1,0,1),(0,-1,1), center=2) |
69 @test NestedStencil{Float64}(ns) == NestedStencil((-1.,1.,0.),(-1.,0.,1.),(0.,-1.,1.), center=2) | 74 @test NestedStencil{Float64}(ns) == NestedStencil((-1.,1.,0.),(-1.,0.,1.),(0.,-1.,1.), center=2) |
70 @test NestedStencil{Rational}(ns) == NestedStencil((-1//1,1//1,0//1),(-1//1,0//1,1//1),(0//1,-1//1,1//1), center=2) | 75 @test NestedStencil{Rational}(ns) == NestedStencil((-1//1,1//1,0//1),(-1//1,0//1,1//1),(0//1,-1//1,1//1), center=2) |
71 | 76 |