Mercurial > repos > public > sbplib_julia
comparison src/Grids/mapped_grid.jl @ 1863:516eaabf1169 refactor/grids/iterable_boundary_indices
Merge default
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Wed, 22 Jan 2025 09:00:40 +0100 |
| parents | 85f8855473ab a57cd6fa4ecb |
| children | edee7d677efb f93ba5832146 |
comparison
equal
deleted
inserted
replaced
| 1845:aa7da5c899d8 | 1863:516eaabf1169 |
|---|---|
| 90 boundary_physicalcoordinates, | 90 boundary_physicalcoordinates, |
| 91 boundary_jacobian, | 91 boundary_jacobian, |
| 92 ) | 92 ) |
| 93 end | 93 end |
| 94 | 94 |
| 95 | 95 # TODO: Make sure all methods of `mapped_grid` are implemented correctly and tested. |
| 96 """ | 96 """ |
| 97 mapped_grid(x, J, size::Vararg{Int}) | 97 mapped_grid(x, J, size::Vararg{Int}) |
| 98 | 98 |
| 99 A `MappedGrid` with a default logical grid on the D-dimensional unit hyper | 99 A `MappedGrid` with a default logical grid on the D-dimensional unit hyper |
| 100 box [0,1]ᴰ. `x` and `J`are functions to be evaluated on the logical grid | 100 box [0,1]ᴰ. `x` and `J` are functions to be evaluated on the logical grid |
| 101 and `size` determines the size of the logical grid. | 101 and `size` determines the size of the logical grid. |
| 102 """ | 102 """ |
| 103 function mapped_grid(x, J, size::Vararg{Int}) | 103 function mapped_grid(x, J, size::Vararg{Int}) |
| 104 D = length(size) | 104 D = length(size) |
| 105 lg = equidistant_grid(ntuple(i->0., D), ntuple(i->1., D), size...) | 105 lg = equidistant_grid(ntuple(i->0., D), ntuple(i->1., D), size...) # TODO: Clean this up with ParamaterSpace once feature/grids/manifolds is merged |
| 106 return mapped_grid(lg, x, J) | 106 return mapped_grid(x, J, lg) |
| 107 end | 107 end |
| 108 | 108 |
| 109 """ | 109 """ |
| 110 mapped_grid(lg::Grid, x, J) | 110 mapped_grid(x, J, lg::Grid) |
| 111 | 111 |
| 112 A `MappedGrid` with logical grid `lg`. Physical coordinates and Jacobian are | 112 A `MappedGrid` with logical grid `lg`. Physical coordinates and Jacobian are |
| 113 determined by the functions `x` and `J`. | 113 determined by the functions `x` and `J`. |
| 114 """ | 114 """ |
| 115 function mapped_grid(lg::Grid, x, J) | 115 function mapped_grid(x, J, lg::Grid) |
| 116 return MappedGrid( | 116 return MappedGrid( |
| 117 lg, | 117 lg, |
| 118 map(x,lg), | 118 map(x,lg), |
| 119 map(J,lg), | 119 map(J,lg), |
| 120 ) | 120 ) |
| 121 end | |
| 122 | |
| 123 """ | |
| 124 mapped_grid(x, J, parameterspace, size) | |
| 125 | |
| 126 A `MappedGrid` with logical grid `lg`. Physical coordinates and Jacobian are | |
| 127 determined by the functions `x` and `J`. | |
| 128 """ | |
| 129 function mapped_grid(x, J, parameterspace, size::Vararg{Int}) | |
| 130 lg = equidistant_grid(parameterspace, size...) | |
| 131 return mapped_grid(x, J, lg) | |
| 121 end | 132 end |
| 122 | 133 |
| 123 """ | 134 """ |
| 124 metric_tensor(g::MappedGrid) | 135 metric_tensor(g::MappedGrid) |
| 125 | 136 |
