Files
JuliaFEM.jl/src/types.jl
T

34 lines
808 B
Julia
Raw Normal View History

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