Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eliascarv committed Nov 6, 2024
1 parent 8c81a28 commit 145c0b3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/coarsening.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
grid = CartesianGrid(cart(0, 0), cart(11, 17), dims=(11, 17))
tgrid = CartesianGrid(cart(0, 0), cart(11, 17), dims=(3, 6))
@test coarsen(grid, RegularCoarsening(5, 3)) == tgrid
rgrid = convert(RectilinearGrid, grid)
@test size(coarsen(rgrid, RegularCoarsening(5, 3)) ) == (3, 6)
sgrid = convert(StructuredGrid, grid)
@test size(coarsen(sgrid, RegularCoarsening(5, 3))) == (3, 6)
tfgrid = TransformedGrid(grid, Identity())
@test size(coarsen(tfgrid, RegularCoarsening(5, 3))) == (3, 6)

# 3D grids
grid = cartgrid(100, 100, 100)
Expand All @@ -38,4 +44,10 @@
grid = CartesianGrid(cart(0, 0, 0), cart(11, 17, 23), dims=(11, 17, 23))
tgrid = CartesianGrid(cart(0, 0, 0), cart(11, 17, 23), dims=(2, 4, 8))
@test coarsen(grid, RegularCoarsening(7, 5, 3)) == tgrid
rgrid = convert(RectilinearGrid, grid)
@test size(coarsen(rgrid, RegularCoarsening(7, 5, 3)) ) == (2, 4, 8)
sgrid = convert(StructuredGrid, grid)
@test size(coarsen(sgrid, RegularCoarsening(7, 5, 3))) == (2, 4, 8)
tfgrid = TransformedGrid(grid, Identity())
@test size(coarsen(tfgrid, RegularCoarsening(7, 5, 3))) == (2, 4, 8)
end

0 comments on commit 145c0b3

Please sign in to comment.