comparison src/SbpOperators/boundaryops/normal_derivative.jl @ 1680:b30db2ea34ed feature/sbp_operators/laplace_curvilinear

Add concistency tests for normal_derivative and and fix bug regarding sign of boundary
author Jonatan Werpers <jonatan@werpers.com>
date Sun, 30 Jun 2024 15:57:22 +0200
parents cc9d18a5ff2d
children 29b96fc75bee
comparison
equal deleted inserted replaced
1679:529b533a1dbb 1680:b30db2ea34ed
40 gᵏᵏ = g⁻¹[I][k,k] 40 gᵏᵏ = g⁻¹[I][k,k]
41 41
42 gᵏⁱ./sqrt(gᵏᵏ) 42 gᵏⁱ./sqrt(gᵏᵏ)
43 end 43 end
44 44
45 σ = ScalingTensor(
46 Grids._boundary_sign(component_type(g), boundary),
47 size(boundary_grid(g,boundary)),
48 )
49
50
45 # Assemble difference operator 51 # Assemble difference operator
46 mapreduce(+,1:ndims(g)) do i 52 mapreduce(+,1:ndims(g)) do i
47 if i == k 53 if i == k
48 ∂_ξᵢ = normal_derivative(logicalgrid(g), stencil_set, boundary) 54 ∂_ξᵢ = normal_derivative(logicalgrid(g), stencil_set, boundary)
49 else 55 else
50 e = boundary_restriction(logicalgrid(g), stencil_set, boundary) 56 e = boundary_restriction(logicalgrid(g), stencil_set, boundary)
51 ∂_ξᵢ = e ∘ first_derivative(logicalgrid(g), stencil_set, i) 57 ∂_ξᵢ = σ ∘ e ∘ first_derivative(logicalgrid(g), stencil_set, i)
52 end 58 end
53 59
54 αᵢ = componentview(α,i) 60 αᵢ = componentview(α,i)
55 DiagonalTensor(αᵢ) ∘ ∂_ξᵢ 61 DiagonalTensor(αᵢ) ∘ ∂_ξᵢ
56 end 62 end