Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TractPressLoadDef.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 tractpressloaddef(R_ex,numnp, &
54  interfacenumelems, interfacenumnodes, &
55  interfaceelemconn, &
56  mapnode,lwrbnd,uppbnd, coor, disp, mapsfelvolel,&
57  elconnvol,ieltype,numelvol,tractpress)
58 
59  IMPLICIT NONE
60 
61 ! 1-3 for 4 node tet (i.e. 3 node triangles)
62 ! 4-6 for 10 node tet (i.e. 6 node triangles, mid-side nodes get traction)
63 
64 ! Computes the traction due to a dummy implied traction
65 
66 ! Applied to the deformed Configuration
67 
68  INTEGER :: lwrbnd,uppbnd
69 
70  INTEGER :: ieltype,numelvol
71  INTEGER, DIMENSION(1:iElType,1:NumElVol) :: elconnvol
72 
73  INTEGER :: interfacenumelems,interfacenumnodes
74  INTEGER, DIMENSION(1:UppBnd,1:InterfaceNumElems) :: interfaceelemconn
75  INTEGER, DIMENSION(1:InterfaceNumNodes) :: mapnodesf
76 
77  INTEGER :: numnp ! number of nodes
78 
79  REAL*8, DIMENSION(1:3*NumNp) :: disp
80 
81  INTEGER, DIMENSION(1:InterfaceNumNodes) :: mapnode
82 
83  REAL*8, DIMENSION(1:3*numnp) :: r_ex ! external force
84 
85  INTEGER :: nx, ny, nz
86  INTEGER :: i,j,k
87 
88  INTEGER,DIMENSION(1:3) :: triconn
89  REAL*8,DIMENSION(1:3) :: uniftract,normvect
90  REAL*8 :: tractpress
91  INTEGER, DIMENSION(1:NumElVol) :: mapsfelvolel
92 
93 ! mesh coordinates
94  REAL*8, DIMENSION(1:3,1:numnp) :: coor
95 
96  REAL*8 :: x0p,y0p,z0p
97  REAL*8 :: x1p,y1p,z1p
98  REAL*8 :: x2p,y2p,z2p
99  REAL*8 :: x3p,y3p,z3p
100 
101 ! Components sides vector
102 
103  REAL*8 :: x1x0, y1y0, z1z0
104  REAL*8 :: x2x0, y2y0, z2z0
105 
106  REAL*8 :: xnorm, area
107 
108  DO i = 1, interfacenumelems
109 
110 ! Nodes of the Triangle ( Vertex Nodes )
111 
112  triconn(1:3) = interfaceelemconn(1:3,i)
113 
114 ! Uses the fact that the norm of the cross product vector
115 ! is the area of the parallelogram they form. The triangle they
116 ! form has half that area.
117 
118  x0p = coor(1,mapnode(triconn(1))) + disp(3*mapnode(triconn(1))-2)
119  y0p = coor(2,mapnode(triconn(1))) + disp(3*mapnode(triconn(1))-1)
120  z0p = coor(3,mapnode(triconn(1))) + disp(3*mapnode(triconn(1)))
121 
122  x1p = coor(1,mapnode(triconn(2))) + disp(3*mapnode(triconn(2))-2)
123  y1p = coor(2,mapnode(triconn(2))) + disp(3*mapnode(triconn(2))-1)
124  z1p = coor(3,mapnode(triconn(2))) + disp(3*mapnode(triconn(2)))
125 
126  x2p = coor(1,mapnode(triconn(3))) + disp(3*mapnode(triconn(3))-2)
127  y2p = coor(2,mapnode(triconn(3))) + disp(3*mapnode(triconn(3))-1)
128  z2p = coor(3,mapnode(triconn(3))) + disp(3*mapnode(triconn(3)))
129 
130 ! Find vector componets of the sides
131 
132  x1x0 = x1p - x0p
133  y1y0 = y1p - y0p
134  z1z0 = z1p - z0p
135 
136  x2x0 = x2p - x0p
137  y2y0 = y2p - y0p
138  z2z0 = z2p - z0p
139 
140 ! Take the cross product
141 
142  x3p = y1y0 * z2z0 - z1z0 * y2y0
143  y3p = z1z0 * x2x0 - x1x0 * z2z0
144  z3p = x1x0 * y2y0 - y1y0 * x2x0
145 
146 ! Computes the Euclidean norm of a vector in 3D
147 
148  xnorm = sqrt( x3p*x3p + y3p*y3p + z3p*z3p )
149 !
150 ! Area of the triangle is half the area of the parallelogram
151 ! determined by the cross product of the vectors P12 and P13
152 
153  area = 0.5d0*xnorm
154 
155 ! Unit normal
156 ! _ _
157 ! _ Vec1 x Vec2
158 ! n = ------------------
159 ! || Vec1 x Vec2 ||
160 !
161  normvect(1) = x3p/xnorm
162  normvect(2) = y3p/xnorm
163  normvect(3) = z3p/xnorm
164 
165 ! Assign the load weighted equally among the 3 nodes
166 
167  uniftract(1:3) = - normvect(1:3)*tractpress*area/3.d0
168 
169 ! Assembly into global external load vector R_ex
170 
171  triconn(1:3) = interfaceelemconn(lwrbnd:uppbnd,i)
172 
173  DO j = 1, 3
174  nz = mapnode(triconn(j))*3 ! volume node
175  nx = nz - 2
176  ny = nz - 1
177  r_ex(nx) = r_ex(nx) + uniftract(1)
178  r_ex(ny) = r_ex(ny) + uniftract(2)
179  r_ex(nz) = r_ex(nz) + uniftract(3)
180  ENDDO
181  ENDDO
182 
183  RETURN
184 END SUBROUTINE tractpressloaddef
185 
j indices k indices k
Definition: Indexing.h:6
double sqrt(double d)
Definition: double.h:73
blockLoc i
Definition: read.cpp:79
subroutine tractpressloaddef(R_ex, numnp, InterfaceNumElems, InterfaceNumNodes, InterfaceElemConn, MapNode, LwrBnd, UppBnd, coor, Disp, MapSFElVolEl, ElConnVol, iElType, NumElVol, TractPress)
j indices j
Definition: Indexing.h:6