comparison src/Grids/mapped_grid.jl @ 1684:22a9992471be feature/grids/curvilinear

Add min_spacing for mapped 1d grid
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 21 Aug 2024 19:03:01 +0200
parents 4ce9cb21220c
children 72776d3d5fd6
comparison
equal deleted inserted replaced
1683:88021d580320 1684:22a9992471be
79 return map(jacobian(g)) do ∂x∂ξ 79 return map(jacobian(g)) do ∂x∂ξ
80 inv(∂x∂ξ'*∂x∂ξ) 80 inv(∂x∂ξ'*∂x∂ξ)
81 end 81 end
82 end 82 end
83 83
84 function min_spacing(g::MappedGrid{T,1} where T)
85 n, = size(g)
86
87 ms = Inf
88 for i ∈ 1:n-1
89 ms = min(ms, norm(g[i+1]-g[i]))
90 end
91
92 return ms
93 end
94
95
84 """ 96 """
85 normal(g::MappedGrid, boundary) 97 normal(g::MappedGrid, boundary)
86 98
87 The outward pointing normal as a grid function on the boundary 99 The outward pointing normal as a grid function on the boundary
88 """ 100 """