comparison src/Grids/mapped_grid.jl @ 1803:34ddb953a986 feature/grids/curvilinear

Review: Possible refactor of function normal?
author Vidar Stiernström <vidar.stiernstrom@gmail.com>
date Wed, 02 Oct 2024 11:04:35 -0700
parents 8583f6379bd8
children 0c705f0bb3a9
comparison
equal deleted inserted replaced
1799:8583f6379bd8 1803:34ddb953a986
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.
173 function normal(g::MappedGrid, boundary) 176 function normal(g::MappedGrid, boundary)
174 b_indices = boundary_indices(g, boundary) 177 b_indices = boundary_indices(g, boundary)
175 σ = _boundary_sign(component_type(g), boundary) 178 σ = _boundary_sign(component_type(g), boundary)
176 return map(jacobian(g)[b_indices...]) do ∂x∂ξ 179 return map(jacobian(g)[b_indices...]) do ∂x∂ξ
177 ∂ξ∂x = inv(∂x∂ξ) 180 ∂ξ∂x = inv(∂x∂ξ)