comparison test/Grids/manifolds_test.jl @ 1584:d7483e8af705 feature/sbp_operators/laplace_curvilinear

Merge feature/grids/manifolds
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 26 Apr 2024 08:45:54 +0200
parents f77c5309dd2b
children d9d767980d6f
comparison
equal deleted inserted replaced
1563:6e910408c51a 1584:d7483e8af705
3 using Sbplib.Grids 3 using Sbplib.Grids
4 using Sbplib.RegionIndices 4 using Sbplib.RegionIndices
5 using Sbplib.LazyTensors 5 using Sbplib.LazyTensors
6 6
7 # using StaticArrays 7 # using StaticArrays
8
9 @testset "ParameterSpace" begin
10 @test ndims(HyperBox([1,1], [2,2])) == 2
11 @test ndims(unittetrahedron()) == 3
12 end
8 13
9 @testset "HyperBox" begin 14 @testset "HyperBox" begin
10 @test HyperBox([1,1], [2,2]) isa HyperBox{Int, 2} 15 @test HyperBox([1,1], [2,2]) isa HyperBox{Int, 2}
11 16
12 @test limits(HyperBox([1,2], [3,4])) == ([1,2], [3,4]) 17 @test limits(HyperBox([1,2], [3,4])) == ([1,2], [3,4])
29 @test limits(unithyperbox(4)) == ([0,0,0,0],[1,1,1,1]) 34 @test limits(unithyperbox(4)) == ([0,0,0,0],[1,1,1,1])
30 end 35 end
31 36
32 @testset "Simplex" begin 37 @testset "Simplex" begin
33 @test Simplex([1,2], [3,4]) isa Simplex{Int, 2} 38 @test Simplex([1,2], [3,4]) isa Simplex{Int, 2}
34 @test Simplex([1,2,3], [4,5,6]) isa Simplex{Int, 3} 39 @test Simplex([1,2,3], [4,5,6],[1,1,1]) isa Simplex{Int, 3}
40
41 @test verticies(Simplex([1,2], [3,4])) == ([1,2], [3,4])
42
43 @test unittriangle() isa Simplex{Float64,2}
44 @test verticies(unittriangle()) == ([0,0], [1,0], [0,1])
45
46 @test unittetrahedron() isa Simplex{Float64,3}
47 @test verticies(unittetrahedron()) == ([0,0,0], [1,0,0], [0,1,0],[0,0,1])
48
49 @test unitsimplex(4) isa Simplex{Float64,4}
35 end 50 end
36 51
37 @testset "Chart" begin 52 @testset "Chart" begin
38 53 c = Chart(x->2x, unitsquare())
54 @test c isa Chart{2}
55 @test c([3,2]) == [6,4]
56 @test parameterspace(c) == unitsquare()
39 end 57 end
40 58
41 @testset "Atlas" begin 59 @testset "Atlas" begin
42 60
43 end 61 end