view test/Grids/manifolds_test.jl @ 1914:e7f8d11c4670 feature/grids/manifolds

Delete functions related to geometries as they don't belong on this branch
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 03 Feb 2025 15:39:26 +0100
parents 04c251bccbd4
children b1560da986f3
line wrap: on
line source

using Test

using Diffinitive.Grids
using Diffinitive.RegionIndices
using Diffinitive.LazyTensors

@testset "Chart" begin
    c = Chart(x->2x, unitsquare())
    @test c isa Chart{2}
    @test c([3,2]) == [6,4]
    @test parameterspace(c) == unitsquare()
    @test ndims(c) == 2

    @test_broken jacobian(c, [3,2])
end

@testset "CartesianAtlas" begin
    c = Chart(identity, unitsquare())

    a = CartesianAtlas([c c; c c])
    @test a isa Atlas
    @test charts(a) == [c c; c c]
    @test_broken connections(a) == [
        (
            ((1,1), CartesianBoundary{1,UpperBoundary}()),
            ((1,2), CartesianBoundary{1,LowerBoundary}()),
        ),
        (
            ((1,1), CartesianBoundary{2,LowerBoundary}()),
            ((2,1), CartesianBoundary{2,UpperBoundary}()),
        ),
        (
            ((2,2), CartesianBoundary{1,LowerBoundary}()),
            ((2,1), CartesianBoundary{1,UpperBoundary}()),
        ),
        (
            ((2,2), CartesianBoundary{2,UpperBoundary}()),
            ((1,2), CartesianBoundary{2,LowerBoundary}()),
        )
    ]
end

@testset "UnstructuredAtlas" begin
    @test_broken false
end