changeset 1647:0685d97ebcb0 feature/sbp_operators/laplace_curvilinear

Start adding test for laplace on mapped grid
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 02 May 2024 14:48:03 +0200
parents 62cb622cbe6b
children b7dcd3dd3181
files test/SbpOperators/volumeops/laplace/laplace_test.jl
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/test/SbpOperators/volumeops/laplace/laplace_test.jl	Sat Apr 27 23:18:25 2024 +0200
+++ b/test/SbpOperators/volumeops/laplace/laplace_test.jl	Thu May 02 14:48:03 2024 +0200
@@ -95,17 +95,18 @@
         end
         Grids.jacobian(c::typeof(c), (ξ,η)) = @SMatrix[2 1-2η; (2+η)*ξ 3+ξ^2/2]
 
-        g = equidistant_grid(c, 15,15)
+        g = equidistant_grid(c, 30,30)
 
         @test laplace(g, stencil_set) isa LazyTensor{<:Any,2,2}
 
-        gf = map(g) do (x,y)
-            sin((x^2 + y^2))
-        end
+        f((x,y)) = sin(4(x + y))
+        Δf((x,y)) = -16sin(4(x + y))
+        gf = map(f,g)
 
         Δ = laplace(g, stencil_set)
 
         @test collect(Δ*gf) isa Array{<:Any,2}
+        @test Δ*gf ≈ map(Δf, g)
     end
 end