Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cal_shdx.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 cal_shdx(shdx,meshpos,ndim,nnode,nintk,surf_elem, &
54  iface)
55 
56 !!****f* Rocfrac/Rocfrac/Source/cal_shdx.f90
57 !!
58 !! NAME
59 !! cal_shdx
60 !!
61 !! FUNCTION
62 !! computes shape fn. values and parametric derivatives at Gauss pts.
63 !!
64 !! INPUTS
65 !! meshpos -- mesh coordinates
66 !! ndim -- dimension of problem
67 !! nnode -- number of nodes
68 !! nintk -- number of integration points
69 !! surf_eleme -- connectivity of surf_elem
70 !! iface -- face number of tetrahedral
71 !!
72 !! OUTPUT
73 !! shdx -- shape fn. derivatives
74 !!
75 !!****
76 
77  IMPLICIT NONE
78 
79 
80  INTEGER ndim, nnode, nintk
81  DOUBLE PRECISION shdx(ndim,nnode,nintk), &
82  meshpos(ndim,nnode)
83  DOUBLE PRECISION xi, eta
84  DOUBLE PRECISION eighth,one,zero
85  INTEGER igauss, knode, i,j, iface, surf_elem(3,4)
86 
87  DOUBLE PRECISION shape(3), dshape(2,3), jacobian(2,3)
88  INTEGER n1,n2,n3
89 
90 
91  one = 1.d0
92  eighth = 1.d0/8.d0
93  zero = 0.d0
94 
95 ! fill in shape fn. values and parametric derivatives at Gauss pts.
96 
97  igauss = 1
98  xi = 1.d0/3.d0
99  eta = 1.d0/3.d0
100 
101  shape(1) = xi
102  shape(2) = eta
103  shape(3) = one - xi -eta
104 
105  dshape(1,1) = one
106  dshape(2,1) = zero
107  dshape(1,2) = zero
108  dshape(2,2) = one
109  dshape(1,3) = -one
110  dshape(2,3) = -one
111 
112  n1 = surf_elem(1,iface)
113  n2 = surf_elem(2,iface)
114  n3 = surf_elem(3,iface)
115 
116 
117  jacobian(1,1) = 1.d0/(meshpos(1,n1)-meshpos(1,n3))
118  jacobian(1,2) = 1.d0/(meshpos(2,n1)-meshpos(2,n3))
119  jacobian(1,3) = 1.d0/(meshpos(3,n1)-meshpos(3,n3))
120  jacobian(2,1) = 1.d0/(meshpos(1,n2)-meshpos(1,n3))
121  jacobian(2,2) = 1.d0/(meshpos(2,n2)-meshpos(2,n3))
122  jacobian(2,3) = 1.d0/(meshpos(3,n2)-meshpos(3,n3))
123 
124 ! do i=1,2
125 ! write(*,'(i5,3e15.7)') i,(jacobian(i,j),j=1,3)
126 ! end do
127 ! evaluate shape fn. derivatives
128  DO knode = 1, nnode
129  DO i = 1,ndim
130  shdx(i,knode,igauss) = zero
131  END DO
132  END DO
133 
134  DO knode = 1,3
135  DO i = 1,ndim
136  shdx(i,surf_elem(knode,iface),igauss) = zero
137  DO j = 1,2
138  shdx(i,surf_elem(knode,iface),igauss) = &
139  shdx(i,surf_elem(knode,iface),igauss) + &
140  dshape(j,knode)*jacobian(j,i)
141  END DO
142  END DO
143  END DO
144 
145  RETURN
146 END SUBROUTINE cal_shdx
147 
void zero()
Sets all entries to zero (more efficient than assignement).
subroutine cal_shdx(shdx, meshpos, ndim, nnode, nintk, surf_elem, iface)
Definition: cal_shdx.f90:53
void jacobian(const GeoPrim::CPoint p[], const GeoPrim::CVector &, GeoPrim::CVector J[]) const
Definition: Mesh.C:704
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6