Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
v3d10_r_bar.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 !-----------------------------------------------------------------
54 ! CODE FOR 3-D ALE, ELASTODYNAMIC, SECOND-ORDER SOLID ELEMENT
55 !
56 ! written by Changyu Hwang Nov. 20, 2001
57 !
58 !-----------------------------------------------------------------
59 SUBROUTINE v3d10_r_bar(d_bar,R_bar, &
60  numnp,numlstet,lmlstet,meshcoor,nstart,nend)
61 
62  IMPLICIT NONE
63 
64 !--- for 10-node tetrahedron element !
65 
66  INTEGER numnp ! number of nodes
67  REAL*8 d_bar(3*numnp) ! nodal mesh displacements
68  REAL*8 r_bar(3*numnp) ! internal force
69  REAL*8 meshcoor(3,numnp)
70  INTEGER numlstet ! number of LSTs
71  INTEGER lmlstet(10,numlstet) ! TET conectivity table
72  INTEGER ielem , nx, ny, nz
73 
74 
75  INTEGER ndof, nnode, ndim, nmat, nsurf, nload
76 
77 !-- for 10-node tetrahedron element !
78  REAL*8 meshpos(3,10), meshvel(3,10), meshacc(3,10), &
79  sload(4,1,3), bforce(3), elmass(30,30), elstiff(30,30), &
80  eldamp(30,30), elload(30), elstiff2(30,30)
81 
82 
83  INTEGER ndim_v, ndim_s, nintk_v, nintk_s,knode, &
84  knodr, knodc,i,j,rindx,cindx,k,mm,ll, &
85  fp(2,6),iface,igauss, grindx,grindy,grindz
86 
87 !--- new variables for tetrahedron
88  parameter(ndim_v = 3, ndim_s = 2, nintk_v = 4,nintk_s = 3) ! 10-noded tetrahedron
89 
90 
91 !--- new implementation for 10-node tetrahedron
92 
93  DOUBLE PRECISION shfn(10,10), shdx(3,10,10), dv(10), dvsum, &
94  delta(3,3), mvgss(3), magss(3), mcgss(3,3), two, &
95  wsp1,wsparr(3),trmcgss,wsp2,wsp3,wsp4,one,lambda, &
96  mu,third,wsp5,vxi(10),veta(10),vzeta(10),wt_lstet, &
97  sxi(4,6),seta(4,6),szeta(4,6),shdxi(3,10,10), &
98  wsparr1(3),shdx_av(3,10),zero, half
99 
100  DOUBLE PRECISION disp(30), velo(30), rimsi(30), dimsi(30)
101  DOUBLE PRECISION multiplier , ajacin(3,3), surfnormal(3,4)
102  DOUBLE PRECISION factor
103 
104  INTEGER :: nstart, nend
105 
106  parameter(zero = 0.d0, one = 1.d0, two = 2.d0)
107  DATA delta/1.d0,0.d0,0.d0,0.d0,1.d0,0.d0,0.d0,0.d0,1.d0/
108 
109 !-- input variables
110  ndim = 3
111  nnode = 10
112  ndof = ndim * nnode
113  nsurf = 4
114 
115 ! because the volume of the parent tetrahedron equals 1/6, the proper form
116 ! for a quadrature rule in this case is
117 ! Integral ( f ) dV = multiplier * Summation (fi * Ji * Wi)
118 ! where Ji:determinant of jacobian Wi:weight at each integration point i
119 
120  multiplier = 1.d0/6.d0
121  wt_lstet = 1.d0/4.d0
122 
123 !
124 !-- Gauss integration points for tetrahedron
125 !
126 ! reference: Finite element procedures in engineering analysis
127 ! by K. Bathe, Figure 5.27 pp 232
128 ! gauss point 1 alpha beta beta beta 1/4
129 ! gauss point 2 beta alpha beta beta 1/4
130 ! gauss point 3 beta beta alpha beta 1/4
131 ! gauss point 4 beta beta beta alpha 1/4
132 ! alpha = 0.58541020d0
133 ! beta = 0.13819660d0
134 
135 !--- gauss point 1
136  vxi( 1) = 0.13819660d0
137  veta( 1) = 0.13819660d0
138  vzeta(1) = 0.13819660d0
139 
140 !--- gauss point 2
141  vxi( 2) = 0.58541020d0
142  veta( 2) = 0.13819660d0
143  vzeta(2) = 0.13819660d0
144 
145 !--- gauss point 3
146  vxi( 3) = 0.13819660d0
147  veta( 3) = 0.58541020d0
148  vzeta(3) = 0.13819660d0
149 
150 !--- gauss point 4
151  vxi( 4) = 0.13819660d0
152  veta( 4) = 0.13819660d0
153  vzeta(4) = 0.58541020d0
154 
155 !-- loop for elements
156 
157  DO ielem = nstart, nend
158 
159  DO i=1, nnode
160  DO j=1, nnode
161  elstiff(i,j) = 0.d0
162  ENDDO
163  ENDDO
164 
165  DO i=1, nnode
166  nx = lmlstet(i,ielem)*3-2
167  ny = lmlstet(i,ielem)*3-1
168  nz = lmlstet(i,ielem)*3
169  meshpos(1,i)=meshcoor(1,lmlstet(i,ielem))
170  meshpos(2,i)=meshcoor(2,lmlstet(i,ielem))
171  meshpos(3,i)=meshcoor(3,lmlstet(i,ielem))
172  disp(i*3-2) =d_bar(nx)
173  disp(i*3-1) =d_bar(ny)
174  disp(i*3 ) =d_bar(nz)
175  END DO
176 
177 !-- calculate shape function and its derivatives
178  CALL shcalc_3d10(shfn, shdx, dv, dvsum, shdx_av, meshpos, &
179  ndim,nnode,nintk_v,vxi,veta,vzeta,shdxi,ajacin)
180 
181 ! fill in element matrices for contributions from
182 ! volume integration points.
183 
184  factor=multiplier*wt_lstet
185  DO igauss = 1, nintk_v
186  DO knodr = 1,nnode
187  DO knodc = 1,nnode
188  elstiff(knodr,knodc) = elstiff(knodr,knodc) + &
189  ( shdx(1,knodr,igauss)*shdx(1,knodc,igauss)+ &
190  shdx(2,knodr,igauss)*shdx(2,knodc,igauss)+ &
191  shdx(3,knodr,igauss)*shdx(3,knodc,igauss) &
192  )*dv(igauss)*factor
193  END DO
194  END DO
195  ENDDO ! for igauss = nintk_v
196 
197  DO i=1,nnode
198  nx = lmlstet(i,ielem)*3-2
199  ny = lmlstet(i,ielem)*3-1
200  nz = lmlstet(i,ielem)*3
201  DO j=1,nnode
202  r_bar(nx)=r_bar(nx)+ elstiff(i,j)*disp(j*3-2)
203  r_bar(ny)=r_bar(ny)+ elstiff(i,j)*disp(j*3-1)
204  r_bar(nz)=r_bar(nz)+ elstiff(i,j)*disp(j*3-0)
205  END DO
206  END DO
207 
208  ENDDO ! for ielem=1,numlstet
209 
210  RETURN
211 END SUBROUTINE v3d10_r_bar
212 
void zero()
Sets all entries to zero (more efficient than assignement).
j indices k indices k
Definition: Indexing.h:6
subroutine shcalc_3d10(shfn, shdx, dv, dvsum, shdx_av, meshpos, ndim, nnode, nintk, xi, eta, zeta, shdxi, wsp2)
Definition: shcalc_3d10.f90:65
subroutine v3d10_r_bar(d_bar, R_bar, numnp, numlstet, lmlstet, meshcoor, nstart, nend)
Definition: v3d10_r_bar.f90:59
blockLoc i
Definition: read.cpp:79
RT delta(int i) const
Definition: Direction_2.h:159
j indices j
Definition: Indexing.h:6