Skip to content

Commit

Permalink
Add tests for 'RectilinearGrid' and 'StructuredGrid' (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliascarv authored Jan 17, 2024
1 parent f02a0e7 commit a4a64ed
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 0 deletions.
Binary file added test/data/reactilineargrid2D-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/data/reactilineargrid2D-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/data/reactilineargrid2D-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/data/reactilineargrid2D-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/data/reactilineargrid2D-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/data/reactilineargrid2D-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/data/structuredgrid2D-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/data/structuredgrid2D-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/data/structuredgrid2D-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/data/structuredgrid2D-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/data/structuredgrid2D-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/data/structuredgrid2D-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,28 @@ rng = MersenneTwister(2)
@test_reference joinpath(datadir, "meshview3D-2.png") viz(v, color=1:500)
@test_reference joinpath(datadir, "meshview3D-3.png") viz(v, color=1:500, colorscheme=:inferno)

# reactilinear grid
x = 0:0.2:1
y = [0.0, 0.1, 0.3, 0.7, 0.9, 1.0]
g = RectilinearGrid(x, y)
@test_reference joinpath(datadir, "reactilineargrid2D-1.png") viz(g, showfacets=true)
@test_reference joinpath(datadir, "reactilineargrid2D-2.png") viz(g, showfacets=true, facetcolor=:red)
@test_reference joinpath(datadir, "reactilineargrid2D-3.png") viz(g, color=1:25, colorscheme=:inferno)
@test_reference joinpath(datadir, "reactilineargrid2D-4.png") viz(g, color=:red, alpha=0.5, showfacets=true)
@test_reference joinpath(datadir, "reactilineargrid2D-5.png") viz(g, color=1:25, showfacets=true, facetcolor=:red)
@test_reference joinpath(datadir, "reactilineargrid2D-6.png") viz(g, showfacets=true, facetcolor=:red, segmentsize=5)

# structured grid
X = [i / 20 * cos(3π / 2 * (j - 1) / (30 - 1)) for i in 1:20, j in 1:30]
Y = [i / 20 * sin(3π / 2 * (j - 1) / (30 - 1)) for i in 1:20, j in 1:30]
g = StructuredGrid(X, Y)
@test_reference joinpath(datadir, "structuredgrid2D-1.png") viz(g, showfacets=true)
@test_reference joinpath(datadir, "structuredgrid2D-2.png") viz(g, showfacets=true, facetcolor=:red)
@test_reference joinpath(datadir, "structuredgrid2D-3.png") viz(g, color=1:551, colorscheme=:inferno)
@test_reference joinpath(datadir, "structuredgrid2D-4.png") viz(g, color=:red, alpha=0.5, showfacets=true)
@test_reference joinpath(datadir, "structuredgrid2D-5.png") viz(g, color=1:551, showfacets=true, facetcolor=:red)
@test_reference joinpath(datadir, "structuredgrid2D-6.png") viz(g, showfacets=true, facetcolor=:red, segmentsize=5)

# missing values
rng = MersenneTwister(123)
d = CartesianGrid(2, 2)
Expand Down

0 comments on commit a4a64ed

Please sign in to comment.