Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
simone-silvestri committed Jan 12, 2025
1 parent c059413 commit 7168b96
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions test/test_grids.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,34 +196,36 @@ function test_regular_rectilinear_xnode_ynode_znode_and_spacings(arch, FT)
@info " Testing grid utils on $grid_type grid...."

CUDA.@allowscalar begin
@test xnode(2, grid, Center()) FT/2)
@test ynode(2, grid, Center()) FT/2)
@test znode(2, grid, Center()) FT/2)

@test xnode(2, grid, Center()) FT/2)
@test ynode(2, grid, Center()) FT/2)
@test znode(2, grid, Center()) FT/2)

@test xnode(2, grid, Face()) FT/3)
@test ynode(2, grid, Face()) FT/3)
@test znode(2, grid, Face()) FT/3)
@test xnode(2, grid, Face()) FT/3)
@test ynode(2, grid, Face()) FT/3)
@test znode(2, grid, Face()) FT/3)

@test minimum_xspacing(grid) FT/3)
@test minimum_yspacing(grid) FT/3)
@test minimum_zspacing(grid) FT/3)
@test minimum_xspacing(grid) FT/3)
@test minimum_yspacing(grid) FT/3)
@test minimum_zspacing(grid) FT/3)

@test all(xspacings(grid, Center()) .≈ FT/N))
@test all(yspacings(grid, Center()) .≈ FT/N))
@test all(zspacings(grid, Center()) .≈ FT/N))
@test all(xspacings(grid, Center()) .≈ FT/N))
@test all(yspacings(grid, Center()) .≈ FT/N))
@test all(zspacings(grid, Center()) .≈ FT/N))

@test all(x FT/N) for x in xspacings(grid, Face()))
@test all(y FT/N) for y in yspacings(grid, Face()))
@test all(z FT/N) for z in zspacings(grid, Face()))
@test all(x FT/N) for x in xspacings(grid, Face()))
@test all(y FT/N) for y in yspacings(grid, Face()))
@test all(z FT/N) for z in zspacings(grid, Face()))

@test all(xspacings(grid, Face()) .== xspacings(grid, Face(), Center(), Center()))
@test all(yspacings(grid, Face()) .== yspacings(grid, Center(), Face(), Center()))
@test all(zspacings(grid, Face()) .== zspacings(grid, Center(), Center(), Face()))
@test all(xspacings(grid, Face()) .== xspacings(grid, Face(), Center(), Center()))
@test all(yspacings(grid, Face()) .== yspacings(grid, Center(), Face(), Center()))
@test all(zspacings(grid, Face()) .== zspacings(grid, Center(), Center(), Face()))

@test Δx(1, 1, 1, grid, Face(), Center(), Center()) FT/N)
@test Δy(1, 1, 1, grid, Center(), Face(), Center()) FT/N)
@test Δz(1, 1, 1, grid, Center(), Center(), Face()) FT/N)
end
@test Δx(1, 1, 1, grid, Face(), Center(), Center()) FT/N)
@test Δy(1, 1, 1, grid, Center(), Face(), Center()) FT/N)
@test Δz(1, 1, 1, grid, Center(), Center(), Face()) FT/N)

end # CUDA.@allowscalar
end

return nothing
Expand Down

0 comments on commit 7168b96

Please sign in to comment.