mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-09-24 11:16:47 +00:00
Calculate shape functions using FEMBasis.jl
A lot of code is moved to FEMBasis.jl regarding calculating basis / shape functions of finite elements. * add FEMBasis to REQUIRE * remove obsolete files * remove obsolete test files * make integration point iterable * loosen type definitions * get length of element rather from basis than connectivity * calculate midpoint of reference element * wrong input argument to eval_basis! fixed
This commit is contained in:
+15
-4
@@ -1,9 +1,7 @@
|
||||
# This file is a part of JuliaFEM.
|
||||
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
||||
|
||||
abstract type AbstractElement end
|
||||
|
||||
type Element{E<:AbstractElement}
|
||||
type Element{E<:AbstractBasis}
|
||||
id :: Int
|
||||
connectivity :: Vector{Int}
|
||||
integration_points :: Vector{IP}
|
||||
@@ -17,10 +15,23 @@ Examples
|
||||
--------
|
||||
julia> element = Element(Tri3, [1, 2, 3])
|
||||
"""
|
||||
function Element{E<:AbstractElement}(::Type{E}, connectivity::Vector{Int})
|
||||
function Element{E<:AbstractBasis}(::Type{E}, connectivity::Vector{Int})
|
||||
return Element{E}(-1, connectivity, [], Dict(), E())
|
||||
end
|
||||
|
||||
"""
|
||||
length(element::Element)
|
||||
|
||||
Return the number of nodes in element.
|
||||
"""
|
||||
function length{B}(element::Element{B})
|
||||
return length(B)
|
||||
end
|
||||
|
||||
function size{B}(element::Element{B})
|
||||
return size(B)
|
||||
end
|
||||
|
||||
function getindex(element::Element, field_name::AbstractString)
|
||||
return element.fields[field_name]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user