Mercurial > repos > public > sbplib_julia
diff src/Grids/mapped_grid.jl @ 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 | 863385aae454 |
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),