Mercurial > repos > public > sbplib_julia
comparison 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 |
comparison
equal
deleted
inserted
replaced
1705:4870fc3faa25 | 1706:11640aa3e348 |
---|---|
56 end | 56 end |
57 | 57 |
58 # TBD: refine and coarsen could be implemented once we have a simple manifold implementation. | 58 # TBD: refine and coarsen could be implemented once we have a simple manifold implementation. |
59 # Before we do, we should consider the overhead of including such a field in the mapped grid struct. | 59 # Before we do, we should consider the overhead of including such a field in the mapped grid struct. |
60 | 60 |
61 function mapped_grid(x, J, size...) | 61 function mapped_grid(x, J, size::Vararg{Int}) |
62 D = length(size) | 62 D = length(size) |
63 lg = equidistant_grid(ntuple(i->0., D), ntuple(i->1., D), size...) | 63 lg = equidistant_grid(ntuple(i->0., D), ntuple(i->1., D), size...) |
64 return mapped_grid(lg, x, J) | |
65 end | |
66 | |
67 function mapped_grid(lg::Grid, x, J) | |
64 return MappedGrid( | 68 return MappedGrid( |
65 lg, | 69 lg, |
66 map(x,lg), | 70 map(x,lg), |
67 map(J,lg), | 71 map(J,lg), |
68 ) | 72 ) |