Mercurial > repos > public > sbplib_julia
annotate test/Grids/manifolds_test.jl @ 1843:ea98f03e18e0 feature/grids/manifolds
Add test stubs
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 22 Oct 2024 15:43:07 +0200 |
parents | a73838c9ef94 |
children | de4b4f2aee4f |
rev | line source |
---|---|
1558 | 1 using Test |
2 | |
1748
03894fd7b132
Merge feature/grids/curvilinear
Jonatan Werpers <jonatan@werpers.com>
parents:
1582
diff
changeset
|
3 using Diffinitive.Grids |
03894fd7b132
Merge feature/grids/curvilinear
Jonatan Werpers <jonatan@werpers.com>
parents:
1582
diff
changeset
|
4 using Diffinitive.RegionIndices |
03894fd7b132
Merge feature/grids/curvilinear
Jonatan Werpers <jonatan@werpers.com>
parents:
1582
diff
changeset
|
5 using Diffinitive.LazyTensors |
1558 | 6 |
7 # using StaticArrays | |
8 | |
1580
fdee60ab8c4e
Add ndims method for ParameterSpace
Jonatan Werpers <jonatan@werpers.com>
parents:
1579
diff
changeset
|
9 @testset "ParameterSpace" begin |
fdee60ab8c4e
Add ndims method for ParameterSpace
Jonatan Werpers <jonatan@werpers.com>
parents:
1579
diff
changeset
|
10 @test ndims(HyperBox([1,1], [2,2])) == 2 |
fdee60ab8c4e
Add ndims method for ParameterSpace
Jonatan Werpers <jonatan@werpers.com>
parents:
1579
diff
changeset
|
11 @test ndims(unittetrahedron()) == 3 |
fdee60ab8c4e
Add ndims method for ParameterSpace
Jonatan Werpers <jonatan@werpers.com>
parents:
1579
diff
changeset
|
12 end |
fdee60ab8c4e
Add ndims method for ParameterSpace
Jonatan Werpers <jonatan@werpers.com>
parents:
1579
diff
changeset
|
13 |
1779
2a8a2b52a112
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
Jonatan Werpers <jonatan@werpers.com>
parents:
1748
diff
changeset
|
14 @testset "Interval" begin |
2a8a2b52a112
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
Jonatan Werpers <jonatan@werpers.com>
parents:
1748
diff
changeset
|
15 @test Interval <: ParameterSpace{1} |
2a8a2b52a112
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
Jonatan Werpers <jonatan@werpers.com>
parents:
1748
diff
changeset
|
16 |
2a8a2b52a112
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
Jonatan Werpers <jonatan@werpers.com>
parents:
1748
diff
changeset
|
17 @test Interval(0,1) isa Interval{Int} |
2a8a2b52a112
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
Jonatan Werpers <jonatan@werpers.com>
parents:
1748
diff
changeset
|
18 @test Interval(0,1.) isa Interval{Float64} |
2a8a2b52a112
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
Jonatan Werpers <jonatan@werpers.com>
parents:
1748
diff
changeset
|
19 |
2a8a2b52a112
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
Jonatan Werpers <jonatan@werpers.com>
parents:
1748
diff
changeset
|
20 @test unitinterval() isa Interval{Float64} |
2a8a2b52a112
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
Jonatan Werpers <jonatan@werpers.com>
parents:
1748
diff
changeset
|
21 @test unitinterval() == Interval(0.,1.) |
2a8a2b52a112
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
Jonatan Werpers <jonatan@werpers.com>
parents:
1748
diff
changeset
|
22 @test limits(unitinterval()) == (0.,1.) |
2a8a2b52a112
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
Jonatan Werpers <jonatan@werpers.com>
parents:
1748
diff
changeset
|
23 |
2a8a2b52a112
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
Jonatan Werpers <jonatan@werpers.com>
parents:
1748
diff
changeset
|
24 @test unitinterval(Int) isa Interval{Int} |
2a8a2b52a112
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
Jonatan Werpers <jonatan@werpers.com>
parents:
1748
diff
changeset
|
25 @test unitinterval(Int) == Interval(0,1) |
2a8a2b52a112
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
Jonatan Werpers <jonatan@werpers.com>
parents:
1748
diff
changeset
|
26 @test limits(unitinterval(Int)) == (0,1) |
2a8a2b52a112
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
Jonatan Werpers <jonatan@werpers.com>
parents:
1748
diff
changeset
|
27 end |
2a8a2b52a112
Refactor Interval to its own type. This allows the user better control of the coordinate type of 1d grids
Jonatan Werpers <jonatan@werpers.com>
parents:
1748
diff
changeset
|
28 |
1558 | 29 @testset "HyperBox" begin |
1582
d9d767980d6f
Export ParameterSpace
Jonatan Werpers <jonatan@werpers.com>
parents:
1581
diff
changeset
|
30 @test HyperBox{<:Any, 2} <: ParameterSpace{2} |
1558 | 31 @test HyperBox([1,1], [2,2]) isa HyperBox{Int, 2} |
32 | |
1780
8ecdc5bb46be
Allow mixed types in constructors for HyperBox and Simplex
Jonatan Werpers <jonatan@werpers.com>
parents:
1779
diff
changeset
|
33 @test HyperBox([1,2], [1.,2.]) isa HyperBox{Float64,2} |
8ecdc5bb46be
Allow mixed types in constructors for HyperBox and Simplex
Jonatan Werpers <jonatan@werpers.com>
parents:
1779
diff
changeset
|
34 |
1558 | 35 @test limits(HyperBox([1,2], [3,4])) == ([1,2], [3,4]) |
36 @test limits(HyperBox([1,2], [3,4]), 1) == (1,3) | |
37 @test limits(HyperBox([1,2], [3,4]), 2) == (2,4) | |
38 | |
39 @test unitsquare() isa HyperBox{Float64,2} | |
40 @test limits(unitsquare()) == ([0,0],[1,1]) | |
41 | |
42 @test unitcube() isa HyperBox{Float64,3} | |
43 @test limits(unitcube()) == ([0,0,0],[1,1,1]) | |
44 | |
45 @test unithyperbox(4) isa HyperBox{Float64,4} | |
46 @test limits(unithyperbox(4)) == ([0,0,0,0],[1,1,1,1]) | |
47 end | |
48 | |
49 @testset "Simplex" begin | |
1582
d9d767980d6f
Export ParameterSpace
Jonatan Werpers <jonatan@werpers.com>
parents:
1581
diff
changeset
|
50 @test Simplex{<:Any, 3} <: ParameterSpace{3} |
1558 | 51 @test Simplex([1,2], [3,4]) isa Simplex{Int, 2} |
1564
35fe4375b35f
Export things and fix ConcreteChart and Simplex
Jonatan Werpers <jonatan@werpers.com>
parents:
1558
diff
changeset
|
52 @test Simplex([1,2,3], [4,5,6],[1,1,1]) isa Simplex{Int, 3} |
1579
14d79b13b54f
Add tests, fix bugs, add exports, for Simplex and friends
Jonatan Werpers <jonatan@werpers.com>
parents:
1572
diff
changeset
|
53 |
1780
8ecdc5bb46be
Allow mixed types in constructors for HyperBox and Simplex
Jonatan Werpers <jonatan@werpers.com>
parents:
1779
diff
changeset
|
54 @test Simplex([1,2], [3.,4.]) isa Simplex{Float64, 2} |
8ecdc5bb46be
Allow mixed types in constructors for HyperBox and Simplex
Jonatan Werpers <jonatan@werpers.com>
parents:
1779
diff
changeset
|
55 |
1579
14d79b13b54f
Add tests, fix bugs, add exports, for Simplex and friends
Jonatan Werpers <jonatan@werpers.com>
parents:
1572
diff
changeset
|
56 @test verticies(Simplex([1,2], [3,4])) == ([1,2], [3,4]) |
14d79b13b54f
Add tests, fix bugs, add exports, for Simplex and friends
Jonatan Werpers <jonatan@werpers.com>
parents:
1572
diff
changeset
|
57 |
14d79b13b54f
Add tests, fix bugs, add exports, for Simplex and friends
Jonatan Werpers <jonatan@werpers.com>
parents:
1572
diff
changeset
|
58 @test unittriangle() isa Simplex{Float64,2} |
14d79b13b54f
Add tests, fix bugs, add exports, for Simplex and friends
Jonatan Werpers <jonatan@werpers.com>
parents:
1572
diff
changeset
|
59 @test verticies(unittriangle()) == ([0,0], [1,0], [0,1]) |
14d79b13b54f
Add tests, fix bugs, add exports, for Simplex and friends
Jonatan Werpers <jonatan@werpers.com>
parents:
1572
diff
changeset
|
60 |
14d79b13b54f
Add tests, fix bugs, add exports, for Simplex and friends
Jonatan Werpers <jonatan@werpers.com>
parents:
1572
diff
changeset
|
61 @test unittetrahedron() isa Simplex{Float64,3} |
14d79b13b54f
Add tests, fix bugs, add exports, for Simplex and friends
Jonatan Werpers <jonatan@werpers.com>
parents:
1572
diff
changeset
|
62 @test verticies(unittetrahedron()) == ([0,0,0], [1,0,0], [0,1,0],[0,0,1]) |
14d79b13b54f
Add tests, fix bugs, add exports, for Simplex and friends
Jonatan Werpers <jonatan@werpers.com>
parents:
1572
diff
changeset
|
63 |
14d79b13b54f
Add tests, fix bugs, add exports, for Simplex and friends
Jonatan Werpers <jonatan@werpers.com>
parents:
1572
diff
changeset
|
64 @test unitsimplex(4) isa Simplex{Float64,4} |
1558 | 65 end |
66 | |
67 @testset "Chart" begin | |
1581
f77c5309dd2b
Rename ConcreteChart to Chart and remove the abstarct chart type
Jonatan Werpers <jonatan@werpers.com>
parents:
1580
diff
changeset
|
68 c = Chart(x->2x, unitsquare()) |
1572
157c43966b06
Add some tests and implement parameterspace for ConcreteChart
Jonatan Werpers <jonatan@werpers.com>
parents:
1564
diff
changeset
|
69 @test c isa Chart{2} |
157c43966b06
Add some tests and implement parameterspace for ConcreteChart
Jonatan Werpers <jonatan@werpers.com>
parents:
1564
diff
changeset
|
70 @test c([3,2]) == [6,4] |
157c43966b06
Add some tests and implement parameterspace for ConcreteChart
Jonatan Werpers <jonatan@werpers.com>
parents:
1564
diff
changeset
|
71 @test parameterspace(c) == unitsquare() |
1781
a73838c9ef94
Let Chart implement Base.ndims instead of domain_dim
Jonatan Werpers <jonatan@werpers.com>
parents:
1780
diff
changeset
|
72 @test ndims(c) == 2 |
1558 | 73 end |
74 | |
1843 | 75 @testset "CartesianAtlas" begin |
76 @test_broken false | |
77 end | |
78 | |
79 @testset "UnstructuredAtlas" begin | |
80 @test_broken false | |
81 end | |
82 | |
83 @testset "Line" begin | |
84 @test_broken false | |
85 end | |
1558 | 86 |
1843 | 87 @testset "LineSegment" begin |
88 @test_broken false | |
1558 | 89 end |
1843 | 90 |
91 @testset "Circle" begin | |
92 @test_broken false | |
93 end | |
94 | |
95 @testset "TransfiniteInterpolationSurface" begin | |
96 @test_broken false | |
97 end |