Mercurial > repos > public > sbplib_julia
comparison test/Grids/mapped_grid_test.jl @ 1842:f2b32da29b73 feature/grids/manifolds
Introduce mapped_grid for ParameterSpace and simplify implementation of equidistant_grid(::Chart)
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 22 Oct 2024 15:32:33 +0200 |
parents | 2b5f81e288f1 |
children | 81559cb7b11c |
comparison
equal
deleted
inserted
replaced
1841:1c58005429fd | 1842:f2b32da29b73 |
---|---|
276 @testset "mapped_grid" begin | 276 @testset "mapped_grid" begin |
277 x̄, J = _partially_curved_mapping() | 277 x̄, J = _partially_curved_mapping() |
278 mg = mapped_grid(x̄, J, 10, 11) | 278 mg = mapped_grid(x̄, J, 10, 11) |
279 @test mg isa MappedGrid{SVector{2,Float64}, 2} | 279 @test mg isa MappedGrid{SVector{2,Float64}, 2} |
280 | 280 |
281 lg = equidistant_grid((0,0), (1,1), 10, 11) | 281 lg = equidistant_grid(unitsquare(), 10, 11) |
282 @test logical_grid(mg) == lg | 282 @test logical_grid(mg) == lg |
283 @test collect(mg) == map(x̄, lg) | 283 @test collect(mg) == map(x̄, lg) |
284 | 284 |
285 @test mapped_grid(lg, x̄, J) == mg | 285 @test mapped_grid(lg, x̄, J) == mg |
286 | |
287 @test mapped_grid(x̄, J, unitsquare(), 10, 11) == mg | |
286 end | 288 end |
287 | 289 |
288 @testset "metric_tensor" begin | 290 @testset "metric_tensor" begin |
289 x̄((ξ, η)) = @SVector[ξ*η, ξ + η^2] | 291 x̄((ξ, η)) = @SVector[ξ*η, ξ + η^2] |
290 J((ξ, η)) = @SMatrix[ | 292 J((ξ, η)) = @SMatrix[ |