-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #108 from sintefmath/weno-tests
Tests + less stringent types in WENO
- Loading branch information
Showing
4 changed files
with
66 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ include("partitioning.jl") | |
include("units.jl") | ||
include("sparsity.jl") | ||
include("nfvm.jl") | ||
include("weno.jl") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Jutul, Test | ||
@testset "WENO setup" begin | ||
mesh_2d = UnstructuredMesh(CartesianMesh((3, 3))) | ||
@testset "2D" begin | ||
call = Jutul.WENO.weno_discretize_cells(DataDomain(mesh_2d)) | ||
ix = 5 | ||
c = call[ix] | ||
pset = c.planar_set | ||
cells = map(x -> x.cell, c.stencil) | ||
|
||
@test length(pset) == 4 | ||
for quad in pset | ||
@test length(quad) == 3 | ||
i, j, k = quad | ||
@test cells[i] == ix | ||
# Neighbor set in 2D should TPFA pairs of 2, 4, 6, 8 | ||
c1 = cells[j] | ||
c2 = cells[k] | ||
if c1 > c2 | ||
c2, c1 = c1, c2 | ||
end | ||
@test (c1, c2) in [(2, 4), (4, 8), (6, 8), (2, 6)] | ||
end | ||
end | ||
mesh_3d = UnstructuredMesh(CartesianMesh((3, 3, 3))) | ||
|
||
w2d = Jutul.WENO.weno_discretize(DataDomain(mesh_2d)) | ||
@test length(w2d) == number_of_faces(mesh_2d) | ||
@test eltype(w2d) == Jutul.WENO.WENOFaceDiscretization{2, 3, Float64} | ||
w3d = Jutul.WENO.weno_discretize(DataDomain(mesh_3d)) | ||
@test length(w3d) == number_of_faces(mesh_3d) | ||
@test eltype(w3d) == Jutul.WENO.WENOFaceDiscretization{3, 4, Float64} | ||
end |
2722a3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
2722a3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/120320
Tip: Release Notes
Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.
To add them here just re-invoke and the PR will be updated.
Tagging
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: