Files
JuliaFEM.jl/src/integrate.jl
T

82 lines
2.5 KiB
Julia
Raw Normal View History

2015-10-27 06:37:58 +02:00
# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
2015-11-24 03:06:56 +02:00
# Let's drop here all integration schemes and some defaults for different element types
2015-11-05 10:20:00 +02:00
2015-11-24 03:06:56 +02:00
function get_integration_points(Quad4::Element)
2015-10-27 06:37:58 +02:00
[
IntegrationPoint(1.0/sqrt(3.0)*[-1, -1], 1.0),
IntegrationPoint(1.0/sqrt(3.0)*[ 1, -1], 1.0),
IntegrationPoint(1.0/sqrt(3.0)*[ 1, 1], 1.0),
IntegrationPoint(1.0/sqrt(3.0)*[-1, 1], 1.0)
]
end
2015-11-24 03:06:56 +02:00
typealias LineElement Union{Seg2, Seg3}
2015-11-18 01:19:04 +02:00
2015-11-24 03:06:56 +02:00
function get_integration_points(element::LineElement, ::Type{Val{1}})
2015-10-27 06:37:58 +02:00
[
IntegrationPoint([0.0], 2.0)
]
end
2015-11-11 00:52:16 +02:00
2015-11-24 03:06:56 +02:00
function get_integration_points(element::LineElement, ::Type{Val{2}})
2015-11-18 01:19:04 +02:00
[
IntegrationPoint([-sqrt(1/3)], 1)
IntegrationPoint([+sqrt(1/3)], 1)
]
end
2015-11-24 03:06:56 +02:00
function get_integration_points(element::LineElement, ::Type{Val{3}})
2015-11-11 00:52:16 +02:00
[
IntegrationPoint([0.0], 8/9),
IntegrationPoint([-sqrt(3/5)], 5/9),
IntegrationPoint([+sqrt(3/5)], 5/9)
]
end
2015-11-24 03:06:56 +02:00
function get_integration_points(element::LineElement, ::Type{Val{4}})
2015-11-18 01:19:04 +02:00
[
IntegrationPoint([+sqrt(3/7 - 2/7*sqrt(6/5))], (18+sqrt(30))/36)
IntegrationPoint([-sqrt(3/7 - 2/7*sqrt(6/5))], (18+sqrt(30))/36)
IntegrationPoint([+sqrt(3/7 + 2/7*sqrt(6/5))], (18-sqrt(30))/36)
IntegrationPoint([-sqrt(3/7 + 2/7*sqrt(6/5))], (18-sqrt(30))/36)
]
end
2015-11-24 03:06:56 +02:00
function get_integration_points(element::LineElement, ::Type{Val{5}})
2015-11-11 00:52:16 +02:00
[
IntegrationPoint([-1/3*sqrt(5 + 2*sqrt(10/7))], (322-13*sqrt(70))/900),
IntegrationPoint([-1/3*sqrt(5 - 2*sqrt(10/7))], (322+13*sqrt(70))/900),
IntegrationPoint([0.0], 128/225),
IntegrationPoint([ 1/3*sqrt(5 - 2*sqrt(10/7))], (322+13*sqrt(70))/900),
IntegrationPoint([ 1/3*sqrt(5 + 2*sqrt(10/7))], (322-13*sqrt(70))/900)
]
end
2015-11-24 03:06:56 +02:00
function get_integration_points(element::Seg2)
return get_integration_points(element, Val{1})
2015-11-18 01:19:04 +02:00
end
2015-11-11 00:52:16 +02:00
2015-11-24 03:06:56 +02:00
function get_integration_points(element::Seg3)
return get_integration_points(element, Val{2})
2015-11-18 01:19:04 +02:00
end
2015-11-24 03:06:56 +02:00
2015-11-25 10:08:24 +02:00
### 3D elements
function get_integration_points(element::Tet10, ::Type{Val{4}})
a = .585410196624969
b = .138196601125011
w = .041666666666667
integration_points = [
IntegrationPoint([a, b, b], w),
IntegrationPoint([b, a, b], w),
IntegrationPoint([b, b, a], w),
IntegrationPoint([b, b, b], w)]
end
function get_integration_points(element::Tet10)
return get_integration_points(element, Val{4})
end