Mercurial > repos > public > sbplib_julia
changeset 1775:ecec2b0eea0f feature/grids/curvilinear
Delete jacobian_determinant. User should use map or broadcasting with det instead.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sun, 15 Sep 2024 18:05:57 +0200 |
parents | 035af82f559a |
children | 265a740a49da |
files | src/Grids/Grids.jl src/Grids/mapped_grid.jl test/Grids/mapped_grid_test.jl |
diffstat | 3 files changed, 0 insertions(+), 46 deletions(-) [+] |
line wrap: on
line diff
--- a/src/Grids/Grids.jl Sun Sep 15 18:03:37 2024 +0200 +++ b/src/Grids/Grids.jl Sun Sep 15 18:05:57 2024 +0200 @@ -43,7 +43,6 @@ export jacobian export logical_grid export mapped_grid -export jacobian_determinant export metric_tensor export metric_tensor_inverse
--- a/src/Grids/mapped_grid.jl Sun Sep 15 18:03:37 2024 +0200 +++ b/src/Grids/mapped_grid.jl Sun Sep 15 18:05:57 2024 +0200 @@ -122,29 +122,6 @@ ) end -# Review: Error when calling jacobian_determinant(boundary_grid(g,id)) -""" - jacobian_determinant(g::MappedGrid) - -The jacobian determinant of `g` as a grid function. -""" -function jacobian_determinant(g::MappedGrid) - return map(jacobian(g)) do ∂x∂ξ - det(∂x∂ξ) - end -end -# TBD: Should this be changed to calculate sqrt(g) instead? -# This would make it well defined also for n-dim grids embedded in higher dimensions. -# TBD: Is there a better name? metric_determinant? -# TBD: Is the best option to delete it? -# Review: I don't think we should delete it. Users building their own -# curvilinear operators will need the functionality. Also the -# determinant of the jacobian (and not its square root) is required -# for quadratures on mapped grids right? For that reason I think we should -# keep the function as is. We could provide a function for the square root -# as well if we think it would be helpfull. Regarding naming, perhaps -# metric_determinant is better? - """ metric_tensor(g::MappedGrid)
--- a/test/Grids/mapped_grid_test.jl Sun Sep 15 18:03:37 2024 +0200 +++ b/test/Grids/mapped_grid_test.jl Sun Sep 15 18:05:57 2024 +0200 @@ -285,28 +285,6 @@ @test mapped_grid(lg, x̄, J) == mg end -@testset "jacobian_determinant" begin - x̄((ξ, η)) = @SVector[ξ*η, ξ + η^2] - J((ξ, η)) = @SMatrix[ - η ξ; - 1 2η; - ] - - g = mapped_grid(x̄, J, 10, 11) - J = map(logical_grid(g)) do (ξ,η) - 2η^2 - ξ - end - @test jacobian_determinant(g) ≈ J - - - lg = equidistant_grid((0,0), (1,1), 11, 21) - x̄ = map(ξ̄ -> @SVector[ξ̄[1],ξ̄[2], ξ̄[1] + ξ̄[2]], lg) - J = map(ξ̄ -> @SMatrix[1 0; 0 1; 1 1], lg) - mg = MappedGrid(lg, x̄, J) - - @test_broken jacobian(mg) isa AbstractArray{2,Float64} -end - @testset "metric_tensor" begin x̄((ξ, η)) = @SVector[ξ*η, ξ + η^2] J((ξ, η)) = @SMatrix[