Mercurial > repos > public > sbplib_julia
changeset 1706:11640aa3e348 feature/grids/curvilinear
Add method and refactor mapped_grid()
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 04 Sep 2024 15:43:39 +0200 |
parents | 4870fc3faa25 |
children | 519a8cb1439e |
files | src/Grids/mapped_grid.jl test/Grids/mapped_grid_test.jl |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/Grids/mapped_grid.jl Wed Sep 04 15:38:10 2024 +0200 +++ b/src/Grids/mapped_grid.jl Wed Sep 04 15:43:39 2024 +0200 @@ -58,9 +58,13 @@ # TBD: refine and coarsen could be implemented once we have a simple manifold implementation. # Before we do, we should consider the overhead of including such a field in the mapped grid struct. -function mapped_grid(x, J, size...) +function mapped_grid(x, J, size::Vararg{Int}) D = length(size) lg = equidistant_grid(ntuple(i->0., D), ntuple(i->1., D), size...) + return mapped_grid(lg, x, J) +end + +function mapped_grid(lg::Grid, x, J) return MappedGrid( lg, map(x,lg),
--- a/test/Grids/mapped_grid_test.jl Wed Sep 04 15:38:10 2024 +0200 +++ b/test/Grids/mapped_grid_test.jl Wed Sep 04 15:43:39 2024 +0200 @@ -222,7 +222,7 @@ @test logicalgrid(mg) == lg @test collect(mg) == map(x̄, lg) - @test_broken mapped_grid(lg, x̄, J) == mg + @test mapped_grid(lg, x̄, J) == mg end @testset "jacobian_determinant" begin