Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TractLoadPress_Hex.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 tractloadpress_hex(R_ex,numnp, &
54  interfacenumelems, interfacenumnodes, &
55  interfaceelemconn, &
56  mapnode,lwrbnd,uppbnd,coor,interfaceelemtract)
57 
58  IMPLICIT NONE
59 
60  INTEGER :: lwrbnd,uppbnd
61 
62  INTEGER :: interfacenumelems,interfacenumnodes
63  INTEGER, DIMENSION(1:UppBnd,1:InterfaceNumElems) :: interfaceelemconn
64  INTEGER, DIMENSION(1:InterfaceNumNodes) :: mapnode
65  REAL*8 :: interfaceelemtract
66 
67  INTEGER :: numnp ! number of nodes
68 
69  REAL*8, DIMENSION(1:3*numnp) :: r_ex ! external force
70 
71  INTEGER :: nx, ny, nz
72  INTEGER :: i,j,k
73 
74  INTEGER,DIMENSION(1:4) :: conn2d
75  integer :: icnt
76  integer,DIMENSION(1:12) :: dlvec
77  real*8 :: pmag
78 
79 ! mesh coordinates
80  REAL*8, DIMENSION(1:3,1:numnp) :: coor
81 
82  REAL*8, DIMENSION(1:3) :: veca, vecb, outwd_surface_normal, &
83  half_normal_veca, half_normal_vecb
84 
85  DO i = 1, interfacenumelems
86 
87 ! Nodes of the Quad ( Vertex Nodes )
88 
89  conn2d(1:4) = interfaceelemconn(1:4,i)
90 
91 ! Uses the fact that the norm of the cross product vector
92 ! is the area of the parallelogram they form. The triangle they
93 ! form has half that area.
94 
95  veca(1:3) = coor(1:3,mapnode(conn2d(2)))- coor(1:3,mapnode(conn2d(1)))
96  vecb(1:3) = coor(1:3,mapnode(conn2d(4)))- coor(1:3,mapnode(conn2d(1)))
97 
98  half_normal_veca(1) = veca(2)*vecb(3) - vecb(2)*veca(3)
99  half_normal_veca(2) = veca(3)*vecb(1) - vecb(3)*veca(1)
100  half_normal_veca(3) = veca(1)*vecb(2) - vecb(1)*veca(2)
101 
102  veca(1:3) = coor(1:3,mapnode(conn2d(4))) - coor(1:3,mapnode(conn2d(3)))
103  vecb(1:3) = coor(1:3,mapnode(conn2d(2))) - coor(1:3,mapnode(conn2d(3)))
104 
105  half_normal_vecb(1) = veca(2)*vecb(3) - vecb(2)*veca(3)
106  half_normal_vecb(2) = veca(3)*vecb(1) - vecb(3)*veca(1)
107  half_normal_vecb(3) = veca(1)*vecb(2) - vecb(1)*veca(2)
108 
109  outwd_surface_normal = half_normal_veca + half_normal_vecb
110 
111  pmag = -interfaceelemtract*0.125d0 ! Area in here ?? Fix
112 
113  dlvec(1:3) = pmag * outwd_surface_normal(1:3)
114  dlvec(4:6) = pmag * outwd_surface_normal(1:3)
115  dlvec(7:9) = pmag * outwd_surface_normal(1:3)
116  dlvec(10:12) = pmag * outwd_surface_normal(1:3)
117 
118 ! Assembly into global external load vector R_ex
119 
120  conn2d(1:4) = interfaceelemconn(lwrbnd:uppbnd,i)
121 
122  DO j = 1, 4
123  nz = mapnode(conn2d(j))*3 ! volume node
124  nx = nz - 2
125  ny = nz - 1
126  r_ex(nx) = r_ex(nx) + pmag * outwd_surface_normal(1)
127  r_ex(ny) = r_ex(ny) + pmag * outwd_surface_normal(2)
128  r_ex(nz) = r_ex(nz) + pmag * outwd_surface_normal(3)
129  ENDDO
130  ENDDO
131 
132  RETURN
133 END SUBROUTINE tractloadpress_hex
134 
j indices k indices k
Definition: Indexing.h:6
subroutine tractloadpress_hex(R_ex, numnp, InterfaceNumElems, InterfaceNumNodes, InterfaceElemConn, MapNode, LwrBnd, UppBnd, coor, InterfaceElemTract)
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6