diff src/Grids/mapped_grid.jl @ 1584:d7483e8af705 feature/sbp_operators/laplace_curvilinear

Merge feature/grids/manifolds
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 26 Apr 2024 08:45:54 +0200
parents d5aa72662161
children d4a6f9effcdd
line wrap: on
line diff
--- a/src/Grids/mapped_grid.jl	Thu Apr 25 10:20:43 2024 +0200
+++ b/src/Grids/mapped_grid.jl	Fri Apr 26 08:45:54 2024 +0200
@@ -53,7 +53,7 @@
 
 function mapped_grid(x, J, size...)
     D = length(size)
-    lg = equidistant_grid(size, ntuple(i->0., D), ntuple(i->1., D))
+    lg = equidistant_grid(ntuple(i->0., D), ntuple(i->1., D), size...)
     return MappedGrid(
         lg,
         map(x,lg),
@@ -61,6 +61,15 @@
     )
 end
 
+function mapped_grid(c::Chart, size...)
+    lg = equidistant_grid(parameterspace(c), size...)
+    return MappedGrid(
+        lg,
+        map(c,lg),
+        map(ξ->jacobian(c, ξ), lg),
+    )
+end
+
 function jacobian_determinant(g::MappedGrid)
     return map(jacobian(g)) do ∂x∂ξ
         det(∂x∂ξ)