all tests pass now

This commit is contained in:
Jukka Aho
2016-07-03 21:16:03 +03:00
parent eec6db657d
commit 757ba2b3d9
52 changed files with 607 additions and 853 deletions
+11
View File
@@ -1,6 +1,9 @@
# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
using ForwardDiff
# TODO: evaluate partial derivatives of basis functions without forwarddiff
""" NURBS segment. """
type NSeg <: AbstractElement
order :: Int
@@ -98,6 +101,14 @@ function get_basis(element::Element{NSolid}, xi::Vector, time)
return N / sum(N)
end
# TODO: evaluate partial derivatives of basis functions without forwarddiff
""" Evaluate partial derivatives of basis functions using ForwardDiff. """
function get_dbasis{E<:Union{NSeg, NSurf, NSolid}}(element::Element{E}, ip, time)
xi = isa(ip, IP) ? ip.coords : ip
basis(xi) = vec(get_basis(element, xi, time))
return ForwardDiff.jacobian(basis, xi)'
end
function length(element::Element{NSeg})
nu = length(element.properties.knots) - element.properties.order - 1
return nu