comparison src/SbpOperators/boundaryops/normal_derivative.jl @ 1953:835b1dcee38e feature/sbp_operators/laplace_curvilinear

Replace metric_tensor_inverse calls
author Jonatan Werpers <jonatan@werpers.com>
date Sat, 08 Feb 2025 09:35:13 +0100
parents 1f42944d4a72
children 627d94d0f333
comparison
equal deleted inserted replaced
1952:847286c70d7c 1953:835b1dcee38e
32 function normal_derivative(g::MappedGrid, stencil_set::StencilSet, boundary) 32 function normal_derivative(g::MappedGrid, stencil_set::StencilSet, boundary)
33 k = grid_id(boundary) 33 k = grid_id(boundary)
34 b_indices = boundary_indices(g, boundary) 34 b_indices = boundary_indices(g, boundary)
35 35
36 # Compute the weights for the logical derivatives 36 # Compute the weights for the logical derivatives
37 g⁻¹ = metric_tensor_inverse(g) 37 g⁻¹ = map(inv, metric_tensor(g))
38 α = map(CartesianIndices(g⁻¹)[b_indices...]) do I # TODO: Fix iterator here 38 α = map(CartesianIndices(g⁻¹)[b_indices...]) do I # TODO: Fix iterator here
39 gᵏⁱ = g⁻¹[I][k,:] 39 gᵏⁱ = g⁻¹[I][k,:]
40 gᵏᵏ = g⁻¹[I][k,k] 40 gᵏᵏ = g⁻¹[I][k,k]
41 41
42 gᵏⁱ./sqrt(gᵏᵏ) 42 gᵏⁱ./sqrt(gᵏᵏ)