comparison test/Grids/geometry_test.jl @ 2074:8fe7233067fb feature/sbp_operators/laplace_curvilinear

Merge feature/grids/geometry_functions
author Jonatan Werpers <jonatan@werpers.com>
date Tue, 17 Feb 2026 21:01:50 +0100
parents c36812de3f2d
children
comparison
equal deleted inserted replaced
2055:274f4c1ce4b5 2074:8fe7233067fb
319 319
320 @test ti(1/2, 0) == [1/2, 1/8] 320 @test ti(1/2, 0) == [1/2, 1/8]
321 @test ti(1/2, 1) == (c+d)/2 321 @test ti(1/2, 1) == (c+d)/2
322 @test ti(0, 1/2) == (a+d)/2 322 @test ti(0, 1/2) == (a+d)/2
323 @test ti(1, 1/2) == (b+c)/2 323 @test ti(1, 1/2) == (b+c)/2
324
325 @testset "Out of domain error" begin
326 @test_throws DomainError ti(-0.1, 0)
327 @test_throws DomainError ti(1.1, 0)
328 @test_throws DomainError ti(0, -0.1)
329 @test_throws DomainError ti(0, 1.1)
330 @test_throws DomainError ti(1.1, -0.1)
331 end
324 end 332 end
325 333
326 @testset "check_transfiniteinterpolation" begin 334 @testset "check_transfiniteinterpolation" begin
327 cs = polygon_edges([0,0],[1,0],[1,1],[0,1]) 335 cs = polygon_edges([0,0],[1,0],[1,1],[0,1])
328 ti = TransfiniteInterpolationSurface(cs...) 336 ti = TransfiniteInterpolationSurface(cs...)
383 mid(x,y) = (x+y)/2 391 mid(x,y) = (x+y)/2
384 @test Grids.jacobian(ti, [1/2, 0]) ≈ [b-a mid(c,d)-mid(a,b)] 392 @test Grids.jacobian(ti, [1/2, 0]) ≈ [b-a mid(c,d)-mid(a,b)]
385 @test Grids.jacobian(ti, [1/2, 1]) ≈ [c-d mid(c,d)-mid(a,b)] 393 @test Grids.jacobian(ti, [1/2, 1]) ≈ [c-d mid(c,d)-mid(a,b)]
386 @test Grids.jacobian(ti, [0, 1/2]) ≈ [mid(b,c)-mid(a,d) d-a] 394 @test Grids.jacobian(ti, [0, 1/2]) ≈ [mid(b,c)-mid(a,d) d-a]
387 @test Grids.jacobian(ti, [1, 1/2]) ≈ [mid(b,c)-mid(a,d) c-b] 395 @test Grids.jacobian(ti, [1, 1/2]) ≈ [mid(b,c)-mid(a,d) c-b]
388 end 396
389 end 397 @testset "Out of domain error" begin
398 @test_throws DomainError Grids.jacobian(ti, [-0.1, 0])
399 @test_throws DomainError Grids.jacobian(ti, [1.1, 0])
400 @test_throws DomainError Grids.jacobian(ti, [0, -0.1])
401 @test_throws DomainError Grids.jacobian(ti, [0, 1.1])
402 @test_throws DomainError Grids.jacobian(ti, [1.1, -0.1])
403 end
404 end
405 end