diff src/Grids/mapped_grid.jl @ 1853:a12708e48499

Merge feature/jet_aqua
author Jonatan Werpers <jonatan@werpers.com>
date Sat, 11 Jan 2025 10:17:12 +0100
parents a57cd6fa4ecb
children 516eaabf1169 81559cb7b11c
line wrap: on
line diff
--- a/src/Grids/mapped_grid.jl	Fri Jan 10 20:22:04 2025 +0100
+++ b/src/Grids/mapped_grid.jl	Sat Jan 11 10:17:12 2025 +0100
@@ -92,27 +92,27 @@
     )
 end
 
-
+# TODO: Make sure all methods of `mapped_grid` are implemented correctly and tested.
 """
     mapped_grid(x, J, size::Vararg{Int})
 
 A `MappedGrid` with a default logical grid on the D-dimensional unit hyper 
-box [0,1]ᴰ. `x` and `J`are functions to be evaluated on the logical grid
+box [0,1]ᴰ. `x` and `J` are functions to be evaluated on the logical grid
 and `size` determines the size of the logical grid.
 """
 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)
+        lg = equidistant_grid(ntuple(i->0., D), ntuple(i->1., D), size...) # TODO: Clean this up with ParamaterSpace once feature/grids/manifolds is merged
+    return mapped_grid(x, J, lg)
 end
 
 """
-    mapped_grid(lg::Grid, x, J)
+    mapped_grid(x, J, lg::Grid)
 
 A `MappedGrid` with logical grid `lg`. Physical coordinates and Jacobian are
 determined by the functions `x` and `J`.
 """
-function mapped_grid(lg::Grid, x, J)
+function mapped_grid(x, J, lg::Grid)
     return MappedGrid(
         lg,
         map(x,lg),
@@ -121,6 +121,17 @@
 end
 
 """
+    mapped_grid(x, J, parameterspace, size)
+
+A `MappedGrid` with logical grid `lg`. Physical coordinates and Jacobian are
+determined by the functions `x` and `J`.
+"""
+function mapped_grid(x, J, parameterspace, size::Vararg{Int})
+    lg = equidistant_grid(parameterspace, size...)
+    return mapped_grid(x, J, lg)
+end
+
+"""
     metric_tensor(g::MappedGrid)
 
 The metric tensor of `g` as a grid function.