comparison test/Grids/manifolds_test.jl @ 1921:7fb713570965 feature/grids/manifolds

Add test for jacobian
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 06 Feb 2025 08:41:50 +0100
parents ae83c91286a2
children a2923694d5b7
comparison
equal deleted inserted replaced
1920:ae83c91286a2 1921:7fb713570965
2 2
3 using Diffinitive.Grids 3 using Diffinitive.Grids
4 using Diffinitive.RegionIndices 4 using Diffinitive.RegionIndices
5 using Diffinitive.LazyTensors 5 using Diffinitive.LazyTensors
6 6
7 using StaticArrays
8
7 @testset "Chart" begin 9 @testset "Chart" begin
8 c = Chart(x->2x, unitsquare()) 10 X(ξ) = 2ξ
11 Grids.jacobian(::typeof(X), ξ) = @SVector[2,2]
12 c = Chart(X, unitsquare())
9 @test c isa Chart{2} 13 @test c isa Chart{2}
10 @test c([3,2]) == [6,4] 14 @test c([3,2]) == [6,4]
11 @test parameterspace(c) == unitsquare() 15 @test parameterspace(c) == unitsquare()
12 @test ndims(c) == 2 16 @test ndims(c) == 2
13 17
14 @test_broken jacobian(c, [3,2]) 18 @test jacobian(c, [3,2]) == [2,2]
15 end 19 end
16 20
17 @testset "CartesianAtlas" begin 21 @testset "CartesianAtlas" begin
18 c = Chart(identity, unitsquare()) 22 c = Chart(identity, unitsquare())
19 23