comparison test/SbpOperators/stencil_test.jl @ 894:54e36688dab8 feature/variable_derivatives

Add functions for converting the element type of nested stencils
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 10 Feb 2022 10:57:00 +0100
parents 0be29e65521e
children 004324d7ed35
comparison
equal deleted inserted replaced
893:422c9f22cf92 894:54e36688dab8
58 Stencil(-1, 0, 1; center=1), 58 Stencil(-1, 0, 1; center=1),
59 Stencil( 0,-1, 1; center=1); 59 Stencil( 0,-1, 1; center=1);
60 center=1 60 center=1
61 )) 61 ))
62 62
63
64 @testset "Error handling" begin 63 @testset "Error handling" begin
65 end 64 end
65 end
66
67 @testset "conversion" begin
68 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)
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)
71
72 @test convert(NestedStencil{Float64}, ns) == NestedStencil((-1.,1.,0.),(-1.,0.,1.),(0.,-1.,1.), center=2)
73 @test convert(NestedStencil{Rational}, ns) == NestedStencil((-1//1,1//1,0//1),(-1//1,0//1,1//1),(0//1,-1//1,1//1), center=2)
66 end 74 end
67 75
68 @testset "apply" begin 76 @testset "apply" begin
69 c = [ 1, 3, 6, 10, 15, 21, 28, 36, 45, 55] 77 c = [ 1, 3, 6, 10, 15, 21, 28, 36, 45, 55]
70 v = [ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29] 78 v = [ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29]