Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/volumeops/laplace/laplace.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 |
comparison
equal
deleted
inserted
replaced
1952:847286c70d7c | 1953:835b1dcee38e |
---|---|
56 | 56 |
57 function laplace(grid::MappedGrid, stencil_set) | 57 function laplace(grid::MappedGrid, stencil_set) |
58 J = map(det,jacobian(grid)) | 58 J = map(det,jacobian(grid)) |
59 J⁻¹ = DiagonalTensor(map(inv, J)) | 59 J⁻¹ = DiagonalTensor(map(inv, J)) |
60 | 60 |
61 Jg = map(*, J, metric_tensor_inverse(grid)) | 61 Jg = map(J, metric_tensor(grid)) do Jₓ, gₓ |
62 Jₓ*inv(gₓ) | |
63 end | |
64 | |
62 lg = logical_grid(grid) | 65 lg = logical_grid(grid) |
63 | 66 |
64 return mapreduce(+, CartesianIndices(first(Jg))) do I | 67 return mapreduce(+, CartesianIndices(first(Jg))) do I |
65 i, j = I[1], I[2] | 68 i, j = I[1], I[2] |
66 Jgⁱʲ = componentview(Jg, i, j) | 69 Jgⁱʲ = componentview(Jg, i, j) |