Mercurial > repos > public > sbplib_julia
diff src/Grids/mapped_grid.jl @ 1901:edee7d677efb feature/grids/manifolds
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Sat, 01 Feb 2025 21:38:49 +0100 |
parents | 81559cb7b11c 516eaabf1169 |
children | 04c251bccbd4 |
line wrap: on
line diff
--- a/src/Grids/mapped_grid.jl Mon Jan 27 08:56:39 2025 +0100 +++ b/src/Grids/mapped_grid.jl Sat Feb 01 21:38:49 2025 +0100 @@ -82,8 +82,8 @@ jacobian_components = (:, free_variable_indices) # Create grid function for boundary grid jacobian - boundary_jacobian = componentview((@view g.jacobian[b_indices...]) , jacobian_components...) - boundary_physicalcoordinates = @view g.physicalcoordinates[b_indices...] + boundary_jacobian = componentview((@view g.jacobian[b_indices]) , jacobian_components...) + boundary_physicalcoordinates = @view g.physicalcoordinates[b_indices] return MappedGrid( boundary_grid(g.logical_grid, id), @@ -182,14 +182,8 @@ The outward pointing normal as a grid function on the corresponding boundary grid. """ function normal(g::MappedGrid, boundary) - b_indices = boundary_indices(g, boundary) - σ = _boundary_sign(component_type(g), boundary) - - # TODO: Refactor this when `boundary_indices(g, ...)` has been made iterable. - return map(jacobian(g)[b_indices...]) do ∂x∂ξ - ∂ξ∂x = inv(∂x∂ξ) - k = grid_id(boundary) - σ*∂ξ∂x[k,:]/norm(∂ξ∂x[k,:]) + return map(boundary_indices(g, boundary)) do I + normal(g, boundary, Tuple(I)...) end end