Mercurial > repos > public > sbplib_julia
comparison test/Grids/manifolds_test.jl @ 1935:378d38bab1df feature/grids/manifolds
Move definitions of boundary sides in tests
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 07 Feb 2025 13:33:43 +0100 |
parents | 1b012e2d5db1 |
children | a7c9d04b57e0 |
comparison
equal
deleted
inserted
replaced
1934:1b012e2d5db1 | 1935:378d38bab1df |
---|---|
3 using Diffinitive.Grids | 3 using Diffinitive.Grids |
4 using Diffinitive.RegionIndices | 4 using Diffinitive.RegionIndices |
5 using Diffinitive.LazyTensors | 5 using Diffinitive.LazyTensors |
6 | 6 |
7 using StaticArrays | 7 using StaticArrays |
8 | |
9 west = CartesianBoundary{1,LowerBoundary} | |
10 east = CartesianBoundary{1,UpperBoundary} | |
11 south = CartesianBoundary{2,LowerBoundary} | |
12 north = CartesianBoundary{2,UpperBoundary} | |
13 bottom = CartesianBoundary{3, LowerBoundary} | |
14 top = CartesianBoundary{3, UpperBoundary} | |
8 | 15 |
9 @testset "Chart" begin | 16 @testset "Chart" begin |
10 X(ξ) = 2ξ | 17 X(ξ) = 2ξ |
11 Grids.jacobian(::typeof(X), ξ) = @SVector[2,2] | 18 Grids.jacobian(::typeof(X), ξ) = @SVector[2,2] |
12 c = Chart(X, unitsquare()) | 19 c = Chart(X, unitsquare()) |
34 a = CartesianAtlas([c c; c c]) | 41 a = CartesianAtlas([c c; c c]) |
35 @test charts(a) == [c c; c c] | 42 @test charts(a) == [c c; c c] |
36 end | 43 end |
37 | 44 |
38 @testset "connections" begin | 45 @testset "connections" begin |
39 west = CartesianBoundary{1,LowerBoundary} | |
40 east = CartesianBoundary{1,UpperBoundary} | |
41 south = CartesianBoundary{2,LowerBoundary} | |
42 north = CartesianBoundary{2,UpperBoundary} | |
43 bottom = CartesianBoundary{3, LowerBoundary} | |
44 top = CartesianBoundary{3, UpperBoundary} | |
45 | |
46 # 2D | 46 # 2D |
47 a = CartesianAtlas(fill(Chart(identity, unitsquare()), 2,3)) | 47 a = CartesianAtlas(fill(Chart(identity, unitsquare()), 2,3)) |
48 | 48 |
49 @test Set(connections(a)) == Set([ | 49 @test Set(connections(a)) == Set([ |
50 (MultiBlockBoundary{(1,1), east}(), MultiBlockBoundary{(2,1), west}()), | 50 (MultiBlockBoundary{(1,1), east}(), MultiBlockBoundary{(2,1), west}()), |
85 (MultiBlockBoundary{(2,2,2), top}(), MultiBlockBoundary{(2,2,3), bottom}()), | 85 (MultiBlockBoundary{(2,2,2), top}(), MultiBlockBoundary{(2,2,3), bottom}()), |
86 ]) | 86 ]) |
87 end | 87 end |
88 | 88 |
89 @testset "boundaries" begin | 89 @testset "boundaries" begin |
90 west = CartesianBoundary{1,LowerBoundary} | |
91 east = CartesianBoundary{1,UpperBoundary} | |
92 south = CartesianBoundary{2,LowerBoundary} | |
93 north = CartesianBoundary{2,UpperBoundary} | |
94 bottom = CartesianBoundary{3, LowerBoundary} | |
95 top = CartesianBoundary{3, UpperBoundary} | |
96 | |
97 # 2D | 90 # 2D |
98 a = CartesianAtlas(fill(Chart(identity, unitsquare()), 2,3)) | 91 a = CartesianAtlas(fill(Chart(identity, unitsquare()), 2,3)) |
99 @test Set(boundaries(a)) == Set([ | 92 @test Set(boundaries(a)) == Set([ |
100 MultiBlockBoundary{(1,1), south}(), | 93 MultiBlockBoundary{(1,1), south}(), |
101 MultiBlockBoundary{(2,1), south}(), | 94 MultiBlockBoundary{(2,1), south}(), |