Mercurial > repos > public > sbplib_julia
comparison test/Grids/equidistant_grid_test.jl @ 1584:d7483e8af705 feature/sbp_operators/laplace_curvilinear
Merge feature/grids/manifolds
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 26 Apr 2024 08:45:54 +0200 |
parents | c3425b4302b8 |
children | d4a6f9effcdd |
comparison
equal
deleted
inserted
replaced
1563:6e910408c51a | 1584:d7483e8af705 |
---|---|
1 using Sbplib.Grids | 1 using Sbplib.Grids |
2 using Test | 2 using Test |
3 using Sbplib.RegionIndices | 3 using Sbplib.RegionIndices |
4 using Sbplib.LazyTensors | 4 using Sbplib.LazyTensors |
5 using StaticArrays | |
5 | 6 |
6 | 7 |
7 @testset "EquidistantGrid" begin | 8 @testset "EquidistantGrid" begin |
8 @test EquidistantGrid(0:0.1:10) isa EquidistantGrid | 9 @test EquidistantGrid(0:0.1:10) isa EquidistantGrid |
9 @test EquidistantGrid(range(0,1,length=10)) isa EquidistantGrid | 10 @test EquidistantGrid(range(0,1,length=10)) isa EquidistantGrid |
141 (0.,0.) (0.,7.11/2) (0.,7.11)] | 142 (0.,0.) (0.,7.11/2) (0.,7.11)] |
142 for i ∈ eachindex(gp) | 143 for i ∈ eachindex(gp) |
143 @test [gp[i]...] ≈ [p[i]...] atol=5e-13 | 144 @test [gp[i]...] ≈ [p[i]...] atol=5e-13 |
144 end | 145 end |
145 end | 146 end |
147 | |
148 | |
149 @testset "equidistant_grid(::ParameterSpace)" begin | |
150 ps = HyperBox((0,0),(2,1)) | |
151 | |
152 @test equidistant_grid(ps, 3,4) == equidistant_grid((0,0), (2,1), 3,4) | |
153 end | |
146 end | 154 end |
147 | 155 |
148 | 156 |
149 @testset "change_length" begin | 157 @testset "change_length" begin |
150 @test Grids.change_length(0:20, 21) == 0:20 | 158 @test Grids.change_length(0:20, 21) == 0:20 |