Mercurial > repos > public > sbplib_julia
comparison test/Grids/grid_test.jl @ 1427:26e168924cf1 feature/grids/curvilinear
Merge default
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 23 Aug 2023 15:51:32 +0200 |
parents | 86026367a9ff |
children | 276c38a48aac d50ea06813d5 |
comparison
equal
deleted
inserted
replaced
1426:9c689a627244 | 1427:26e168924cf1 |
---|---|
36 @test eval_on(ZeroDimGrid(@SVector[3.,2.]), x̄->x̄[1]+x̄[2]) == fill(5.) | 36 @test eval_on(ZeroDimGrid(@SVector[3.,2.]), x̄->x̄[1]+x̄[2]) == fill(5.) |
37 | 37 |
38 @test eval_on(ZeroDimGrid(1.), x̄->2x̄) isa LazyArray | 38 @test eval_on(ZeroDimGrid(1.), x̄->2x̄) isa LazyArray |
39 @test eval_on(ZeroDimGrid(1.), x̄->2x̄) == fill(2.) | 39 @test eval_on(ZeroDimGrid(1.), x̄->2x̄) == fill(2.) |
40 | 40 |
41 @test eval_on(ZeroDimGrid(@SVector[1.,2.]), π) isa LazyArray | |
42 @test eval_on(ZeroDimGrid(@SVector[1.,2.]), π) == fill(π) | |
43 | |
41 @test eval_on(EquidistantGrid(range(0,1,length=4)), x->2x) isa LazyArray | 44 @test eval_on(EquidistantGrid(range(0,1,length=4)), x->2x) isa LazyArray |
42 @test eval_on(EquidistantGrid(range(0,1,length=4)), x->2x) == 2 .* range(0,1,length=4) | 45 @test eval_on(EquidistantGrid(range(0,1,length=4)), x->2x) == 2 .* range(0,1,length=4) |
43 | 46 |
44 | 47 |
45 g = equidistant_grid((5,3), (0.0,0.0), (2.0,1.0)) | 48 g = equidistant_grid((5,3), (0.0,0.0), (2.0,1.0)) |
46 | 49 |
47 @test eval_on(g, x̄ -> 0.) isa LazyArray | 50 @test eval_on(g, x̄ -> 0.) isa LazyArray |
48 @test eval_on(g, x̄ -> 0.) == fill(0., (5,3)) | 51 @test eval_on(g, x̄ -> 0.) == fill(0., (5,3)) |
49 | 52 |
50 @test eval_on(g, x̄ -> sin(x̄[1])*cos(x̄[2])) == map(x̄->sin(x̄[1])*cos(x̄[2]), g) | 53 @test eval_on(g, x̄ -> sin(x̄[1])*cos(x̄[2])) == map(x̄->sin(x̄[1])*cos(x̄[2]), g) |
54 | |
55 @test eval_on(g, π) == fill(π, (5,3)) | |
51 | 56 |
52 # Vector valued function | 57 # Vector valued function |
53 @test eval_on(g, x̄ -> @SVector[x̄[2], x̄[1]]) isa LazyArray{SVector{2,Float64}} | 58 @test eval_on(g, x̄ -> @SVector[x̄[2], x̄[1]]) isa LazyArray{SVector{2,Float64}} |
54 @test eval_on(g, x̄ -> @SVector[x̄[2], x̄[1]]) == map(x̄ -> @SVector[x̄[2], x̄[1]], g) | 59 @test eval_on(g, x̄ -> @SVector[x̄[2], x̄[1]]) == map(x̄ -> @SVector[x̄[2], x̄[1]], g) |
55 | 60 |