changeset 1588:f6774e98d223 feature/sbp_operators/laplace_curvilinear

Add basic test
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 26 Apr 2024 23:36:49 +0200
parents aef3827ef522
children b22b9097d907
files test/SbpOperators/volumeops/laplace/laplace_test.jl
diffstat 1 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/test/SbpOperators/volumeops/laplace/laplace_test.jl	Fri Apr 26 22:49:36 2024 +0200
+++ b/test/SbpOperators/volumeops/laplace/laplace_test.jl	Fri Apr 26 23:36:49 2024 +0200
@@ -4,6 +4,8 @@
 using Sbplib.Grids
 using Sbplib.LazyTensors
 
+using StaticArrays
+
 @testset "Laplace" begin
     # Default stencils (4th order)
     operator_path = sbp_operators_path()*"standard_diagonal.toml"
@@ -88,7 +90,22 @@
     end
 
     @testset "MappedGrid" begin
-        @test_broken false
+        c = Chart(unitsquare()) do (ξ,η)
+            @SVector[2ξ + η*(1-η), 3η+(1+η/2)*ξ^2]
+        end
+        Grids.jacobian(c::typeof(c), (ξ,η)) = @SMatrix[2 1-2η; 1+η/2 3+ξ^2/2]
+
+        g = equidistant_grid(c, 15,15)
+
+        @test laplace(g, stencil_set) isa LazyTensor{<:Any,2,2}
+
+        gf = map(g) do (x,y)
+            sin((x^2 + y^2))
+        end
+
+        Δ = laplace(g, stencil_set)
+
+        @test collect(Δ*gf) isa Array{<:Any,2}
     end
 end