mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-10-02 22:31:31 +00:00
all tests pass now
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user