comparison src/Grids/mapped_grid.jl @ 1806:f21bfc5f21aa feature/grids/curvilinear

Address review comment by adding TODO
author Jonatan Werpers <jonatan@werpers.com>
date Wed, 02 Oct 2024 20:58:07 +0200
parents 0c705f0bb3a9
children d91a9f47380f 85f8855473ab 1c58005429fd
comparison
equal deleted inserted replaced
1805:0c705f0bb3a9 1806:f21bfc5f21aa
168 """ 168 """
169 normal(g::MappedGrid, boundary) 169 normal(g::MappedGrid, boundary)
170 170
171 The outward pointing normal as a grid function on the corresponding boundary grid. 171 The outward pointing normal as a grid function on the corresponding boundary grid.
172 """ 172 """
173 # Review: I guess there is no clean way of calling normal(g::MappedGrid, boundary, i...)
174 # here? Something along return map(i -> normal(g, boundary, i), boundary_indices(g, boundary))
175 # If there is I think it would be cleaner. Otherwise, keep as it.
176 function normal(g::MappedGrid, boundary) 173 function normal(g::MappedGrid, boundary)
177 b_indices = boundary_indices(g, boundary) 174 b_indices = boundary_indices(g, boundary)
178 σ = _boundary_sign(component_type(g), boundary) 175 σ = _boundary_sign(component_type(g), boundary)
176
177 # TODO: Refactor this when `boundary_indices(g, ...)` has been made iterable.
179 return map(jacobian(g)[b_indices...]) do ∂x∂ξ 178 return map(jacobian(g)[b_indices...]) do ∂x∂ξ
180 ∂ξ∂x = inv(∂x∂ξ) 179 ∂ξ∂x = inv(∂x∂ξ)
181 k = grid_id(boundary) 180 k = grid_id(boundary)
182 σ*∂ξ∂x[k,:]/norm(∂ξ∂x[k,:]) 181 σ*∂ξ∂x[k,:]/norm(∂ξ∂x[k,:])
183 end 182 end