Mercurial > repos > public > sbplib_julia
diff test/Grids/mapped_grid_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 | d4a6f9effcdd |
line wrap: on
line diff
--- a/test/Grids/mapped_grid_test.jl Thu Apr 25 10:20:43 2024 +0200 +++ b/test/Grids/mapped_grid_test.jl Fri Apr 26 08:45:54 2024 +0200 @@ -4,7 +4,7 @@ using StaticArrays @testset "MappedGrid" begin - lg = equidistant_grid((11,11), (0,0), (1,1)) # TODO: Change dims of the grid to be different + lg = equidistant_grid((0,0), (1,1), 11, 11) # TODO: Change dims of the grid to be different x̄ = map(ξ̄ -> 2ξ̄, lg) J = map(ξ̄ -> @SArray(fill(2., 2, 2)), lg) mg = MappedGrid(lg, x̄, J) @@ -64,7 +64,7 @@ @testset "Iterator interface" begin sg = MappedGrid( - equidistant_grid((15,11), (0,0), (1,1)), + equidistant_grid((0,0), (1,1), 15, 11), map(ξ̄ -> @SArray[ξ̄[1], ξ̄[2], -ξ̄[1]], lg), rand(SMatrix{2,3,Float64},15,11) ) @@ -180,7 +180,18 @@ mg = mapped_grid(x̄, J, 10, 11) @test mg isa MappedGrid{SVector{2,Float64}, 2} - lg = equidistant_grid((10,11), (0,0), (1,1)) + lg = equidistant_grid((0,0), (1,1), 10, 11) @test logicalgrid(mg) == lg @test collect(mg) == map(x̄, lg) + + + @testset "mapped_grid(::Chart)" begin + c = Chart(unitsquare()) do (ξ,η) + @SVector[2ξ, 3η] + end + Grids.jacobian(c::typeof(c), ξ̄) = @SMatrix[2 0; 0 3] + + @test mapped_grid(c, 5, 4) isa Grid + end + end