comparison test/Grids/manifolds_test.jl @ 1946:c63116e2ec8e feature/grids/manifolds

Make boundaries() a method of boundary_identifiers
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 07 Feb 2025 17:37:42 +0100
parents 19efb9dacfff
children 6dd00ea0511a
comparison
equal deleted inserted replaced
1945:19efb9dacfff 1946:c63116e2ec8e
22 @test parameterspace(c) == unitsquare() 22 @test parameterspace(c) == unitsquare()
23 @test ndims(c) == 2 23 @test ndims(c) == 2
24 24
25 @test jacobian(c, [3,2]) == [2,2] 25 @test jacobian(c, [3,2]) == [2,2]
26 26
27 @test Set(boundaries(Chart(X,unitsquare()))) == Set([east(),west(),south(),north()]) 27 @test Set(boundary_identifiers(Chart(X,unitsquare()))) == Set([east(),west(),south(),north()])
28 end 28 end
29 29
30 @testset "CartesianAtlas" begin 30 @testset "CartesianAtlas" begin
31 @testset "Constructors" begin 31 @testset "Constructors" begin
32 c = Chart(identity, unitsquare()) 32 c = Chart(identity, unitsquare())
86 (MultiBlockBoundary{(1,2,2), top}(), MultiBlockBoundary{(1,2,3), bottom}()), 86 (MultiBlockBoundary{(1,2,2), top}(), MultiBlockBoundary{(1,2,3), bottom}()),
87 (MultiBlockBoundary{(2,2,2), top}(), MultiBlockBoundary{(2,2,3), bottom}()), 87 (MultiBlockBoundary{(2,2,2), top}(), MultiBlockBoundary{(2,2,3), bottom}()),
88 ]) 88 ])
89 end 89 end
90 90
91 @testset "boundaries" begin 91 @testset "boundary_identifiers" begin
92 # 2D 92 # 2D
93 a = CartesianAtlas(fill(Chart(identity, unitcube()), 2,3)) 93 a = CartesianAtlas(fill(Chart(identity, unitcube()), 2,3))
94 @test Set(boundaries(a)) == Set([ 94 @test Set(boundary_identifiers(a)) == Set([
95 MultiBlockBoundary{(1,1), south}(), 95 MultiBlockBoundary{(1,1), south}(),
96 MultiBlockBoundary{(2,1), south}(), 96 MultiBlockBoundary{(2,1), south}(),
97 MultiBlockBoundary{(2,1), east}(), 97 MultiBlockBoundary{(2,1), east}(),
98 MultiBlockBoundary{(2,2), east}(), 98 MultiBlockBoundary{(2,2), east}(),
99 MultiBlockBoundary{(2,3), east}(), 99 MultiBlockBoundary{(2,3), east}(),
104 MultiBlockBoundary{(1,3), west}(), 104 MultiBlockBoundary{(1,3), west}(),
105 ]) 105 ])
106 106
107 # 3D 107 # 3D
108 a = CartesianAtlas(fill(Chart(identity, unitsquare()), 2,2,3)) 108 a = CartesianAtlas(fill(Chart(identity, unitsquare()), 2,2,3))
109 @test Set(boundaries(a)) == Set([ 109 @test Set(boundary_identifiers(a)) == Set([
110 MultiBlockBoundary{(1,1,1), bottom}(), 110 MultiBlockBoundary{(1,1,1), bottom}(),
111 MultiBlockBoundary{(2,1,1), bottom}(), 111 MultiBlockBoundary{(2,1,1), bottom}(),
112 MultiBlockBoundary{(1,2,1), bottom}(), 112 MultiBlockBoundary{(1,2,1), bottom}(),
113 MultiBlockBoundary{(2,2,1), bottom}(), 113 MultiBlockBoundary{(2,2,1), bottom}(),
114 114
183 183
184 @test charts(a) == [c,c,c] 184 @test charts(a) == [c,c,c]
185 @test connections(a) == cn 185 @test connections(a) == cn
186 end 186 end
187 187
188 @testset "boundaries" begin 188 @testset "boundary_identifiers" begin
189 c = Chart(identity, unitsquare()) 189 c = Chart(identity, unitsquare())
190 cn = [ 190 cn = [
191 (MultiBlockBoundary{1, east}(), MultiBlockBoundary{2, west}()), 191 (MultiBlockBoundary{1, east}(), MultiBlockBoundary{2, west}()),
192 (MultiBlockBoundary{1, north}(), MultiBlockBoundary{3, west}()), 192 (MultiBlockBoundary{1, north}(), MultiBlockBoundary{3, west}()),
193 (MultiBlockBoundary{2, north}(), MultiBlockBoundary{3, south}()), 193 (MultiBlockBoundary{2, north}(), MultiBlockBoundary{3, south}()),
194 ] 194 ]
195 195
196 a = UnstructuredAtlas([c, c, c], cn) 196 a = UnstructuredAtlas([c, c, c], cn)
197 197
198 @test Set(boundaries(a)) == Set([ 198 @test Set(boundary_identifiers(a)) == Set([
199 MultiBlockBoundary{1, west}(), 199 MultiBlockBoundary{1, west}(),
200 MultiBlockBoundary{1, south}(), 200 MultiBlockBoundary{1, south}(),
201 MultiBlockBoundary{2, south}(), 201 MultiBlockBoundary{2, south}(),
202 MultiBlockBoundary{2, east}(), 202 MultiBlockBoundary{2, east}(),
203 MultiBlockBoundary{3, north}(), 203 MultiBlockBoundary{3, north}(),