Files
JuliaFEM.jl/test/test_elements_add_fields.jl
T

19 lines
629 B
Julia
Raw Normal View History

2016-02-11 21:28:16 +02:00
# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
2016-06-02 22:58:54 +03:00
using JuliaFEM
using JuliaFEM.Testing
2016-02-11 21:28:16 +02:00
2016-08-04 13:15:19 +03:00
@testset "dict field" begin
el = Element(Seg2, 1, [1, 2])
X = Dict{Int64, Vector{Float64}}(1 => [0.0, 0.0], 2 => [1.0, 0.0], 3 => [0.5, 0.5])
f = Field(X)
debug("field = $f")
#update!(el, "geometry", X)
el["geometry"] = f
@test isapprox(el("geometry")[1], [0.0, 0.0])
@test isapprox(el("geometry", 0.0)[1], [0.0, 0.0])
@test isapprox(el("geometry", 0.0)[3], [0.5, 0.5])
@test isapprox(el("geometry", [0.0], 0.0), [0.5, 0.0])
end