2016-07-03 05:01:18 +03:00
|
|
|
# This file is a part of JuliaFEM.
|
|
|
|
|
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
|
|
|
|
|
2017-08-05 11:33:43 +03:00
|
|
|
using FEMBasis
|
2017-01-30 12:28:33 +02:00
|
|
|
|
2017-08-05 11:33:43 +03:00
|
|
|
# "Poi1" => (0, 1),
|
|
|
|
|
"1 node discrete point element",
|
|
|
|
|
type Poi1 <: AbstractBasis
|
2016-07-03 05:01:18 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function get_basis(element::Element{Poi1}, ip, time)
|
|
|
|
|
return [1]
|
|
|
|
|
end
|
|
|
|
|
|
2016-07-14 12:43:41 +03:00
|
|
|
function get_dbasis(element::Element{Poi1}, ip, time)
|
|
|
|
|
return [0]
|
|
|
|
|
end
|
|
|
|
|
|
2016-11-13 13:24:08 +02:00
|
|
|
function (element::Element{Poi1})(ip, time::Float64, ::Type{Val{:detJ}})
|
2016-07-03 05:01:18 +03:00
|
|
|
return 1.0
|
|
|
|
|
end
|
|
|
|
|
|
2016-07-03 21:16:03 +03:00
|
|
|
function get_integration_order(element::Poi1)
|
|
|
|
|
return 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function get_integration_points(element::Poi1, order::Int64)
|
2017-08-13 21:56:52 +03:00
|
|
|
return [ (1.0, 0.0) ]
|
2016-07-03 21:16:03 +03:00
|
|
|
end
|
|
|
|
|
|
2017-08-05 11:33:43 +03:00
|
|
|
function size(::Type{Poi1})
|
|
|
|
|
return (0, 1)
|
2016-07-03 05:01:18 +03:00
|
|
|
end
|
|
|
|
|
|
2017-08-05 11:33:43 +03:00
|
|
|
function length(::Type{Poi1})
|
|
|
|
|
return 1
|
2016-07-03 05:01:18 +03:00
|
|
|
end
|
|
|
|
|
|
2017-08-05 11:33:43 +03:00
|
|
|
function FEMBasis.get_reference_element_coordinates(::Type{Poi1})
|
|
|
|
|
Vector{Float64}[[0.0]]
|
2016-07-03 05:01:18 +03:00
|
|
|
end
|
|
|
|
|
|
2017-08-05 11:33:43 +03:00
|
|
|
function get_basis{B}(element::Element{B}, ip, time)
|
|
|
|
|
T = typeof(first(ip))
|
|
|
|
|
N = zeros(T, 1, length(B))
|
|
|
|
|
eval_basis!(B, N, tuple(ip...))
|
|
|
|
|
return N
|
2016-07-03 05:01:18 +03:00
|
|
|
end
|
|
|
|
|
|
2017-08-05 11:33:43 +03:00
|
|
|
function get_dbasis{B}(element::Element{B}, ip, time)
|
|
|
|
|
T = typeof(first(ip))
|
|
|
|
|
dN = zeros(T, size(B)...)
|
|
|
|
|
eval_dbasis!(B, dN, tuple(ip...))
|
|
|
|
|
return dN
|
2016-07-03 05:01:18 +03:00
|
|
|
end
|
|
|
|
|
|
2016-07-07 18:01:06 +03:00
|
|
|
function inside(::Union{Type{Seg2}, Type{Seg3}, Type{Quad4}, Type{Quad8},
|
2017-05-27 23:53:33 +02:00
|
|
|
Type{Quad9}, Type{Pyr5}, Type{Hex8}, Type{Hex20},
|
|
|
|
|
Type{Hex27}}, xi)
|
2016-07-07 18:01:06 +03:00
|
|
|
return all(-1.0 .<= xi .<= 1.0)
|
|
|
|
|
end
|
|
|
|
|
|
2016-07-10 04:26:21 +03:00
|
|
|
function inside(::Union{Type{Tri3}, Type{Tri6}, Type{Tri7}, Type{Tet4}, Type{Tet10}}, xi)
|
2016-07-07 18:01:06 +03:00
|
|
|
return all(xi .>= 0.0) && (sum(xi) <= 1.0)
|
|
|
|
|
end
|
|
|
|
|
|
2017-08-05 11:33:43 +03:00
|
|
|
function get_reference_coordinates{B}(element::Element{B})
|
|
|
|
|
return get_reference_element_coordinates(B)
|
2016-10-01 13:37:15 +03:00
|
|
|
end
|
2016-11-30 16:18:57 +02:00
|
|
|
|