Mercurial > repos > public > sbplib_julia
changeset 1577:d5aa72662161 feature/grids/manifolds
Change to expect the jacobian of a chart to take x as an argument
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 25 Apr 2024 21:53:06 +0200 |
parents | a7245343eb98 |
children | 56da785ab576 |
files | src/Grids/manifolds.jl src/Grids/mapped_grid.jl test/Grids/mapped_grid_test.jl |
diffstat | 3 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/Grids/manifolds.jl Thu Apr 25 21:52:22 2024 +0200 +++ b/src/Grids/manifolds.jl Thu Apr 25 21:53:06 2024 +0200 @@ -98,6 +98,7 @@ (c::ConcreteChart)(x̄) = c.mapping(x̄) parameterspace(c::ConcreteChart) = c.parameterspace +jacobian(c::ConcreteChart, x) = jacobian(c.mapping, x) """ Atlas
--- a/src/Grids/mapped_grid.jl Thu Apr 25 21:52:22 2024 +0200 +++ b/src/Grids/mapped_grid.jl Thu Apr 25 21:53:06 2024 +0200 @@ -66,7 +66,7 @@ return MappedGrid( lg, map(c,lg), - map(jacobian(c), lg), + map(ξ->jacobian(c, ξ), lg), ) end
--- a/test/Grids/mapped_grid_test.jl Thu Apr 25 21:52:22 2024 +0200 +++ b/test/Grids/mapped_grid_test.jl Thu Apr 25 21:53:06 2024 +0200 @@ -189,7 +189,7 @@ c = ConcreteChart(unitsquare()) do (ξ,η) @SVector[2ξ, 3η] end - Grids.jacobian(c::typeof(c)) = x̄ -> @SMatrix[2 0; 0 3] ## TODO Maybe shouldn't return a function + Grids.jacobian(c::typeof(c), ξ̄) = @SMatrix[2 0; 0 3] @test mapped_grid(c, 5, 4) isa Grid end