Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OperatorJ.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 operatorj (Lm, Ld, Lb, L2, Lbar,Mm, M2, cm, cb, cd, &
54  dbm, dbb, dbd, dmm,dmb,dmd, ddm, ddb, ddd, &
55  am, ab, ad, a2, km, k2, gm, g2, vm, v2, a_eta, a_zeta, &
56  opj, n, ninv, r, rinv, q2, qm, w)
57 
58  IMPLICIT NONE
59 
60  integer :: i
61 
62  REAL*8 :: cm, cb, cd
63  REAL*8 :: a_eta, a_zeta
64 
65  REAL*8 :: gm, g2, km, k2, vm, v2
66 
67  REAL*8, DIMENSION(1:6,1:6) :: am, ab, ad, a2
68  REAL*8, DIMENSION(1:6,1:6) :: lm, ld, lb, l2, lbar
69  REAL*8, DIMENSION(1:6,1:6) :: mm, m2
70  REAL*8, DIMENSION(1:6,1:6) :: dbm, dbb, dbd, dmm,dmb,dmd, ddm, ddb, ddd
71 ! * *
72 
73  REAL*8, DIMENSION(1:6,1:6) :: opj , test
74 
75  REAL*8, DIMENSION(1:6,1:6) :: n, ninv, r, w, rinv
76 
77  REAL*8, DIMENSION(1:6,1:6) :: atmp, lr_lbarinv
78  REAL*8, DIMENSION(1:6,1:6) :: bm, bb, bd
79  REAL*8, DIMENSION(1:6,1:6) :: qm, qb, qd, q2
80 
81  REAL*8, DIMENSION(1:6,1:6) :: ident = reshape( &
82  (/1.d0, 0.d0, 0.d0, 0.d0, 0.d0, 0.d0, &
83  0.d0, 1.d0, 0.d0, 0.d0, 0.d0, 0.d0, &
84  0.d0, 0.d0, 1.d0, 0.d0, 0.d0, 0.d0, &
85  0.d0, 0.d0, 0.d0, 1.d0, 0.d0, 0.d0, &
86  0.d0, 0.d0, 0.d0, 0.d0, 1.d0, 0.d0, &
87  0.d0, 0.d0, 0.d0, 0.d0, 0.d0, 1.d0 /),(/6,6/) )
88 
89 ! W
90 
91 
92  CALL constant_w(gm, g2, k2, km, a_eta, a_zeta, vm, v2, w)
93 
94 ! -1
95 ! N
96 
97  n = matmul(l2,ddd - ident) - matmul(w,matmul(lm,dmd))
98 
99  CALL invert2(n, ninv, 6)
100 
101 ! R
102 
103  r = matmul(w,matmul(lm,am)) - matmul(l2,a2)
104 
105  CALL invert2(r,rinv,6)
106 
107 ! -- Q --
108 
109 ! Qm
110  atmp = lm - lbar
111  CALL invert2( atmp, lr_lbarinv, 6)
112 
113  qm = matmul((ident - am),lr_lbarinv)
114 
115 !Q2
116 
117  atmp = l2 - lbar
118  CALL invert2( atmp, lr_lbarinv, 6)
119 
120  q2 = matmul(ident - a2,lr_lbarinv)
121 
122 ! Qb
123 
124  qb = q2
125 
126 ! Qd
127 
128  qd = q2
129 
130 ! -1
131 ! Bm = [ ( Dmd - I)N (L2 Q2-W Lm Qm )-Qm } A2L2NR
132 
133 !test = MATMUL( Dmd * Ninv*(L2*Q2 - W*Lm*Qm) - Qm,TRANSPOSE(A2)*L2*Ninv*R)
134 !!$ Bb = ( Dbd * Ninv*(L2*Q2 - W*Lm*Qm) - Qb)*TRANSPOSE(A2)*L2*Ninv*R
135 !!$ Bd = ( (Ddd - Ident) * Ninv*(L2*Q2 - W*Lm*Qm) - Qd)*TRANSPOSE(A2)*L2*Ninv*R
136 
137 
138 
139 !!$ Bm = MATMUL( MATMUL (Dmd , MATMUL(Ninv,( MATMUL(L2,Q2) - MATMUL(W,MATMUL(Lm,Qm)) ) ) ) - Qm, &
140 !!$ MATMUL(TRANSPOSE(A2),MATMUL(L2,MATMUL(Ninv,R))) )
141 
142 
143  bm = matmul(l2,q2) - matmul(w, matmul(lm,qm) )
144 
145  bm = matmul(ninv,bm)
146 
147  bm = matmul(dmd,bm)
148 
149  bm = bm - qm
150 
151  bm = matmul(bm,transpose(a2))
152 
153  bm = matmul(bm,l2)
154 
155  bm = matmul(bm,ninv)
156 
157  bm = matmul(bm,r)
158 
159 !!$ DO i = 1,6
160 !!$ PRINT*,'now',Bm(i,1:6)
161 !!$ PRINT*,'org',test(i,1:6)
162 !!$ ENDDO
163 
164  bb = matmul(l2,q2) - matmul(w, matmul(lm,qm) )
165 
166  bb = matmul(ninv,bb)
167 
168  bb = matmul(dbd,bb)
169 
170  bb = bb - qb
171 
172  bb = matmul(bb,transpose(a2))
173 
174  bb = matmul(bb,l2)
175 
176  bb = matmul(bb,ninv)
177 
178  bb = matmul(bb,r)
179 
180 !!$ Bb = MATMUL( MATMUL( Dbd , MATMUL(Ninv,( MATMUL(L2,Q2) - MATMUL(W,MATMUL(Lm,Qm)) ) ) ) - Qb , &
181 !!$ MATMUL(TRANSPOSE(A2),MATMUL(L2,MATMUL(Ninv,R))) )
182 
183 
184  bd = matmul(l2,q2) - matmul(w, matmul(lm,qm) )
185 
186  bd = matmul(ninv,bd)
187 
188  bd = matmul(ddd - ident,bd)
189 
190  bd = bd - qd
191 
192  bd = matmul(bd,transpose(a2))
193 
194  bd = matmul(bd,l2)
195 
196  bd = matmul(bd,ninv)
197 
198  bd = matmul(bd,r)
199 
200 !!$ Bd = MATMUL( MATMUL((Ddd - Ident), MATMUL(Ninv, (MATMUL(L2,Q2) - MATMUL(W,MATMUL(Lm,Qm))) ) ) - Qd, &
201 !!$ MATMUL(TRANSPOSE(A2),MATMUL(L2,MATMUL(Ninv,R))) )
202 
203 ! OpJ = cm*Lm*Bm + cb*L2*Bb + Cd*L2*Bd + L2*( (Ddd - Ident) - Dbd)* Ninv * R
204 
205  opj = matmul( ( ddd - ident) - dbd, ninv)
206 
207  opj = matmul( l2, opj)
208 
209  opj = matmul( opj, r)
210 
211 
212  opj = cm*matmul(lm,bm) + cb*matmul(l2,bb) + cd*matmul(l2,bd) + opj
213 
214 
215 
216 !!$ OpJ = cm*MATMUL(Lm,Bm) + cb*MATMUL(L2,Bb) + cd*MATMUL(L2,Bd) + &
217 !!$ MATMUL(L2, MATMUL( ( Ddd - Ident) - Dbd, MATMUL(Ninv , R)) )
218 
219 !!$ DO i = 1, 6
220 !!$ PRINT*,OpJ(i,1:6)
221 !!$ ENDDO
222 
223 END SUBROUTINE operatorj
224 
unsigned char r() const
Definition: Color.h:68
subroutine constant_w(Gm, G2, K2, Km, a_eta, a_zeta, vm, v2, W)
subroutine operatorj(Lm, Ld, Lb, L2, Lbar, Mm, M2, cm, cb, cd, Dbm, Dbb, Dbd, Dmm, Dmb, Dmd, Ddm, Ddb, Ddd, Am, Ab, Ad, A2, Km, K2, Gm, G2, vm, v2, a_eta, a_zeta, OpJ, N, Ninv, R, Rinv, Q2, Qm, W)
Definition: OperatorJ.f90:53
blockLoc i
Definition: read.cpp:79
void test(void)
Definition: flotsam.C:99
const NT & n
subroutine invert2(Inv_in, a, nrow)