Mercurial > repos > public > sbplib_julia
comparison test/Grids/mapped_grid_test.jl @ 1741:248304f88e49 feature/grids/curvilinear
Add TBD for deciding about what jacobian_determinant should mean for Rn->Rm grids
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 11 Sep 2024 12:09:41 +0200 |
parents | 9f2bc8ea6a07 |
children | c9c601678a14 |
comparison
equal
deleted
inserted
replaced
1740:9f2bc8ea6a07 | 1741:248304f88e49 |
---|---|
256 g = mapped_grid(x̄, J, 10, 11) | 256 g = mapped_grid(x̄, J, 10, 11) |
257 J = map(logicalgrid(g)) do (ξ,η) | 257 J = map(logicalgrid(g)) do (ξ,η) |
258 2η^2 - ξ | 258 2η^2 - ξ |
259 end | 259 end |
260 @test jacobian_determinant(g) ≈ J | 260 @test jacobian_determinant(g) ≈ J |
261 | |
262 | |
263 lg = equidistant_grid((0,0), (1,1), 11, 21) | |
264 x̄ = map(ξ̄ -> @SVector[ξ̄[1],ξ̄[2], ξ̄[1] + ξ̄[2]], lg) | |
265 J = map(ξ̄ -> @SMatrix[1 0; 0 1; 1 1], lg) | |
266 mg = MappedGrid(lg, x̄, J) | |
267 | |
268 @test_broken jacobian(mg) isa AbstractArray{2,Float64} | |
261 end | 269 end |
262 | 270 |
263 @testset "metric_tensor" begin | 271 @testset "metric_tensor" begin |
264 x̄((ξ, η)) = @SVector[ξ*η, ξ + η^2] | 272 x̄((ξ, η)) = @SVector[ξ*η, ξ + η^2] |
265 J((ξ, η)) = @SMatrix[ | 273 J((ξ, η)) = @SMatrix[ |