Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
shcalc.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 SUBROUTINE shcalc(shfn, shdx, dv, dvsum, shdx_av, meshpos, &
54  ndim,nnode,nintk,xi,eta,zeta,shdxi,wsp2)
55 
56 !!****f* Rocfrac/Rocfrac/Source/shcalc.f90
57 !!
58 !! NAME
59 !! shcalc
60 !!
61 !! FUNCTION
62 !! EVALUALTE SHAPE FUNCTION AND ITS DERIVATIVES FOR 4-NODE TET.
63 !!
64 !!****
65 
66  IMPLICIT NONE
67 
68  INTEGER ndim, nnode, nintk
69 
70  DOUBLE PRECISION shfn(nnode,nintk), shdx(ndim,nnode,nintk), &
71  dv(nintk), dvsum, shdx_av(ndim,nnode), &
72  meshpos(ndim,nnode),xi(nintk),eta(nintk), &
73  zeta(nintk),shdxi(ndim,nnode,nintk)
74 
75  DOUBLE PRECISION wsp1(3,3),wsp2(3,3),eighth,one,zero
76 
77  INTEGER igauss, knode, i,j
78 
79 
80  one = 1.d0
81  eighth = 1.d0/8.d0
82  zero = 0.d0
83 
84 ! fill in shape fn. values and parametric derivatives at Gauss pts.
85 
86  igauss = 1
87 
88  shfn(1,igauss) = zeta(igauss)
89  shfn(2,igauss) = xi(igauss)
90  shfn(3,igauss) = one-xi(igauss)-eta(igauss)-zeta(igauss)
91  shfn(4,igauss) = eta(igauss)
92 
93  shdxi(1,1,igauss) = zero
94  shdxi(2,1,igauss) = zero
95  shdxi(3,1,igauss) = one
96 
97  shdxi(1,2,igauss) = one
98  shdxi(2,2,igauss) = zero
99  shdxi(3,2,igauss) = zero
100 
101  shdxi(1,3,igauss) =-one
102  shdxi(2,3,igauss) =-one
103  shdxi(3,3,igauss) =-one
104 
105  shdxi(1,4,igauss) = zero
106  shdxi(2,4,igauss) = one
107  shdxi(3,4,igauss) = zero
108 
109 
110 ! evaluate and store common quantities for all Gauss pts.
111 ! and shape fn. derivatives w.r.t. spatial coordinates.
112 
113  DO i = 1,ndim
114  DO j = 1,ndim
115  wsp1(i,j) = zero
116  DO knode = 1,nnode
117  wsp1(i,j) = wsp1(i,j) + meshpos(i,knode)* &
118  shdxi(j,knode,igauss)
119  END DO
120  END DO
121  END DO
122 
123  CALL ainv(wsp1,wsp2,dv(igauss),ndim)
124 
125 ! evaluate shape fn. derivatives
126 
127  DO knode = 1,nnode
128  DO i = 1,ndim
129  shdx(i,knode,igauss) = zero
130  DO j = 1,ndim
131  shdx(i,knode,igauss) = shdx(i,knode,igauss) + &
132  shdxi(j,knode,igauss)*wsp2(j,i)
133  END DO
134  END DO
135  END DO
136 
137  RETURN
138 END SUBROUTINE shcalc
139 
void zero()
Sets all entries to zero (more efficient than assignement).
subroutine ainv(ajac, ajacin, det, ndim)
Definition: ainv.f90:53
blockLoc i
Definition: read.cpp:79
subroutine shcalc(shfn, shdx, dv, dvsum, shdx_av, meshpos, ndim, nnode, nintk, xi, eta, zeta, shdxi, wsp2)
Definition: shcalc.f90:53
j indices j
Definition: Indexing.h:6