comparison test/SbpOperators/volumeops/laplace/laplace_test.jl @ 1047:d12ab8120d29 feature/first_derivative

Merge default
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 23 Mar 2022 12:43:03 +0100
parents 7fc8df5157a7
children 7d52c4835d15
comparison
equal deleted inserted replaced
1046:e00eb000346e 1047:d12ab8120d29
15 @testset "Laplace" begin 15 @testset "Laplace" begin
16 @testset "Constructors" begin 16 @testset "Constructors" begin
17 @testset "1D" begin 17 @testset "1D" begin
18 Δ = laplace(g_1D, inner_stencil, closure_stencils) 18 Δ = laplace(g_1D, inner_stencil, closure_stencils)
19 @test Laplace(g_1D, stencil_set) == Laplace(Δ, stencil_set) 19 @test Laplace(g_1D, stencil_set) == Laplace(Δ, stencil_set)
20 @test Laplace(g_1D, stencil_set) isa TensorMapping{T,1,1} where T 20 @test Laplace(g_1D, stencil_set) isa LazyTensor{T,1,1} where T
21 end 21 end
22 @testset "3D" begin 22 @testset "3D" begin
23 Δ = laplace(g_3D, inner_stencil, closure_stencils) 23 Δ = laplace(g_3D, inner_stencil, closure_stencils)
24 @test Laplace(g_3D, stencil_set) == Laplace(Δ,stencil_set) 24 @test Laplace(g_3D, stencil_set) == Laplace(Δ,stencil_set)
25 @test Laplace(g_3D, stencil_set) isa TensorMapping{T,3,3} where T 25 @test Laplace(g_3D, stencil_set) isa LazyTensor{T,3,3} where T
26 end 26 end
27 end 27 end
28 28
29 # Exact differentiation is measured point-wise. In other cases 29 # Exact differentiation is measured point-wise. In other cases
30 # the error is measured in the l2-norm. 30 # the error is measured in the l2-norm.
67 end 67 end
68 68
69 @testset "laplace" begin 69 @testset "laplace" begin
70 @testset "1D" begin 70 @testset "1D" begin
71 Δ = laplace(g_1D, inner_stencil, closure_stencils) 71 Δ = laplace(g_1D, inner_stencil, closure_stencils)
72 @test Δ == second_derivative(g_1D, inner_stencil, closure_stencils) 72 @test Δ == second_derivative(g_1D, inner_stencil, closure_stencils, 1)
73 @test Δ isa TensorMapping{T,1,1} where T 73 @test Δ isa LazyTensor{T,1,1} where T
74 end 74 end
75 @testset "3D" begin 75 @testset "3D" begin
76 Δ = laplace(g_3D, inner_stencil, closure_stencils) 76 Δ = laplace(g_3D, inner_stencil, closure_stencils)
77 @test Δ isa TensorMapping{T,3,3} where T 77 @test Δ isa LazyTensor{T,3,3} where T
78 Dxx = second_derivative(g_3D, inner_stencil, closure_stencils, 1) 78 Dxx = second_derivative(g_3D, inner_stencil, closure_stencils, 1)
79 Dyy = second_derivative(g_3D, inner_stencil, closure_stencils, 2) 79 Dyy = second_derivative(g_3D, inner_stencil, closure_stencils, 2)
80 Dzz = second_derivative(g_3D, inner_stencil, closure_stencils, 3) 80 Dzz = second_derivative(g_3D, inner_stencil, closure_stencils, 3)
81 @test Δ == Dxx + Dyy + Dzz 81 @test Δ == Dxx + Dyy + Dzz
82 @test Δ isa TensorMapping{T,3,3} where T 82 @test Δ isa LazyTensor{T,3,3} where T
83 end 83 end
84 end 84 end
85 85