Mercurial > repos > public > sbplib_julia
comparison test/Grids/manifolds_test.jl @ 1785:96f8cad255b4 feature/sbp_operators/laplace_curvilinear
Merge feature/grids/manifolds
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 16 Sep 2024 10:33:47 +0200 |
parents | a73838c9ef94 |
children | ea98f03e18e0 |
comparison
equal
deleted
inserted
replaced
1751:f3d7e2d7a43f | 1785:96f8cad255b4 |
---|---|
9 @testset "ParameterSpace" begin | 9 @testset "ParameterSpace" begin |
10 @test ndims(HyperBox([1,1], [2,2])) == 2 | 10 @test ndims(HyperBox([1,1], [2,2])) == 2 |
11 @test ndims(unittetrahedron()) == 3 | 11 @test ndims(unittetrahedron()) == 3 |
12 end | 12 end |
13 | 13 |
14 @testset "Interval" begin | |
15 @test Interval <: ParameterSpace{1} | |
16 | |
17 @test Interval(0,1) isa Interval{Int} | |
18 @test Interval(0,1.) isa Interval{Float64} | |
19 | |
20 @test unitinterval() isa Interval{Float64} | |
21 @test unitinterval() == Interval(0.,1.) | |
22 @test limits(unitinterval()) == (0.,1.) | |
23 | |
24 @test unitinterval(Int) isa Interval{Int} | |
25 @test unitinterval(Int) == Interval(0,1) | |
26 @test limits(unitinterval(Int)) == (0,1) | |
27 end | |
28 | |
14 @testset "HyperBox" begin | 29 @testset "HyperBox" begin |
15 @test HyperBox{<:Any, 2} <: ParameterSpace{2} | 30 @test HyperBox{<:Any, 2} <: ParameterSpace{2} |
16 @test HyperBox([1,1], [2,2]) isa HyperBox{Int, 2} | 31 @test HyperBox([1,1], [2,2]) isa HyperBox{Int, 2} |
17 | 32 |
33 @test HyperBox([1,2], [1.,2.]) isa HyperBox{Float64,2} | |
34 | |
18 @test limits(HyperBox([1,2], [3,4])) == ([1,2], [3,4]) | 35 @test limits(HyperBox([1,2], [3,4])) == ([1,2], [3,4]) |
19 @test limits(HyperBox([1,2], [3,4]), 1) == (1,3) | 36 @test limits(HyperBox([1,2], [3,4]), 1) == (1,3) |
20 @test limits(HyperBox([1,2], [3,4]), 2) == (2,4) | 37 @test limits(HyperBox([1,2], [3,4]), 2) == (2,4) |
21 | |
22 @test unitinterval() isa HyperBox{Float64,1} | |
23 @test limits(unitinterval()) == ([0], [1]) | |
24 | |
25 @test unitinterval(Int) isa HyperBox{Int,1} | |
26 @test limits(unitinterval(Int)) == ([0], [1]) | |
27 | 38 |
28 @test unitsquare() isa HyperBox{Float64,2} | 39 @test unitsquare() isa HyperBox{Float64,2} |
29 @test limits(unitsquare()) == ([0,0],[1,1]) | 40 @test limits(unitsquare()) == ([0,0],[1,1]) |
30 | 41 |
31 @test unitcube() isa HyperBox{Float64,3} | 42 @test unitcube() isa HyperBox{Float64,3} |
37 | 48 |
38 @testset "Simplex" begin | 49 @testset "Simplex" begin |
39 @test Simplex{<:Any, 3} <: ParameterSpace{3} | 50 @test Simplex{<:Any, 3} <: ParameterSpace{3} |
40 @test Simplex([1,2], [3,4]) isa Simplex{Int, 2} | 51 @test Simplex([1,2], [3,4]) isa Simplex{Int, 2} |
41 @test Simplex([1,2,3], [4,5,6],[1,1,1]) isa Simplex{Int, 3} | 52 @test Simplex([1,2,3], [4,5,6],[1,1,1]) isa Simplex{Int, 3} |
53 | |
54 @test Simplex([1,2], [3.,4.]) isa Simplex{Float64, 2} | |
42 | 55 |
43 @test verticies(Simplex([1,2], [3,4])) == ([1,2], [3,4]) | 56 @test verticies(Simplex([1,2], [3,4])) == ([1,2], [3,4]) |
44 | 57 |
45 @test unittriangle() isa Simplex{Float64,2} | 58 @test unittriangle() isa Simplex{Float64,2} |
46 @test verticies(unittriangle()) == ([0,0], [1,0], [0,1]) | 59 @test verticies(unittriangle()) == ([0,0], [1,0], [0,1]) |
54 @testset "Chart" begin | 67 @testset "Chart" begin |
55 c = Chart(x->2x, unitsquare()) | 68 c = Chart(x->2x, unitsquare()) |
56 @test c isa Chart{2} | 69 @test c isa Chart{2} |
57 @test c([3,2]) == [6,4] | 70 @test c([3,2]) == [6,4] |
58 @test parameterspace(c) == unitsquare() | 71 @test parameterspace(c) == unitsquare() |
72 @test ndims(c) == 2 | |
59 end | 73 end |
60 | 74 |
61 @testset "Atlas" begin | 75 @testset "Atlas" begin |
62 | 76 |
63 end | 77 end |