comparison test/SbpOperators/volumeops/laplace/laplace_test.jl @ 1697:a63278c25c40 feature/sbp_operators/laplace_curvilinear

Fix test of laplace on mapped grid
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 28 Aug 2024 13:28:13 +0200
parents 707fc9761c2b
children f3d7e2d7a43f
comparison
equal deleted inserted replaced
1696:29b96fc75bee 1697:a63278c25c40
93 c = Chart(unitsquare()) do (ξ,η) 93 c = Chart(unitsquare()) do (ξ,η)
94 @SVector[2ξ + η*(1-η), 3η+(1+η/2)*ξ^2] 94 @SVector[2ξ + η*(1-η), 3η+(1+η/2)*ξ^2]
95 end 95 end
96 Grids.jacobian(c::typeof(c), (ξ,η)) = @SMatrix[2 1-2η; (2+η)*ξ 3+ξ^2/2] 96 Grids.jacobian(c::typeof(c), (ξ,η)) = @SMatrix[2 1-2η; (2+η)*ξ 3+ξ^2/2]
97 97
98 g = equidistant_grid(c, 30,30) 98 g = equidistant_grid(c, 60,60)
99 99
100 @test laplace(g, stencil_set) isa LazyTensor{<:Any,2,2} 100 @test laplace(g, stencil_set) isa LazyTensor{<:Any,2,2}
101 101
102 f((x,y)) = sin(4(x + y)) 102 f((x,y)) = sin(4(x + y))
103 Δf((x,y)) = -16sin(4(x + y)) 103 Δf((x,y)) = -32sin(4(x + y))
104 gf = map(f,g) 104 gf = map(f,g)
105 105
106 Δ = laplace(g, stencil_set) 106 Δ = laplace(g, stencil_set)
107 107
108 @test collect(Δ*gf) isa Array{<:Any,2} 108 @test collect(Δ*gf) isa Array{<:Any,2}
109 @test Δ*gf ≈ map(Δf, g) 109 @test Δ*gf ≈ map(Δf, g) rtol=2e-2
110 end 110 end
111 end 111 end
112 112
113 @testset "sat_tensors" begin 113 @testset "sat_tensors" begin
114 # TODO: The following tests should be implemented 114 # TODO: The following tests should be implemented