Mercurial > repos > public > sbplib_julia
changeset 1737:a4e1721a7109 feature/grids/curvilinear
Simplify tests of boundary_grid
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 10 Sep 2024 22:17:01 +0200 |
parents | 863385aae454 |
children | 7573c9244e47 |
files | test/Grids/mapped_grid_test.jl |
diffstat | 1 files changed, 16 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/test/Grids/mapped_grid_test.jl Tue Sep 10 21:59:10 2024 +0200 +++ b/test/Grids/mapped_grid_test.jl Tue Sep 10 22:17:01 2024 +0200 @@ -190,28 +190,30 @@ 1+ξ*(ξ-1); ] - function test_boundary_grid(mg, bId, Jb) - bg = boundary_grid(mg, bId) - + function expected_bg(mg, bId, Jb) lg = logicalgrid(mg) - expected_bg = MappedGrid( + return MappedGrid( boundary_grid(lg, bId), map(x̄, boundary_grid(lg, bId)), map(Jb, boundary_grid(lg, bId)), ) + end - @testset let bId=bId, bg=bg, expected_bg=expected_bg - @test collect(bg) == collect(expected_bg) - @test logicalgrid(bg) == logicalgrid(expected_bg) - @test jacobian(bg) == jacobian(expected_bg) - # TODO: Implement equality of a curvilinear grid and simlify the above - end + let bid = TensorGridBoundary{1, LowerBoundary}() + @test boundary_grid(mg, bid) == expected_bg(mg, bid, J2) end - @testset test_boundary_grid(mg, TensorGridBoundary{1, LowerBoundary}(), J2) - @testset test_boundary_grid(mg, TensorGridBoundary{1, UpperBoundary}(), J2) - @testset test_boundary_grid(mg, TensorGridBoundary{2, LowerBoundary}(), J1) - @testset test_boundary_grid(mg, TensorGridBoundary{2, UpperBoundary}(), J1) + let bid = TensorGridBoundary{1, UpperBoundary}() + @test boundary_grid(mg, bid) == expected_bg(mg, bid, J2) + end + + let bid = TensorGridBoundary{2, LowerBoundary}() + @test boundary_grid(mg, bid) == expected_bg(mg, bid, J1) + end + + let bid = TensorGridBoundary{2, UpperBoundary}() + @test boundary_grid(mg, bid) == expected_bg(mg, bid, J1) + end end end