2015-08-16 13:33:02 +03:00
|
|
|
# This file is a part of JuliaFEM.
|
|
|
|
|
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
|
|
|
|
|
2015-11-05 10:20:00 +02:00
|
|
|
function ForwardDiff.derivative{T}(f::Function, S::Matrix{T}, args...)
|
|
|
|
|
shape = size(S)
|
|
|
|
|
wrapper(S::Vector) = f(reshape(S, shape))
|
|
|
|
|
deriv = ForwardDiff.gradient(wrapper, vec(S), args...)
|
|
|
|
|
return reshape(deriv, shape)
|
|
|
|
|
end
|
2015-10-21 07:24:19 +03:00
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
Integration point
|
|
|
|
|
|
2015-11-05 10:20:00 +02:00
|
|
|
xi
|
2015-10-21 07:24:19 +03:00
|
|
|
(dimensionless) coordinates of integration point
|
2015-11-05 10:20:00 +02:00
|
|
|
weight
|
|
|
|
|
integration weight
|
|
|
|
|
fields
|
|
|
|
|
FieldSet what can be used to store internal variables, stress, strain, ...
|
2015-10-21 07:24:19 +03:00
|
|
|
"""
|
|
|
|
|
type IntegrationPoint
|
2015-10-30 12:40:56 +02:00
|
|
|
xi :: Vector
|
2015-10-21 07:24:19 +03:00
|
|
|
weight :: Float64
|
2015-11-05 10:20:00 +02:00
|
|
|
fields :: FieldSet
|
2015-10-21 07:24:19 +03:00
|
|
|
end
|
2015-11-05 10:20:00 +02:00
|
|
|
|
2015-10-21 07:24:19 +03:00
|
|
|
function IntegrationPoint(xi, weight)
|
|
|
|
|
IntegrationPoint(xi, weight, Dict())
|
|
|
|
|
end
|
|
|
|
|
|
2015-11-05 10:20:00 +02:00
|
|
|
function Base.convert(::Type{Number}, ip::IntegrationPoint)
|
|
|
|
|
return ip.xi
|
|
|
|
|
end
|
2015-11-11 00:52:16 +02:00
|
|
|
|
|
|
|
|
function Base.call(basis::Basis, ip::IntegrationPoint)
|
|
|
|
|
return basis(ip.xi)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Base.call(basis::Basis, increment::Increment, ip::IntegrationPoint)
|
|
|
|
|
return call(basis, increment, ip.xi)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Base.call(basis::Basis, increment::Increment, ip::IntegrationPoint, ::Type{Val{:grad}})
|
|
|
|
|
return call(basis, increment, ip.xi, Val{:grad})
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function Base.call(basis::Basis, geometry::Increment, field::Increment, ip::IntegrationPoint, ::Type{Val{:grad}})
|
|
|
|
|
return call(basis, geometry, field, ip.xi, Val{:grad})
|
|
|
|
|
end
|