comparison test/testSbpOperators.jl @ 582:aa44edea36fc feature/boundary_ops

Merge
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 01 Dec 2020 19:41:16 +0100
parents 0779713f95a2
children 8e4f86c4bf75
comparison
equal deleted inserted replaced
581:ea4176a5dfc5 582:aa44edea36fc
178 g_1D = EquidistantGrid(11, 0.0, 1.0) 178 g_1D = EquidistantGrid(11, 0.0, 1.0)
179 g_2D = EquidistantGrid((11,15), (0.0, 0.0), (1.0,1.0)) 179 g_2D = EquidistantGrid((11,15), (0.0, 0.0), (1.0,1.0))
180 180
181 @testset "Constructors" begin 181 @testset "Constructors" begin
182 @testset "1D" begin 182 @testset "1D" begin
183 e_l = BoundaryRestriction{Float64,Lower,4}(op.eClosure,size(g_1D)[1]) 183 e_l = BoundaryRestriction{Lower}(op.eClosure,size(g_1D)[1])
184 @test e_l == BoundaryRestriction(g_1D,op.eClosure,Lower()) 184 @test e_l == BoundaryRestriction(g_1D,op.eClosure,Lower())
185 @test e_l == boundary_restriction(g_1D,op.eClosure,CartesianBoundary{1,Lower}()) 185 @test e_l == boundary_restriction(g_1D,op.eClosure,CartesianBoundary{1,Lower}())
186 @test e_l isa TensorMapping{T,0,1} where T 186 @test e_l isa TensorMapping{T,0,1} where T
187 187
188 e_r = BoundaryRestriction{Float64,Upper,4}(op.eClosure,size(g_1D)[1]) 188 e_r = BoundaryRestriction{Upper}(op.eClosure,size(g_1D)[1])
189 @test e_r == BoundaryRestriction(g_1D,op.eClosure,Upper()) 189 @test e_r == BoundaryRestriction(g_1D,op.eClosure,Upper())
190 @test e_r == boundary_restriction(g_1D,op.eClosure,CartesianBoundary{1,Upper}()) 190 @test e_r == boundary_restriction(g_1D,op.eClosure,CartesianBoundary{1,Upper}())
191 @test e_r isa TensorMapping{T,0,1} where T 191 @test e_r isa TensorMapping{T,0,1} where T
192 end 192 end
193 193
289 289
290 @testset "Inferred" begin 290 @testset "Inferred" begin
291 v = ones(Float64, 11) 291 v = ones(Float64, 11)
292 u = fill(1.) 292 u = fill(1.)
293 293
294 # TBD: Are these testing what we want them to test, apply and apply_transpose, 294 @inferred apply(e_l, v)
295 # or are they testing getindex of TensorMappingApplication? 295 @inferred apply(e_r, v)
296 @inferred (e_l*v)[] 296
297 @inferred (e_r*v)[] 297 @inferred apply_transpose(e_l, u, 4)
298 298 @inferred apply_transpose(e_l, u, Index(1,Lower))
299 @inferred (e_l'*u)[4] 299 @inferred apply_transpose(e_l, u, Index(2,Lower))
300 @inferred (e_l'*u)[Index(1,Lower)] 300 @inferred apply_transpose(e_l, u, Index(6,Interior))
301 @inferred (e_l'*u)[Index(2,Lower)] 301 @inferred apply_transpose(e_l, u, Index(10,Upper))
302 @inferred (e_l'*u)[Index(6,Interior)] 302 @inferred apply_transpose(e_l, u, Index(11,Upper))
303 @inferred (e_l'*u)[Index(10,Upper)] 303
304 @inferred (e_l'*u)[Index(11,Upper)] 304 @inferred apply_transpose(e_r, u, 4)
305 305 @inferred apply_transpose(e_r, u, Index(1,Lower))
306 @inferred (e_r'*u)[4] 306 @inferred apply_transpose(e_r, u, Index(2,Lower))
307 @inferred (e_r'*u)[Index(1,Lower)] 307 @inferred apply_transpose(e_r, u, Index(6,Interior))
308 @inferred (e_r'*u)[Index(2,Lower)] 308 @inferred apply_transpose(e_r, u, Index(10,Upper))
309 @inferred (e_r'*u)[Index(6,Interior)] 309 @inferred apply_transpose(e_r, u, Index(11,Upper))
310 @inferred (e_r'*u)[Index(10,Upper)]
311 @inferred (e_r'*u)[Index(11,Upper)]
312 end 310 end
313 311
314 end 312 end
315 # 313 #
316 # @testset "NormalDerivative" begin 314 # @testset "NormalDerivative" begin