comparison test/testSbpOperators.jl @ 768:7c87a33963c5 operator_storage_array_of_table

Add some notes, delete functions that won't be needed
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 14 Jul 2021 23:40:10 +0200
parents 7624a1350ece
children
comparison
equal deleted inserted replaced
767:210d3f58bd56 768:7c87a33963c5
135 Stencil( 2., -5., 4., -1., 0., 0.; center=1), 135 Stencil( 2., -5., 4., -1., 0., 0.; center=1),
136 Stencil( 1., -2., 1., 0., 0., 0.; center=2), 136 Stencil( 1., -2., 1., 0., 0., 0.; center=2),
137 Stencil(-4/43, 59/43, -110/43, 59/43, -4/43, 0.; center=3), 137 Stencil(-4/43, 59/43, -110/43, 59/43, -4/43, 0.; center=3),
138 Stencil(-1/49, 0., 59/49, -118/49, 64/49, -4/49; center=4), 138 Stencil(-1/49, 0., 59/49, -118/49, 64/49, -4/49; center=4),
139 ] 139 ]
140 end
141
142 @testset "get_stencil" begin
143 @test get_stencil(parsed_toml, "order2", "D1", "inner_stencil") == Stencil(-1/2, 0., 1/2, center=2)
144 @test get_stencil(parsed_toml, "order2", "D1", "inner_stencil", center=1) == Stencil(-1/2, 0., 1/2; center=1)
145 @test get_stencil(parsed_toml, "order2", "D1", "inner_stencil", center=3) == Stencil(-1/2, 0., 1/2; center=3)
146
147 @test get_stencil(parsed_toml, "order2", "H", "inner") == Stencil(1.; center=1)
148
149 @test_throws AssertionError get_stencil(parsed_toml, "meta", "type")
150 @test_throws AssertionError get_stencil(parsed_toml, "order2", "D1", "closure_stencils")
151 end
152
153 @testset "get_stencils" begin
154 @test get_stencils(parsed_toml, "order2", "D1", "closure_stencils", centers=(1,)) == (Stencil(-1., 1., center=1),)
155 @test get_stencils(parsed_toml, "order2", "D1", "closure_stencils", centers=(2,)) == (Stencil(-1., 1., center=2),)
156 @test get_stencils(parsed_toml, "order2", "D1", "closure_stencils", centers=[2]) == (Stencil(-1., 1., center=2),)
157
158 @test get_stencils(parsed_toml, "order4", "D2", "closure_stencils",centers=[1,1,1,1]) == (
159 Stencil( 2., -5., 4., -1., 0., 0., center=1),
160 Stencil( 1., -2., 1., 0., 0., 0., center=1),
161 Stencil( -4/43, 59/43, -110/43, 59/43, -4/43, 0., center=1),
162 Stencil( -1/49, 0., 59/49, -118/49, 64/49, -4/49, center=1),
163 )
164
165 @test get_stencils(parsed_toml, "order4", "D2", "closure_stencils",centers=(4,2,3,1)) == (
166 Stencil( 2., -5., 4., -1., 0., 0., center=4),
167 Stencil( 1., -2., 1., 0., 0., 0., center=2),
168 Stencil( -4/43, 59/43, -110/43, 59/43, -4/43, 0., center=3),
169 Stencil( -1/49, 0., 59/49, -118/49, 64/49, -4/49, center=1),
170 )
171
172 @test get_stencils(parsed_toml, "order4", "D2", "closure_stencils",centers=1:4) == (
173 Stencil( 2., -5., 4., -1., 0., 0., center=1),
174 Stencil( 1., -2., 1., 0., 0., 0., center=2),
175 Stencil( -4/43, 59/43, -110/43, 59/43, -4/43, 0., center=3),
176 Stencil( -1/49, 0., 59/49, -118/49, 64/49, -4/49, center=4),
177 )
178
179 @test_throws AssertionError get_stencils(parsed_toml, "order4", "D2", "closure_stencils",centers=(1,2,3))
180 @test_throws AssertionError get_stencils(parsed_toml, "order4", "D2", "closure_stencils",centers=(1,2,3,5,4))
181 @test_throws AssertionError get_stencils(parsed_toml, "order4", "D2", "inner_stencil",centers=(1,2))
182 end
183
184 @testset "get_tuple" begin
185 @test get_tuple(parsed_toml, "order2", "d1", "closure") == (-3/2, 2, -1/2)
186
187 @test_throws AssertionError get_tuple(parsed_toml, "meta", "type")
188 end 140 end
189 end 141 end
190 142
191 @testset "VolumeOperator" begin 143 @testset "VolumeOperator" begin
192 inner_stencil = CenteredStencil(1/4, 2/4, 1/4) 144 inner_stencil = CenteredStencil(1/4, 2/4, 1/4)