Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
shcalc_3d10.f90
Go to the documentation of this file.
1 !*********************************************************************
2 !* Illinois Open Source License *
3 !* *
4 !* University of Illinois/NCSA *
5 !* Open Source License *
6 !* *
7 !* Copyright@2008, University of Illinois. All rights reserved. *
8 !* *
9 !* Developed by: *
10 !* *
11 !* Center for Simulation of Advanced Rockets *
12 !* *
13 !* University of Illinois *
14 !* *
15 !* www.csar.uiuc.edu *
16 !* *
17 !* Permission is hereby granted, free of charge, to any person *
18 !* obtaining a copy of this software and associated documentation *
19 !* files (the "Software"), to deal with the Software without *
20 !* restriction, including without limitation the rights to use, *
21 !* copy, modify, merge, publish, distribute, sublicense, and/or *
22 !* sell copies of the Software, and to permit persons to whom the *
23 !* Software is furnished to do so, subject to the following *
24 !* conditions: *
25 !* *
26 !* *
27 !* @ Redistributions of source code must retain the above copyright *
28 !* notice, this list of conditions and the following disclaimers. *
29 !* *
30 !* @ Redistributions in binary form must reproduce the above *
31 !* copyright notice, this list of conditions and the following *
32 !* disclaimers in the documentation and/or other materials *
33 !* provided with the distribution. *
34 !* *
35 !* @ Neither the names of the Center for Simulation of Advanced *
36 !* Rockets, the University of Illinois, nor the names of its *
37 !* contributors may be used to endorse or promote products derived *
38 !* from this Software without specific prior written permission. *
39 !* *
40 !* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
41 !* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
42 !* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
43 !* NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
44 !* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
45 !* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
46 !* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
47 !* USE OR OTHER DEALINGS WITH THE SOFTWARE. *
48 !*********************************************************************
49 !* Please acknowledge The University of Illinois Center for *
50 !* Simulation of Advanced Rockets in works and publications *
51 !* resulting from this software or its derivatives. *
52 !*********************************************************************
53 !!****f* Rocfrac/Rocfrac/Source/shcalc_3d10.f90
54 !!
55 !! NAME
56 !! shcalc_3d10
57 !!
58 !! FUNCTION
59 !! EVALUALTE SHAPE FUNCTION AND ITS DERIVATIVES FOR 10-NODE TET.
60 !!
61 !! AUTHOR
62 !! written by Changyu Hwang Nov. 20, 2001
63 !!****
64 
65 SUBROUTINE shcalc_3d10(shfn, shdx, dv, dvsum, shdx_av, meshpos, &
66  ndim,nnode,nintk,xi,eta,zeta,shdxi,wsp2)
67 
68  IMPLICIT NONE
69 
70  INTEGER ndim, nnode, nintk
71 
72  REAL*8 :: shfn(nnode,nintk), shdx(ndim,nnode,nintk), &
73  dv(nintk), dvsum, shdx_av(ndim,nnode), &
74  meshpos(ndim,nnode),xi(nintk),eta(nintk), &
75  zeta(nintk),shdxi(ndim,nnode,nintk)
76 
77  REAL*8 :: wsp1(3,3),wsp2(3,3),eighth,one,zero,four, two
78 
79  REAL*8 :: sh(10), d_sh(3,10) , r, s, t, u, wi
80  INTEGER igauss, knode, i,j
81 
82 
83  one = 1.d0
84  two = 2.d0
85  four = 4.d0
86  eighth = 1.d0/8.d0
87  zero = 0.d0
88  dvsum = 0.d0
89  wi = 1.d0/4.d0
90 
91 ! fill in shape fn. values and parametric derivatives at Gauss pts.
92 
93  DO igauss = 1, nintk
94 
95  r = xi(igauss)
96  s = eta(igauss)
97  t = zeta(igauss)
98  u = 1.d0 - r - s - t
99 
100  sh(1) = u * ( two * u - one )
101  sh(2) = r * ( two * r - one )
102  sh(3) = s * ( two * s - one )
103  sh(4) = t * ( two * t - one )
104 
105  sh(5 )= four * u * r
106  sh(6 )= four * r * s
107  sh(7 )= four * s * u
108  sh(8 )= four * u * t
109  sh(9 )= four * r * t
110  sh(10)= four * s * t
111 
112  d_sh(1,1) = -four * u + one
113  d_sh(2,1) = -four * u + one
114  d_sh(3,1) = -four * u + one
115 
116  d_sh(1,2) = four * r - one
117  d_sh(2,2) = zero
118  d_sh(3,2) = zero
119 
120  d_sh(1,3) = zero
121  d_sh(2,3) = four * s - one
122  d_sh(3,3) = zero
123 
124  d_sh(1,4) = zero
125  d_sh(2,4) = zero
126  d_sh(3,4) = four * t - one
127 
128  d_sh(1,5) = - four * r + four * (one-r-s-t)
129  d_sh(2,5) = - four * r
130  d_sh(3,5) = - four * r
131 
132  d_sh(1,6) = four * s
133  d_sh(2,6) = four * r
134  d_sh(3,6) = zero
135 
136  d_sh(1,7) = - four * s
137  d_sh(2,7) = - four * s + four * (one-r-s-t)
138  d_sh(3,7) = - four * s
139 
140  d_sh(1,8)= - four * t
141  d_sh(2,8)= - four * t
142  d_sh(3,8)= - four * t + four * (one-r-s-t)
143 
144  d_sh(1,9) = four * t
145  d_sh(2,9) = zero
146  d_sh(3,9) = four * r
147 
148  d_sh(1,10) = zero
149  d_sh(2,10) = four * t
150  d_sh(3,10) = four * s
151 
152  DO j=1,nnode
153  shfn(j,igauss) = sh(j)
154  END DO
155 
156  DO i=1,ndim
157  DO j=1,nnode
158  shdxi(i,j,igauss) = d_sh(i,j)
159  END DO
160  END DO
161 
162 ! evaluate and store common quantities for all Gauss pts.
163 ! and shape fn. derivatives w.r.t. spatial coordinates.
164 
165  DO i = 1,ndim
166  DO j = 1,ndim
167  wsp1(i,j) = zero
168  DO knode = 1,nnode
169  wsp1(i,j) = wsp1(i,j) + meshpos(i,knode)* &
170  shdxi(j,knode,igauss)
171  END DO
172  END DO
173  END DO
174 
175  CALL ainv(wsp1,wsp2,dv(igauss),ndim)
176 
177  dvsum = dvsum + dv(igauss) * wi
178 
179 ! evaluate shape fn. derivatives
180 
181  DO knode = 1,nnode
182  DO i = 1,ndim
183  shdx(i,knode,igauss) = zero
184  DO j = 1,ndim
185  shdx(i,knode,igauss) = shdx(i,knode,igauss) + &
186  shdxi(j,knode,igauss)*wsp2(j,i)
187  END DO
188  END DO
189  END DO
190 
191 
192  ENDDO
193 
194  RETURN
195 END SUBROUTINE shcalc_3d10
196 
unsigned char r() const
Definition: Color.h:68
void zero()
Sets all entries to zero (more efficient than assignement).
double s
Definition: blastest.C:80
subroutine ainv(ajac, ajacin, det, ndim)
Definition: ainv.f90:53
subroutine shcalc_3d10(shfn, shdx, dv, dvsum, shdx_av, meshpos, ndim, nnode, nintk, xi, eta, zeta, shdxi, wsp2)
Definition: shcalc_3d10.f90:65
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6