comparison test/testGrids.jl @ 660:b21fea54ca10 feature/get_boundary_identifiers

Add tests for Grids.boundary_identifiers
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Sat, 30 Jan 2021 20:30:55 +0100
parents b7734413003d
children f0ceddeae993
comparison
equal deleted inserted replaced
659:aa3066010569 660:b21fea54ca10
1 using Sbplib.Grids 1 using Sbplib.Grids
2 using Test 2 using Test
3 using Sbplib.RegionIndices
3 4
4 @testset "Grids" begin 5 @testset "Grids" begin
5 6
6 @testset "EquidistantGrid" begin 7 @testset "EquidistantGrid" begin
7 @test EquidistantGrid(4,0.0,1.0) isa EquidistantGrid 8 @test EquidistantGrid(4,0.0,1.0) isa EquidistantGrid
51 @test restrict(g, 3) == EquidistantGrid(3,0.0,3.0) 52 @test restrict(g, 3) == EquidistantGrid(3,0.0,3.0)
52 @test restrict(g, 1:2) == EquidistantGrid((2,5),(0.0,0.0),(2.0,1.0)) 53 @test restrict(g, 1:2) == EquidistantGrid((2,5),(0.0,0.0),(2.0,1.0))
53 @test restrict(g, 2:3) == EquidistantGrid((5,3),(0.0,0.0),(1.0,3.0)) 54 @test restrict(g, 2:3) == EquidistantGrid((5,3),(0.0,0.0),(1.0,3.0))
54 @test restrict(g, [1,3]) == EquidistantGrid((2,3),(0.0,0.0),(2.0,3.0)) 55 @test restrict(g, [1,3]) == EquidistantGrid((2,3),(0.0,0.0),(2.0,3.0))
55 @test restrict(g, [2,1]) == EquidistantGrid((5,2),(0.0,0.0),(1.0,2.0)) 56 @test restrict(g, [2,1]) == EquidistantGrid((5,2),(0.0,0.0),(1.0,2.0))
57
58 @testset "boundary_identifiers" begin
59 g = EquidistantGrid((2,5,3), (0.0,0.0,0.0), (2.0,1.0,3.0))
60 @test boundary_identifiers(g) == (CartesianBoundary{1,Lower}(),CartesianBoundary{1,Upper}(),
61 CartesianBoundary{2,Lower}(),CartesianBoundary{2,Upper}(),
62 CartesianBoundary{3,Lower}(),CartesianBoundary{3,Upper}())
63 end
56 end 64 end
57 65
58 end 66 end