comparison test/Grids/grid_test.jl @ 2052:a590dc4af7ea feature/sbp_operators/laplace_curvilinear

Merge feature/grids/geometry_functions
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 06 Feb 2026 17:35:25 +0100
parents 3edcf447298d
children
comparison
equal deleted inserted replaced
2040:17efc56f1f45 2052:a590dc4af7ea
112 ] 112 ]
113 v = [A .+ 100*i .+ 10*j for i ∈ 1:3, j∈ 1:4] 113 v = [A .+ 100*i .+ 10*j for i ∈ 1:3, j∈ 1:4]
114 @test ArrayComponentView(v, (1:2, 1:2)) == [@SMatrix[1 4;2 5] .+ 100*i .+ 10*j for i ∈ 1:3, j∈ 1:4] 114 @test ArrayComponentView(v, (1:2, 1:2)) == [@SMatrix[1 4;2 5] .+ 100*i .+ 10*j for i ∈ 1:3, j∈ 1:4]
115 @test ArrayComponentView(v, (2:3, 1:2)) == [@SMatrix[2 5;3 6] .+ 100*i .+ 10*j for i ∈ 1:3, j∈ 1:4] 115 @test ArrayComponentView(v, (2:3, 1:2)) == [@SMatrix[2 5;3 6] .+ 100*i .+ 10*j for i ∈ 1:3, j∈ 1:4]
116 end 116 end
117
118 @testset "size" begin
119 v = [@SMatrix[1 3; 2 4] .+ 100*i .+ 10*j for i ∈ 1:3, j∈ 1:4]
120 cv = ArrayComponentView(v, (1, 1))
121
122 @test size(cv) == (3,4)
123 end
124
125 @testset "IndexStyle" begin
126 v = [@SMatrix[1 3; 2 4] .+ 100*i .+ 10*j for i ∈ 1:3, j∈ 1:4]
127 cv = ArrayComponentView(v, (1, 1))
128
129 @test IndexStyle(cv) == IndexStyle(v)
130 end
131
132 @testset "_array_type" begin
133 v = [@SMatrix[1 3; 2 4] .+ 100*i .+ 10*j for i ∈ 1:3, j∈ 1:4]
134 cv = ArrayComponentView(v, (1, 1))
135
136 @test Grids._array_type(cv) == typeof(v)
137 end
117 end 138 end
118 139
119 @testset "_ncomponents" begin 140 @testset "_ncomponents" begin
120 @test Grids._ncomponents(Int) == 1 141 @test Grids._ncomponents(Int) == 1
121 @test Grids._ncomponents(Float64) == 1 142 @test Grids._ncomponents(Float64) == 1