CalculiX  2.13
A Free Software Three-Dimensional Structural Finite Element Program
shape20h_ax.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine shape20h_ax (xi, et, ze, xl, xsj, shp, iflag)
 

Function/Subroutine Documentation

◆ shape20h_ax()

subroutine shape20h_ax ( real*8, intent(in)  xi,
real*8, intent(in)  et,
real*8, intent(in)  ze,
real*8, dimension(3,20), intent(in)  xl,
real*8, intent(out)  xsj,
real*8, dimension(4,20), intent(out)  shp,
integer, intent(in)  iflag 
)
20 !
21 ! shape functions and derivatives for a 20-node quadratic
22 ! isoparametric brick element. -1<=xi,et,ze<=1
23 ! special case: axisymmetric elements
24 !
25 ! iflag=1: calculate only the value of the shape functions
26 ! iflag=2: calculate the value of the shape functions and
27 ! the Jacobian determinant
28 ! iflag=3: calculate the value of the shape functions, the
29 ! value of their derivatives w.r.t. the global
30 ! coordinates and the Jacobian determinant
31 !
32  implicit none
33 !
34  integer j,k,iflag
35 !
36  real*8 shp(4,20),xs(3,3),xsi(3,3),xl(3,20),shpe(4,20),dd,
37  & dd1,dd2,dd3
38 !
39  real*8 xi,et,ze,xsj,omg,omh,omr,opg,oph,opr,
40  & tpgphpr,tmgphpr,tmgmhpr,tpgmhpr,tpgphmr,tmgphmr,tmgmhmr,tpgmhmr,
41  & omgopg,omhoph,omropr,omgmopg,omhmoph,omrmopr
42 !
43  intent(in) xi,et,ze,xl,iflag
44 !
45  intent(out) shp,xsj
46 !
47 ! shape functions and their glocal derivatives
48 !
49  omg=1.d0-xi
50  omh=1.d0-et
51  omr=1.d0-ze
52  opg=1.d0+xi
53  oph=1.d0+et
54  opr=1.d0+ze
55  tpgphpr=opg+oph+ze
56  tmgphpr=omg+oph+ze
57  tmgmhpr=omg+omh+ze
58  tpgmhpr=opg+omh+ze
59  tpgphmr=opg+oph-ze
60  tmgphmr=omg+oph-ze
61  tmgmhmr=omg+omh-ze
62  tpgmhmr=opg+omh-ze
63  omgopg=omg*opg/4.d0
64  omhoph=omh*oph/4.d0
65  omropr=omr*opr/4.d0
66  omgmopg=(omg-opg)/4.d0
67  omhmoph=(omh-oph)/4.d0
68  omrmopr=(omr-opr)/4.d0
69 !
70 ! shape functions
71 !
72  shp(4, 1)=-omg*omh*omr*tpgphpr/8.d0
73  shp(4, 2)=-opg*omh*omr*tmgphpr/8.d0
74  shp(4, 3)=-opg*oph*omr*tmgmhpr/8.d0
75  shp(4, 4)=-omg*oph*omr*tpgmhpr/8.d0
76  shp(4, 5)=-omg*omh*opr*tpgphmr/8.d0
77  shp(4, 6)=-opg*omh*opr*tmgphmr/8.d0
78  shp(4, 7)=-opg*oph*opr*tmgmhmr/8.d0
79  shp(4, 8)=-omg*oph*opr*tpgmhmr/8.d0
80  shp(4, 9)=omgopg*omh*omr
81  shp(4,10)=omhoph*opg*omr
82  shp(4,11)=omgopg*oph*omr
83  shp(4,12)=omhoph*omg*omr
84  shp(4,13)=omgopg*omh*opr
85  shp(4,14)=omhoph*opg*opr
86  shp(4,15)=omgopg*oph*opr
87  shp(4,16)=omhoph*omg*opr
88  shp(4,17)=omropr*omg*omh
89  shp(4,18)=omropr*opg*omh
90  shp(4,19)=omropr*opg*oph
91  shp(4,20)=omropr*omg*oph
92 !
93  if(iflag.eq.1) return
94 !
95 ! local derivatives of the shape functions: xi-derivative
96 !
97  shpe(1, 1)=omh*omr*(tpgphpr-omg)/8.d0
98  shpe(1, 2)=(opg-tmgphpr)*omh*omr/8.d0
99  shpe(1, 3)=(opg-tmgmhpr)*oph*omr/8.d0
100  shpe(1, 4)=oph*omr*(tpgmhpr-omg)/8.d0
101  shpe(1, 5)=omh*opr*(tpgphmr-omg)/8.d0
102  shpe(1, 6)=(opg-tmgphmr)*omh*opr/8.d0
103  shpe(1, 7)=(opg-tmgmhmr)*oph*opr/8.d0
104  shpe(1, 8)=oph*opr*(tpgmhmr-omg)/8.d0
105  shpe(1, 9)=omgmopg*omh*omr
106  shpe(1,10)=omhoph*omr
107  shpe(1,11)=omgmopg*oph*omr
108  shpe(1,12)=-omhoph*omr
109  shpe(1,13)=omgmopg*omh*opr
110  shpe(1,14)=omhoph*opr
111  shpe(1,15)=omgmopg*oph*opr
112  shpe(1,16)=-omhoph*opr
113  shpe(1,17)=-omropr*omh
114  shpe(1,18)=omropr*omh
115  shpe(1,19)=omropr*oph
116  shpe(1,20)=-omropr*oph
117 !
118 ! local derivatives of the shape functions: eta-derivative
119 !
120  shpe(2, 1)=omg*omr*(tpgphpr-omh)/8.d0
121  shpe(2, 2)=opg*omr*(tmgphpr-omh)/8.d0
122  shpe(2, 3)=opg*(oph-tmgmhpr)*omr/8.d0
123  shpe(2, 4)=omg*(oph-tpgmhpr)*omr/8.d0
124  shpe(2, 5)=omg*opr*(tpgphmr-omh)/8.d0
125  shpe(2, 6)=opg*opr*(tmgphmr-omh)/8.d0
126  shpe(2, 7)=opg*(oph-tmgmhmr)*opr/8.d0
127  shpe(2, 8)=omg*(oph-tpgmhmr)*opr/8.d0
128  shpe(2, 9)=-omgopg*omr
129  shpe(2,10)=omhmoph*opg*omr
130  shpe(2,11)=omgopg*omr
131  shpe(2,12)=omhmoph*omg*omr
132  shpe(2,13)=-omgopg*opr
133  shpe(2,14)=omhmoph*opg*opr
134  shpe(2,15)=omgopg*opr
135  shpe(2,16)=omhmoph*omg*opr
136  shpe(2,17)=-omropr*omg
137  shpe(2,18)=-omropr*opg
138  shpe(2,19)=omropr*opg
139  shpe(2,20)=omropr*omg
140 !
141 ! local derivatives of the shape functions: zeta-derivative
142 !
143  shpe(3, 1)=omg*omh*(tpgphpr-omr)/8.d0
144  shpe(3, 2)=opg*omh*(tmgphpr-omr)/8.d0
145  shpe(3, 3)=opg*oph*(tmgmhpr-omr)/8.d0
146  shpe(3, 4)=omg*oph*(tpgmhpr-omr)/8.d0
147  shpe(3, 5)=omg*omh*(opr-tpgphmr)/8.d0
148  shpe(3, 6)=opg*omh*(opr-tmgphmr)/8.d0
149  shpe(3, 7)=opg*oph*(opr-tmgmhmr)/8.d0
150  shpe(3, 8)=omg*oph*(opr-tpgmhmr)/8.d0
151  shpe(3, 9)=-omgopg*omh
152  shpe(3,10)=-omhoph*opg
153  shpe(3,11)=-omgopg*oph
154  shpe(3,12)=-omhoph*omg
155  shpe(3,13)=omgopg*omh
156  shpe(3,14)=omhoph*opg
157  shpe(3,15)=omgopg*oph
158  shpe(3,16)=omhoph*omg
159  shpe(3,17)=omrmopr*omg*omh
160  shpe(3,18)=omrmopr*opg*omh
161  shpe(3,19)=omrmopr*opg*oph
162  shpe(3,20)=omrmopr*omg*oph
163 !
164 ! computation of the local derivative of the global coordinates
165 ! (xs)
166 !
167 c do i=1,3
168 c do j=1,3
169 c xs(i,j)=0.d0
170 c do k=1,20
171 c xs(i,j)=xs(i,j)+xl(i,k)*shpe(j,k)
172 c enddo
173 c enddo
174 c enddo
175  do j=1,3
176  xs(1,j)=xl(1,1)*(shpe(j,1)+shpe(j,5))
177  & +xl(1,2)*(shpe(j,2)+shpe(j,6))
178  & +xl(1,3)*(shpe(j,3)+shpe(j,7))
179  & +xl(1,4)*(shpe(j,4)+shpe(j,8))
180  & +xl(1,9)*(shpe(j,9)+shpe(j,13))
181  & +xl(1,10)*(shpe(j,10)+shpe(j,14))
182  & +xl(1,11)*(shpe(j,11)+shpe(j,15))
183  & +xl(1,12)*(shpe(j,12)+shpe(j,16))
184  & +xl(1,17)*shpe(j,17)+xl(1,18)*shpe(j,18)
185  & +xl(1,19)*shpe(j,19)+xl(1,20)*shpe(j,20)
186  xs(2,j)=xl(2,1)*(shpe(j,1)+shpe(j,5)+shpe(j,17))
187  & +xl(2,2)*(shpe(j,2)+shpe(j,6)+shpe(j,18))
188  & +xl(2,3)*(shpe(j,3)+shpe(j,7)+shpe(j,19))
189  & +xl(2,4)*(shpe(j,4)+shpe(j,8)+shpe(j,20))
190  & +xl(2,9)*(shpe(j,9)+shpe(j,13))
191  & +xl(2,10)*(shpe(j,10)+shpe(j,14))
192  & +xl(2,11)*(shpe(j,11)+shpe(j,15))
193  & +xl(2,12)*(shpe(j,12)+shpe(j,16))
194  xs(3,j)=xl(3,1)*(shpe(j,1)-shpe(j,5))
195  & +xl(3,2)*(shpe(j,2)-shpe(j,6))
196  & +xl(3,3)*(shpe(j,3)-shpe(j,7))
197  & +xl(3,4)*(shpe(j,4)-shpe(j,8))
198  & +xl(3,9)*(shpe(j,9)-shpe(j,13))
199  & +xl(3,10)*(shpe(j,10)-shpe(j,14))
200  & +xl(3,11)*(shpe(j,11)-shpe(j,15))
201  & +xl(3,12)*(shpe(j,12)-shpe(j,16))
202  enddo
203 !
204 ! computation of the jacobian determinant
205 !
206  dd1=xs(2,2)*xs(3,3)-xs(2,3)*xs(3,2)
207  dd2=xs(2,3)*xs(3,1)-xs(2,1)*xs(3,3)
208  dd3=xs(2,1)*xs(3,2)-xs(2,2)*xs(3,1)
209  xsj=xs(1,1)*dd1+xs(1,2)*dd2+xs(1,3)*dd3
210 c xsj=xs(1,1)*(xs(2,2)*xs(3,3)-xs(2,3)*xs(3,2))
211 c & -xs(1,2)*(xs(2,1)*xs(3,3)-xs(2,3)*xs(3,1))
212 c & +xs(1,3)*(xs(2,1)*xs(3,2)-xs(2,2)*xs(3,1))
213 !
214  if(iflag.eq.2) return
215 !
216  dd=1.d0/xsj
217 !
218 ! computation of the global derivative of the local coordinates
219 ! (xsi) (inversion of xs)
220 !
221  xsi(1,1)=dd1*dd
222  xsi(1,2)=(xs(1,3)*xs(3,2)-xs(1,2)*xs(3,3))*dd
223  xsi(1,3)=(xs(1,2)*xs(2,3)-xs(2,2)*xs(1,3))*dd
224  xsi(2,1)=dd2*dd
225  xsi(2,2)=(xs(1,1)*xs(3,3)-xs(3,1)*xs(1,3))*dd
226  xsi(2,3)=(xs(1,3)*xs(2,1)-xs(1,1)*xs(2,3))*dd
227  xsi(3,1)=dd3*dd
228  xsi(3,2)=(xs(1,2)*xs(3,1)-xs(1,1)*xs(3,2))*dd
229  xsi(3,3)=(xs(1,1)*xs(2,2)-xs(2,1)*xs(1,2))*dd
230 c xsi(1,1)=(xs(2,2)*xs(3,3)-xs(3,2)*xs(2,3))*dd
231 c xsi(1,2)=(xs(1,3)*xs(3,2)-xs(1,2)*xs(3,3))*dd
232 c xsi(1,3)=(xs(1,2)*xs(2,3)-xs(2,2)*xs(1,3))*dd
233 c xsi(2,1)=(xs(2,3)*xs(3,1)-xs(2,1)*xs(3,3))*dd
234 c xsi(2,2)=(xs(1,1)*xs(3,3)-xs(3,1)*xs(1,3))*dd
235 c xsi(2,3)=(xs(1,3)*xs(2,1)-xs(1,1)*xs(2,3))*dd
236 c xsi(3,1)=(xs(2,1)*xs(3,2)-xs(3,1)*xs(2,2))*dd
237 c xsi(3,2)=(xs(1,2)*xs(3,1)-xs(1,1)*xs(3,2))*dd
238 c xsi(3,3)=(xs(1,1)*xs(2,2)-xs(2,1)*xs(1,2))*dd
239 !
240 ! computation of the global derivatives of the shape functions
241 !
242  do k=1,20
243  do j=1,3
244  shp(j,k)=shpe(1,k)*xsi(1,j)+shpe(2,k)*xsi(2,j)
245  & +shpe(3,k)*xsi(3,j)
246  enddo
247  enddo
248 !
249  return
Hosted by OpenAircraft.com, (Michigan UAV, LLC)