comparison test/Grids/manifolds_test.jl @ 1928:96b3e9c516fe feature/grids/manifolds

Make cartesian atlas work for any dimension
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 07 Feb 2025 09:12:41 +0100
parents fe18cdad2b27
children c5affb342e73
comparison
equal deleted inserted replaced
1927:fe18cdad2b27 1928:96b3e9c516fe
34 @test size(CartesianAtlas([c c; c c; c c])) == (3,2) 34 @test size(CartesianAtlas([c c; c c; c c])) == (3,2)
35 end 35 end
36 36
37 @testset "connections" begin 37 @testset "connections" begin
38 a = CartesianAtlas(fill(c, 2,3)) 38 a = CartesianAtlas(fill(c, 2,3))
39 # 2D
39 west = CartesianBoundary{1,LowerBoundary} 40 west = CartesianBoundary{1,LowerBoundary}
40 east = CartesianBoundary{1,UpperBoundary} 41 east = CartesianBoundary{1,UpperBoundary}
41 south = CartesianBoundary{2,LowerBoundary} 42 south = CartesianBoundary{2,LowerBoundary}
42 north = CartesianBoundary{2,UpperBoundary} 43 north = CartesianBoundary{2,UpperBoundary}
43 44
48 (MultiBlockBoundary{(1,2), east}(), MultiBlockBoundary{(2,2), west}()), 49 (MultiBlockBoundary{(1,2), east}(), MultiBlockBoundary{(2,2), west}()),
49 (MultiBlockBoundary{(1,2), north}(), MultiBlockBoundary{(1,3), south}()), 50 (MultiBlockBoundary{(1,2), north}(), MultiBlockBoundary{(1,3), south}()),
50 (MultiBlockBoundary{(2,2), north}(), MultiBlockBoundary{(2,3), south}()), 51 (MultiBlockBoundary{(2,2), north}(), MultiBlockBoundary{(2,3), south}()),
51 (MultiBlockBoundary{(1,3), east}(), MultiBlockBoundary{(2,3), west}()), 52 (MultiBlockBoundary{(1,3), east}(), MultiBlockBoundary{(2,3), west}()),
52 ]) 53 ])
54
55 # 3D
56 a = CartesianAtlas(fill(c, 2,2,3))
57 bottom = CartesianBoundary{3, LowerBoundary}
58 top = CartesianBoundary{3, UpperBoundary}
59 @test Set(connections(a)) == Set([
60 (MultiBlockBoundary{(1,1,1), east}(), MultiBlockBoundary{(2,1,1), west}()),
61 (MultiBlockBoundary{(1,1,1), north}(), MultiBlockBoundary{(1,2,1), south}()),
62 (MultiBlockBoundary{(2,1,1), north}(), MultiBlockBoundary{(2,2,1), south}()),
63 (MultiBlockBoundary{(1,2,1), east}(), MultiBlockBoundary{(2,2,1), west}()),
64
65 (MultiBlockBoundary{(1,1,2), east}(), MultiBlockBoundary{(2,1,2), west}()),
66 (MultiBlockBoundary{(1,1,2), north}(), MultiBlockBoundary{(1,2,2), south}()),
67 (MultiBlockBoundary{(2,1,2), north}(), MultiBlockBoundary{(2,2,2), south}()),
68 (MultiBlockBoundary{(1,2,2), east}(), MultiBlockBoundary{(2,2,2), west}()),
69
70 (MultiBlockBoundary{(1,1,3), east}(), MultiBlockBoundary{(2,1,3), west}()),
71 (MultiBlockBoundary{(1,1,3), north}(), MultiBlockBoundary{(1,2,3), south}()),
72 (MultiBlockBoundary{(2,1,3), north}(), MultiBlockBoundary{(2,2,3), south}()),
73 (MultiBlockBoundary{(1,2,3), east}(), MultiBlockBoundary{(2,2,3), west}()),
74
75 (MultiBlockBoundary{(1,1,1), top}(), MultiBlockBoundary{(1,1,2), bottom}()),
76 (MultiBlockBoundary{(2,1,1), top}(), MultiBlockBoundary{(2,1,2), bottom}()),
77 (MultiBlockBoundary{(1,2,1), top}(), MultiBlockBoundary{(1,2,2), bottom}()),
78 (MultiBlockBoundary{(2,2,1), top}(), MultiBlockBoundary{(2,2,2), bottom}()),
79
80 (MultiBlockBoundary{(1,1,2), top}(), MultiBlockBoundary{(1,1,3), bottom}()),
81 (MultiBlockBoundary{(2,1,2), top}(), MultiBlockBoundary{(2,1,3), bottom}()),
82 (MultiBlockBoundary{(1,2,2), top}(), MultiBlockBoundary{(1,2,3), bottom}()),
83 (MultiBlockBoundary{(2,2,2), top}(), MultiBlockBoundary{(2,2,3), bottom}()),
84 ])
53 end 85 end
54 end 86 end
55 87
56 @testset "UnstructuredAtlas" begin 88 @testset "UnstructuredAtlas" begin
57 @test_broken false 89 @test_broken false