comparison src/Grids/mapped_grid.jl @ 1950:e4500727f435

Merge feature/grids/parameter_spaces
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 11 Feb 2025 08:53:09 +0100
parents dcbe8119fb0a
children e97f4352b8d0
comparison
equal deleted inserted replaced
1900:418566cdd689 1950:e4500727f435
90 boundary_physicalcoordinates, 90 boundary_physicalcoordinates,
91 boundary_jacobian, 91 boundary_jacobian,
92 ) 92 )
93 end 93 end
94 94
95 # TODO: Make sure all methods of `mapped_grid` are implemented correctly and tested. 95 """
96 """ 96 mapped_grid(x, J, size...)
97 mapped_grid(x, J, size::Vararg{Int})
98 97
99 A `MappedGrid` with a default logical grid on the D-dimensional unit hyper 98 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 99 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. 100 and `size` determines the size of the logical grid.
102 """ 101 """
103 function mapped_grid(x, J, size::Vararg{Int}) 102 function mapped_grid(x, J, size::Vararg{Int})
104 D = length(size) 103 D = length(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 104 return mapped_grid(x, J, unithyperbox(D), size...)
106 return mapped_grid(x, J, lg)
107 end 105 end
108 106
109 """ 107 """
110 mapped_grid(x, J, lg::Grid) 108 mapped_grid(x, J, lg::Grid)
111 109
119 map(J,lg), 117 map(J,lg),
120 ) 118 )
121 end 119 end
122 120
123 """ 121 """
124 mapped_grid(x, J, parameterspace, size) 122 mapped_grid(x, J, ps::ParameterSpace, size...)
125 123
126 A `MappedGrid` with logical grid `lg`. Physical coordinates and Jacobian are 124 A `MappedGrid` with logical grid `lg`. Physical coordinates and Jacobian are
127 determined by the functions `x` and `J`. 125 determined by the functions `x` and `J`.
128 """ 126 """
129 function mapped_grid(x, J, parameterspace, size::Vararg{Int}) 127 function mapped_grid(x, J, ps::ParameterSpace, size::Vararg{Int})
130 lg = equidistant_grid(parameterspace, size...) 128 lg = equidistant_grid(ps, size...)
131 return mapped_grid(x, J, lg) 129 return mapped_grid(x, J, lg)
132 end 130 end
133 131
134 """ 132 """
135 metric_tensor(g::MappedGrid) 133 metric_tensor(g::MappedGrid)