Skip to content

Commit

Permalink
coverage back to 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
ahojukka5 committed Dec 27, 2017
1 parent 6f7b3f1 commit b5628e2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/test_elements.jl
Expand Up @@ -361,3 +361,15 @@ end
update!(el, "geometry", X)
@test_throws Exception get_local_coordinates(el, [0.1, 0.1], 0.0; max_iterations=0)
end

@testset "analytical functions as fields" begin
f(xi, time) = xi[1]*time
g(element, xi, time) = element("geometry", xi, time)*time
X = Dict(1 => [0.0, 0.0], 2 => [1.0, 0.0], 3 => [1.0, 1.0], 4 => [0.0, 1.0])
el = Element(Quad4, [1, 2, 3, 4])
update!(el, "geometry", X)
update!(el, "f", f)
update!(el, "g", g)
@test isapprox(el("f", (0.5, 0.5), 2.0), 1.0)
@test isapprox(el("g", (0.0, 0.0), 2.0), [1.0, 1.0])
end
2 changes: 2 additions & 0 deletions test/test_fields.jl
Expand Up @@ -122,6 +122,8 @@ end
fld = DVTVd(0.0 => f1)
update!(fld, 1.0 => f2)
@test isapprox(interpolate(fld, 0.5)[1], 1.5)
update!(fld, 1.0 => f1)
@test isapprox(interpolate(fld, 0.5)[1], 1.0)
end

@testset "use of common constructor field" begin
Expand Down

0 comments on commit b5628e2

Please sign in to comment.