comparison test/SbpOperators/volumeops/laplace/laplace_test.jl @ 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 707fc9761c2b
comparison
equal deleted inserted replaced
1590:62cb622cbe6b 1647:0685d97ebcb0
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, 15,15) 98 g = equidistant_grid(c, 30,30)
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 gf = map(g) do (x,y) 102 f((x,y)) = sin(4(x + y))
103 sin((x^2 + y^2)) 103 Δf((x,y)) = -16sin(4(x + y))
104 end 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 end 110 end
110 end 111 end
111 112