comparison src/Grids/manifolds.jl @ 1934:1b012e2d5db1 feature/grids/manifolds

Add function for getting boundaries from CartesianAtlas
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 07 Feb 2025 11:11:54 +0100
parents ac63820222f8
children a7c9d04b57e0
comparison
equal deleted inserted replaced
1933:2801507dbee1 1934:1b012e2d5db1
84 end 84 end
85 85
86 return c 86 return c
87 end 87 end
88 88
89 function boundaries(a::CartesianAtlas)
90 c = MultiBlockBoundary[]
91
92 for d ∈ 1:ndims(charts(a))
93 Is = eachslice(CartesianIndices(charts(a)); dims=d)
94
95 for (i,b) ∈ ((1,LowerBoundary),(length(Is),UpperBoundary)) # For first and last slice
96 for jk ∈ eachindex(Is[i]) # For each block in slice
97 Iᵢⱼₖ = Tuple(Is[i][jk])
98 push!(c,
99 MultiBlockBoundary{Iᵢⱼₖ, CartesianBoundary{d,b}}(),
100 )
101 end
102 end
103 end
104
105 return c
106 end
107
108
89 struct UnstructuredAtlas <: Atlas 109 struct UnstructuredAtlas <: Atlas
90 charts::Vector{Chart} 110 charts::Vector{Chart}
91 connections::Vector{Tuple{MultiBlockBoundary, MultiBlockBoundary}} 111 connections::Vector{Tuple{MultiBlockBoundary, MultiBlockBoundary}}
92 end 112 end
93 113