Skip to content

Commit

Permalink
improve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jlchan committed Dec 15, 2022
1 parent 2cfc024 commit d1f16ef
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ using LinearAlgebra
@test norm(sum(Dr,dims=2)) < tol
@test Dr*r ones(N+1)
end

@test NodesAndModes.face_vertices(Line()) == (1, 2)
end

area(elem::Quad) = 4.0
Expand Down Expand Up @@ -66,6 +68,10 @@ area(elem::Tri) = 2.0
@test Dr*r ones(length(r))
@test Ds*s ones(length(s))

# elem is either a tri or quad type
num_faces = (elem == Tri()) ? 3 : 4
@test length(NodesAndModes.face_vertices(elem)) == num_faces

# check for Kronecker structure
if elem == Quad()
r, s = nodes(elem, N)
Expand All @@ -88,6 +94,11 @@ volume(elem::Wedge) = 4
volume(elem::Pyr) = 8/3
volume(elem::Tet) = 4/3

num_faces(::Tet) = 4
num_faces(::Wedge) = 5
num_faces(::Pyr) = 5
num_faces(::Hex) = 6

@testset "3D $elem basis tests" for elem in (Hex(), Wedge(), Pyr(), Tet())

tol = 5e2 * eps()
Expand Down Expand Up @@ -122,6 +133,10 @@ volume(elem::Tet) = 4/3
@test Dr * r one.(r)
@test Ds * s one.(s)
@test Dt * t one.(t)

# TODO: add this test for Pyr when implemented
@test length(NodesAndModes.face_vertices(elem)) == num_faces(elem)

elseif elem == Pyr()
r, s, t = nodes(elem, N)
rq, sq, tq, wq = quad_nodes(elem, N)
Expand Down

2 comments on commit d1f16ef

@jlchan
Copy link
Owner Author

@jlchan jlchan commented on d1f16ef Dec 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

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/74157

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:

git tag -a v0.8.4 -m "<description of version>" d1f16ef4547c5417e85d9cf80387b357c44468be
git push origin v0.8.4

Please sign in to comment.