Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/boundaryops/normal_derivative.jl @ 1654:f4dc17cfafce feature/sbp_operators/laplace_curvilinear
Start adding normal derivative for mapped grid
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 26 Jun 2024 14:41:50 +0200 |
parents | 08f06bfacd5c |
children | 89456aa6fa80 |
comparison
equal
deleted
inserted
replaced
1653:9e2228449a72 | 1654:f4dc17cfafce |
---|---|
26 h_inv = inverse_spacing(g) | 26 h_inv = inverse_spacing(g) |
27 | 27 |
28 scaled_stencil = scale(closure_stencil,h_inv) | 28 scaled_stencil = scale(closure_stencil,h_inv) |
29 return BoundaryOperator(g, scaled_stencil, boundary) | 29 return BoundaryOperator(g, scaled_stencil, boundary) |
30 end | 30 end |
31 | |
32 function normal_derivative(g::MappedGrid, stencil_set::StencilSet, boundary) | |
33 g⁻¹ = geometric_tensor_inverse(g) # Extract boundary part | |
34 k = NaN # Dimension of boundary | |
35 mapreduce(1:ndims(g)) do i | |
36 gᵏⁱ = componentview(g⁻¹,k,i) | |
37 gᵏᵏ = componentview(g⁻¹,k,k) | |
38 # ∂ξᵢ = ... | |
39 DiagonalTensor(gᵏⁱ./sqrt.(gᵏᵏ)) * ∂ξᵢ # Should the metric expression be mapped lazily? | |
40 end | |
41 end |