-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshape.f90
More file actions
104 lines (72 loc) · 2.28 KB
/
shape.f90
File metadata and controls
104 lines (72 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
! Part of Zinc FE package. Author: John Blackburn
module shape
implicit none
double precision, private, save :: xic(8),etac(8),muc(8),xic2d(4),etac2d(4)
data xic/-1, 1, 1,-1,-1, 1, 1,-1/
data etac/-1,-1, 1, 1,-1,-1, 1, 1/
data muc/-1,-1,-1,-1, 1, 1, 1, 1/
data xic2d /-1,+1,+1,-1/
data etac2d/-1,-1,+1,+1/
contains
! ######################################################################
function dNdxi(l,xi,eta,mu)
use common, only : NDIM
integer l
double precision dNdxi,xi,eta,mu
if (NDIM==3) then
dNdxi=0.125*xic(l)*(1+eta*etac(l))*(1+mu*muc(l))
else if (NDIM==2) then
dNdxi=0.250*xic(l)*(1+eta*etac(l))
else
dNdxi=0.500*xic(l)
endif
end function dNdxi
! ######################################################################
function dNdeta(l,xi,eta,mu) ! 2D or 3D
use common, only : NDIM
integer l
double precision dNdeta,xi,eta,mu
if (NDIM==3) then
dNdeta=0.125*etac(l)*(1+xi*xic(l))*(1+mu*muc(l))
else
dNdeta=0.125*etac(l)*(1+xi*xic(l))
endif
end function dNdeta
! ######################################################################
function dNdmu(l,xi,eta,mu) ! 3D only
integer l
double precision dNdmu,xi,eta,mu
dNdmu=0.125*muc(l)*(1+xi*xic(l))*(1+eta*etac(l))
end function dNdmu
! ######################################################################
function Nl(l,xi,eta,mu)
use common, only : NDIM
integer l
double precision Nl,xi,eta,mu
if (NDIM==3) then
Nl=0.125*(1+xi*xic(l))*(1+eta*etac(l))*(1+mu*muc(l))
else if (NDIM==2) then
Nl=0.250*(1+xi*xic(l))*(1+eta*etac(l))
else
Nl=0.500*(1+xi*xic(l))
endif
end function Nl
! ######################################################################
function N2d(l,xi,eta)
double precision N2d,xi,eta
integer l
N2d=0.25*(1+xi*xic2d(l))*(1+eta*etac2d(l))
end function N2d
! ######################################################################
function dN2d_dxi(l,xi,eta)
double precision dN2d_dxi,xi,eta
integer l
dN2d_dxi=0.25*xic2d(l)*(1+eta*etac2d(l))
end function dN2d_dxi
! ######################################################################
function dN2d_deta(l,xi,eta)
double precision dN2d_deta,xi,eta
integer l
dN2d_deta=0.25*(1+xi*xic2d(l))*etac2d(l)
end function dN2d_deta
end module shape