mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-09-10 13:17:42 +00:00
ca7e2904cf
* Fix deprecation warnings from tests * Refactor tests so that ´@testset` is usually called in master file `runtests.jl`, not inside test file. Later on we can convert tests to examples. * Syntax of tests now follow more closely syntax used currently in JuliaFEM. We have had earlier studies with different kind of syntaxes, now we have kind of explicit way to do things.
20 lines
623 B
Julia
20 lines
623 B
Julia
# This file is a part of JuliaFEM.
|
|
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
|
|
|
using JuliaFEM, Test
|
|
|
|
# 1d strain
|
|
|
|
X = Dict(1 => [0.0, 0.0, 0.0], 2 => [1.0, 1.0, 1.0])
|
|
u = Dict(1 => [0.0, 0.0, 0.0], 2 => [1.0, 1.0, 1.0])
|
|
element = Element(Seg2, (1, 2))
|
|
update!(element, "geometry", X)
|
|
update!(element, "displacement", u)
|
|
xi, time = (0.0,), 0.0
|
|
detJ = element(xi, time, Val{:detJ})
|
|
J = element(xi, time, Val{:Jacobian})
|
|
# gradu = element("displacement", xi, time, Val{:Grad})
|
|
@debug("1d seg2 info", xi ,time, detJ, J)
|
|
@test isapprox(detJ, sqrt(3)/2)
|
|
@test isapprox(J, [0.5 0.5 0.5])
|