diff src/Grids/mapped_grid.jl @ 1842:f2b32da29b73 feature/grids/manifolds

Introduce mapped_grid for ParameterSpace and simplify implementation of equidistant_grid(::Chart)
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 22 Oct 2024 15:32:33 +0200
parents 1c58005429fd
children 81559cb7b11c
line wrap: on
line diff
--- a/src/Grids/mapped_grid.jl	Tue Oct 22 08:50:23 2024 +0200
+++ b/src/Grids/mapped_grid.jl	Tue Oct 22 15:32:33 2024 +0200
@@ -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, ps::ParameterSpace, size::Vararg{Int})
+    lg = equidistant_grid(ps, size...)
+    return mapped_grid(lg, x, J)
+end
+
+"""
     metric_tensor(g::MappedGrid)
 
 The metric tensor of `g` as a grid function.