diff test/SbpOperators/volumeops/derivatives/second_derivative_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 f1bb1b6d85dd
line wrap: on
line diff
--- a/test/SbpOperators/volumeops/derivatives/second_derivative_test.jl	Wed Mar 23 12:39:35 2022 +0100
+++ b/test/SbpOperators/volumeops/derivatives/second_derivative_test.jl	Wed Mar 23 12:43:03 2022 +0100
@@ -21,15 +21,16 @@
             Dₓₓ = second_derivative(g_1D,inner_stencil,closure_stencils,1)
             @test Dₓₓ == second_derivative(g_1D,inner_stencil,closure_stencils)
             @test Dₓₓ == second_derivative(g_1D,stencil_set,1)
+            @test Dₓₓ == second_derivative(g_1D,stencil_set)
             @test Dₓₓ isa VolumeOperator
         end
         @testset "2D" begin
             Dₓₓ = second_derivative(g_2D,inner_stencil,closure_stencils,1)
-            D2 = second_derivative(g_1D,inner_stencil,closure_stencils)
-            I = IdentityMapping{Float64}(size(g_2D)[2])
+            D2 = second_derivative(g_1D,inner_stencil,closure_stencils,1)
+            I = IdentityTensor{Float64}(size(g_2D)[2])
             @test Dₓₓ == D2⊗I
             @test Dₓₓ == second_derivative(g_2D,stencil_set,1)
-            @test Dₓₓ isa TensorMapping{T,2,2} where T
+            @test Dₓₓ isa LazyTensor{T,2,2} where T
         end
     end
 
@@ -51,9 +52,7 @@
             # implies that L*v should be exact for monomials up to order 2.
             @testset "2nd order" begin
                 stencil_set = read_stencil_set(operator_path; order=2)
-                inner_stencil = parse_stencil(stencil_set["D2"]["inner_stencil"])
-			    closure_stencils = parse_stencil.(stencil_set["D2"]["closure_stencils"])
-                Dₓₓ = second_derivative(g_1D,inner_stencil,closure_stencils)
+                Dₓₓ = second_derivative(g_1D,stencil_set)
                 @test Dₓₓ*monomials[1] ≈ zeros(Float64,size(g_1D)...) atol = 5e-10
                 @test Dₓₓ*monomials[2] ≈ zeros(Float64,size(g_1D)...) atol = 5e-10
                 @test Dₓₓ*monomials[3] ≈ monomials[1] atol = 5e-10
@@ -64,9 +63,7 @@
             # implies that L*v should be exact for monomials up to order 3.
             @testset "4th order" begin
                 stencil_set = read_stencil_set(operator_path; order=4)
-                inner_stencil = parse_stencil(stencil_set["D2"]["inner_stencil"])
-			    closure_stencils = parse_stencil.(stencil_set["D2"]["closure_stencils"])
-                Dₓₓ = second_derivative(g_1D,inner_stencil,closure_stencils)
+                Dₓₓ = second_derivative(g_1D,stencil_set)
                 # NOTE: high tolerances for checking the "exact" differentiation
                 # due to accumulation of round-off errors/cancellation errors?
                 @test Dₓₓ*monomials[1] ≈ zeros(Float64,size(g_1D)...) atol = 5e-10
@@ -92,9 +89,7 @@
             # implies that L*v should be exact for binomials up to order 2.
             @testset "2nd order" begin
                 stencil_set = read_stencil_set(operator_path; order=2)
-                inner_stencil = parse_stencil(stencil_set["D2"]["inner_stencil"])
-                closure_stencils = parse_stencil.(stencil_set["D2"]["closure_stencils"])
-                Dyy = second_derivative(g_2D,inner_stencil,closure_stencils,2)
+                Dyy = second_derivative(g_2D,stencil_set,2)
                 @test Dyy*binomials[1] ≈ zeros(Float64,size(g_2D)...) atol = 5e-9
                 @test Dyy*binomials[2] ≈ zeros(Float64,size(g_2D)...) atol = 5e-9
                 @test Dyy*binomials[3] ≈ evalOn(g_2D,(x,y)->1.) atol = 5e-9
@@ -105,9 +100,7 @@
             # implies that L*v should be exact for binomials up to order 3.
             @testset "4th order" begin
                 stencil_set = read_stencil_set(operator_path; order=4)
-                inner_stencil = parse_stencil(stencil_set["D2"]["inner_stencil"])
-                closure_stencils = parse_stencil.(stencil_set["D2"]["closure_stencils"])
-                Dyy = second_derivative(g_2D,inner_stencil,closure_stencils,2)
+                Dyy = second_derivative(g_2D,stencil_set,2)
                 # NOTE: high tolerances for checking the "exact" differentiation
                 # due to accumulation of round-off errors/cancellation errors?
                 @test Dyy*binomials[1] ≈ zeros(Float64,size(g_2D)...) atol = 5e-9