comparison src/Grids/curvilinear_grid.jl @ 1502:a2dc80396808 feature/grids/curvilinear

Add functions `curvilinear_grid`
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 16 Feb 2024 10:58:17 +0100
parents 553111a15506
children 704a84eef8b6
comparison
equal deleted inserted replaced
1501:553111a15506 1502:a2dc80396808
40 40
41 # Do we add a convenience function `curvilinear_grid`? It could help with 41 # Do we add a convenience function `curvilinear_grid`? It could help with
42 # creating the logical grid, evaluating functions and possibly calculating the 42 # creating the logical grid, evaluating functions and possibly calculating the
43 # entries in the jacobian. 43 # entries in the jacobian.
44 44
45 function curvilinear_grid(x, J, size...)
46 D = length(size)
47 lg = equidistant_grid(size, ntuple(i->0., D), ntuple(i->1., D))
48 return CurvilinearGrid(
49 lg,
50 map(x,lg),
51 map(J,lg),
52 )
53 end