1
1
import sys
2
2
import numpy
3
+ import os
3
4
if __name__ == "__main__" :
4
5
sys .path [0 ] = '/' .join (sys .path [0 ].split ('/' )[0 :- 2 ]) #go up 2 level
5
6
from src .geometry .Geometry2D import *
@@ -73,15 +74,13 @@ def initialize_(self):
73
74
74
75
75
76
76
-
77
-
78
77
def defineRhoU (self ,SuperGeometry ,materialNum ,rho ,u ):
79
78
for coord in self .materialCoordsDic [materialNum ]:
80
79
self .rhoMap [coord [0 ],coord [1 ]] = rho
81
80
self .UMap [coord [0 ],coord [1 ],0 ] = u [0 ]
82
81
self .UMap [coord [0 ],coord [1 ],1 ] = u [1 ]
83
82
84
- def defineU_BC (self ,SuperGeometry ,materialNum ,u ,BCmethod = 'BB ' ):
83
+ def defineU_BC (self ,SuperGeometry ,materialNum ,u ,BCmethod = 'ZH ' ):
85
84
self .vloc = 0
86
85
87
86
#only support symmetrical velocity profile
@@ -96,30 +95,106 @@ def defineU_BC(self,SuperGeometry,materialNum,u,BCmethod = 'BB'):
96
95
self .givenUFindRho (coord [0 ],coord [1 ],u [self .vloc ,:],BCmethod )
97
96
self .vloc = self .vloc + 1
98
97
99
- def defineRho_BC (self ,SuperGeometry ,materialNum ,rho ,BCmethod = 'BB' ):
98
+
99
+ def defineRho_BC (self ,SuperGeometry ,materialNum ,rho ,BCmethod = 'ZH' ):
100
100
for coord in self .materialCoordsDic [materialNum ]:
101
101
self .rhoMap [coord [0 ],coord [1 ]] = rho
102
- self .givenRhoFindU (coord [0 ],coord [1 ],BCmethod )
102
+ self .givenRhoFindU (coord [0 ],coord [1 ],rho , BCmethod )
103
103
104
104
105
- def givenUFindRho (self ,i ,j ,u ,BCmethod ):
105
+ def givenUFindRho (self ,i ,j ,u ,BCmethod ): #need modidfication
106
106
#find rho
107
107
#arrow = self.findArrow(i,j)
108
108
109
- if BCmethod == 'BB ' :
109
+ if BCmethod == 'ZH ' :
110
110
for p in numpy .arange (1 ,5 ):
111
111
if self .dynamics [(i + self .cx [p ])% self .dynamics .shape [0 ],(j + self .cy [p ])% self .dynamics .shape [1 ]] == 1 :
112
112
113
- self .rhoMap [i ,j ] = 1.5 * self .rhoMap [i + self .cx [p ],j + self .cy [p ]] - 0.5 * self .rhoMap [i + 2 * self .cx [p ],j + 2 * self .cy [p ]]
114
-
115
-
116
- def givenRhoFindU (self ,i ,j ,BCmethod ):
113
+ # self.rhoMap[i,j] = 1.5*self.rhoMap[i+self.cx[p],j+self.cy[p]] - 0.5*self.rhoMap[i+2*self.cx[p],j+2*self.cy[p]]
114
+ # # the following codes have sign error !!!!!!
115
+ if p == 1 : #left/west
116
+ self .rhoMap [i ,j ] = 1 / (1 - u [0 ])* (self .f [i ,j ,0 ]+ self .f [i ,j ,2 ]+ self .f [i ,j ,4 ]+ 2 * (self .f [i ,j ,3 ]+ self .f [i ,j ,6 ]+ self .f [i ,j ,7 ]))
117
+ self .f [i ,j ,1 ] = self .f [i ,j ,3 ]+ 2 / 3 * self .rhoMap [i ,j ]* u [0 ]
118
+ self .f [i ,j ,5 ] = self .f [i ,j ,7 ]- 1 / 2 * (self .f [i ,j ,2 ]- self .f [i ,j ,4 ])+ 1 / 6 * self .rhoMap [i ,j ]* u [0 ]+ 1 / 2 * self .rhoMap [i ,j ]* u [1 ]
119
+ self .f [i ,j ,8 ] = self .f [i ,j ,6 ]+ 1 / 2 * (self .f [i ,j ,2 ]- self .f [i ,j ,4 ])+ 1 / 6 * self .rhoMap [i ,j ]* u [0 ]- 1 / 2 * self .rhoMap [i ,j ]* u [1 ]
120
+ elif p == 2 : #bottom/south
121
+ self .rhoMap [i ,j ] = 1 / (1 - u [1 ])* (self .f [i ,j ,0 ]+ self .f [i ,j ,1 ]+ self .f [i ,j ,3 ]+ 2 * (self .f [i ,j ,4 ]+ self .f [i ,j ,7 ]+ self .f [i ,j ,8 ]))
122
+ self .f [i ,j ,2 ] = self .f [i ,j ,4 ]+ 2 / 3 * self .rhoMap [i ,j ]* u [1 ]
123
+ self .f [i ,j ,5 ] = self .f [i ,j ,7 ]- 1 / 2 * (self .f [i ,j ,1 ]- self .f [i ,j ,3 ])+ 1 / 2 * self .rhoMap [i ,j ]* u [0 ]+ 1 / 6 * self .rhoMap [i ,j ]* u [1 ]
124
+ self .f [i ,j ,6 ] = self .f [i ,j ,8 ]+ 1 / 2 * (self .f [i ,j ,1 ]- self .f [i ,j ,3 ])- 1 / 2 * self .rhoMap [i ,j ]* u [0 ]+ 1 / 6 * self .rhoMap [i ,j ]* u [1 ]
125
+
126
+ elif p == 3 : #right/east
127
+ #print(self.f[i,j,:])
128
+ self .rhoMap [i ,j ] = 1 / (1 + u [0 ])* (self .f [i ,j ,0 ]+ self .f [i ,j ,2 ]+ self .f [i ,j ,4 ]+ 2 * (self .f [i ,j ,1 ]+ self .f [i ,j ,5 ]+ self .f [i ,j ,8 ]))
129
+ self .f [i ,j ,3 ] = self .f [i ,j ,1 ]- 2 / 3 * self .rhoMap [i ,j ]* u [0 ]
130
+ self .f [i ,j ,7 ] = self .f [i ,j ,5 ]+ 1 / 2 * (self .f [i ,j ,2 ]- self .f [i ,j ,4 ])- 1 / 6 * self .rhoMap [i ,j ]* u [0 ]- 1 / 2 * self .rhoMap [i ,j ]* u [1 ]
131
+ self .f [i ,j ,6 ] = self .f [i ,j ,8 ]- 1 / 2 * (self .f [i ,j ,2 ]- self .f [i ,j ,4 ])- 1 / 6 * self .rhoMap [i ,j ]* u [0 ]+ 1 / 2 * self .rhoMap [i ,j ]* u [1 ]
132
+ #print(self.rhoMap[i,j])
133
+ elif p == 4 : #top/north
134
+ self .rhoMap [i ,j ] = 1 / (1 + u [1 ])* (self .f [i ,j ,0 ]+ self .f [i ,j ,1 ]+ self .f [i ,j ,3 ]+ 2 * (self .f [i ,j ,2 ]+ self .f [i ,j ,5 ]+ self .f [i ,j ,6 ]))
135
+ self .f [i ,j ,4 ] = self .f [i ,j ,2 ]- 2 / 3 * self .rhoMap [i ,j ]* u [1 ]
136
+ self .f [i ,j ,7 ] = self .f [i ,j ,5 ]+ 1 / 2 * (self .f [i ,j ,1 ]- self .f [i ,j ,3 ])- 1 / 2 * self .rhoMap [i ,j ]* u [0 ]- 1 / 6 * self .rhoMap [i ,j ]* u [1 ]
137
+ self .f [i ,j ,8 ] = self .f [i ,j ,6 ]- 1 / 2 * (self .f [i ,j ,1 ]- self .f [i ,j ,3 ])+ 1 / 2 * self .rhoMap [i ,j ]* u [0 ]- 1 / 6 * self .rhoMap [i ,j ]* u [1 ]
138
+ # self.rhoMap[i,j] = self.f[i,j].sum()
139
+ # print(self.rhoMap[i,j])
140
+
141
+
142
+ def givenRhoFindU (self ,i ,j ,rho ,BCmethod ): #need modidfication
117
143
#find U
118
144
#arrow = findArrow(i,j)
119
- if BCmethod == 'BB ' :
145
+ if BCmethod == 'ZH ' :
120
146
for p in numpy .arange (1 ,5 ):
121
147
if self .dynamics [(i + self .cx [p ])% self .dynamics .shape [0 ],(j + self .cy [p ])% self .dynamics .shape [1 ]] == 1 :
122
- self .UMap [i ,j ] = 1.5 * self .UMap [i + self .cx [p ],j + self .cy [p ]]- 0.5 * self .UMap [i + 2 * self .cx [p ],j + 2 * self .cy [p ]]
148
+ # self.UMap[i,j] = 1.5*self.UMap[i+self.cx[p],j+self.cy[p]]-0.5*self.UMap[i+2*self.cx[p],j+2*self.cy[p]]
149
+ if p == 1 :
150
+ self .UMap [i ,j ,0 ] = 1 - (self .f [i ,j ,0 ]+ self .f [i ,j ,2 ]+ self .f [i ,j ,4 ]+ 2 * (self .f [i ,j ,3 ]+ self .f [i ,j ,6 ]+ self .f [i ,j ,7 ]))/ rho
151
+ self .UMap [i ,j ,1 ] = 0
152
+ self .f [i ,j ,1 ] = self .f [i ,j ,3 ]+ 2 / 3 * rho * self .UMap [i ,j ,0 ]
153
+ self .f [i ,j ,5 ] = self .f [i ,j ,7 ]- 1 / 2 * (self .f [i ,j ,2 ]- self .f [i ,j ,4 ])+ 1 / 6 * rho * self .UMap [i ,j ,0 ]
154
+ self .f [i ,j ,8 ] = self .f [i ,j ,6 ]+ 1 / 2 * (self .f [i ,j ,2 ]- self .f [i ,j ,4 ])+ 1 / 6 * rho * self .UMap [i ,j ,0 ]
155
+ elif p == 2 :
156
+ self .UMap [i ,j ,0 ] = 0
157
+ self .UMap [i ,j ,1 ] = 1 - (self .f [i ,j ,0 ]+ self .f [i ,j ,1 ]+ self .f [i ,j ,3 ]+ 2 * (self .f [i ,j ,4 ]+ self .f [i ,j ,7 ]+ self .f [i ,j ,8 ]))/ rho
158
+ self .f [i ,j ,2 ] = self .f [i ,j ,4 ]+ 2 / 3 * rho * self .UMap [i ,j ,1 ]
159
+ self .f [i ,j ,5 ] = self .f [i ,j ,7 ]- 1 / 2 * (self .f [i ,j ,1 ]- self .f [i ,j ,3 ])+ 1 / 6 * rho * self .UMap [i ,j ,1 ]
160
+ self .f [i ,j ,6 ] = self .f [i ,j ,8 ]+ 1 / 2 * (self .f [i ,j ,1 ]- self .f [i ,j ,3 ])+ 1 / 6 * rho * self .UMap [i ,j ,1 ]
161
+ elif p == 3 :
162
+ #print('good')
163
+ self .UMap [i ,j ,0 ] = - 1 + (self .f [i ,j ,0 ]+ self .f [i ,j ,2 ]+ self .f [i ,j ,4 ]+ 2 * (self .f [i ,j ,1 ]+ self .f [i ,j ,5 ]+ self .f [i ,j ,8 ]))/ rho
164
+ self .UMap [i ,j ,1 ] = 0
165
+ self .f [i ,j ,3 ] = self .f [i ,j ,1 ]- 2 / 3 * rho * self .UMap [i ,j ,0 ]
166
+ self .f [i ,j ,7 ] = self .f [i ,j ,5 ]+ 1 / 2 * (self .f [i ,j ,2 ]- self .f [i ,j ,4 ])- 1 / 6 * rho * self .UMap [i ,j ,0 ]
167
+ self .f [i ,j ,6 ] = self .f [i ,j ,8 ]- 1 / 2 * (self .f [i ,j ,2 ]- self .f [i ,j ,4 ])- 1 / 6 * rho * self .UMap [i ,j ,0 ]
168
+ elif p == 4 :
169
+ self .UMap [i ,j ,0 ] = 0
170
+ self .UMap [i ,j ,1 ] = - 1 + (self .f [i ,j ,0 ]+ self .f [i ,j ,1 ]+ self .f [i ,j ,3 ]+ 2 * (self .f [i ,j ,2 ]+ self .f [i ,j ,5 ]+ self .f [i ,j ,6 ]))/ rho
171
+ self .f [i ,j ,4 ] = self .f [i ,j ,2 ]- 2 / 3 * rho * self .UMap [i ,j ,1 ]
172
+ self .f [i ,j ,7 ] = self .f [i ,j ,5 ]+ 1 / 2 * (self .f [i ,j ,1 ]- self .f [i ,j ,3 ])- 1 / 6 * rho * self .UMap [i ,j ,1 ]
173
+ self .f [i ,j ,8 ] = self .f [i ,j ,6 ]- 1 / 2 * (self .f [i ,j ,1 ]- self .f [i ,j ,3 ])- 1 / 6 * rho * self .UMap [i ,j ,1 ]
174
+
175
+ def openBC (self ,SuperGeometry ,materialNum ):
176
+ for coord in self .materialCoordsDic [materialNum ]:
177
+ for p in numpy .arange (1 ,5 ):
178
+ if self .dynamics [(coord [0 ]+ self .cx [p ])% self .dynamics .shape [0 ],(coord [1 ]+ self .cy [p ])% self .dynamics .shape [1 ]] == 1 :
179
+ if p == 1 :
180
+ #print(2 * self.f[coord[0]+self.cx[p],coord[1]+self.cy[p],1] - self.f[coord[0]+2*self.cx[p],coord[1]+2*self.cy[p],1])
181
+ self .f [coord [0 ],coord [1 ],1 ] = 2 * self .f [coord [0 ]+ self .cx [p ],coord [1 ]+ self .cy [p ],1 ] - self .f [coord [0 ]+ 2 * self .cx [p ],coord [1 ]+ 2 * self .cy [p ],1 ]
182
+ self .f [coord [0 ],coord [1 ],5 ] = 2 * self .f [coord [0 ]+ self .cx [p ],coord [1 ]+ self .cy [p ],5 ] - self .f [coord [0 ]+ 2 * self .cx [p ],coord [1 ]+ 2 * self .cy [p ],5 ]
183
+ self .f [coord [0 ],coord [1 ],8 ] = 2 * self .f [coord [0 ]+ self .cx [p ],coord [1 ]+ self .cy [p ],8 ] - self .f [coord [0 ]+ 2 * self .cx [p ],coord [1 ]+ 2 * self .cy [p ],8 ]
184
+ elif p == 2 :
185
+ self .f [coord [0 ],coord [1 ],2 ] = 2 * self .f [coord [0 ]+ self .cx [p ],coord [1 ]+ self .cy [p ],2 ] - self .f [coord [0 ]+ 2 * self .cx [p ],coord [1 ]+ 2 * self .cy [p ],2 ]
186
+ self .f [coord [0 ],coord [1 ],5 ] = 2 * self .f [coord [0 ]+ self .cx [p ],coord [1 ]+ self .cy [p ],5 ] - self .f [coord [0 ]+ 2 * self .cx [p ],coord [1 ]+ 2 * self .cy [p ],5 ]
187
+ self .f [coord [0 ],coord [1 ],6 ] = 2 * self .f [coord [0 ]+ self .cx [p ],coord [1 ]+ self .cy [p ],6 ] - self .f [coord [0 ]+ 2 * self .cx [p ],coord [1 ]+ 2 * self .cy [p ],6 ]
188
+ elif p == 3 :
189
+ self .f [coord [0 ],coord [1 ],3 ] = 2 * self .f [coord [0 ]+ self .cx [p ],coord [1 ]+ self .cy [p ],3 ] - self .f [coord [0 ]+ 2 * self .cx [p ],coord [1 ]+ 2 * self .cy [p ],3 ]
190
+ self .f [coord [0 ],coord [1 ],7 ] = 2 * self .f [coord [0 ]+ self .cx [p ],coord [1 ]+ self .cy [p ],7 ] - self .f [coord [0 ]+ 2 * self .cx [p ],coord [1 ]+ 2 * self .cy [p ],7 ]
191
+ self .f [coord [0 ],coord [1 ],6 ] = 2 * self .f [coord [0 ]+ self .cx [p ],coord [1 ]+ self .cy [p ],6 ] - self .f [coord [0 ]+ 2 * self .cx [p ],coord [1 ]+ 2 * self .cy [p ],6 ]
192
+ elif p == 4 :
193
+ self .f [coord [0 ],coord [1 ],4 ] = 2 * self .f [coord [0 ]+ self .cx [p ],coord [1 ]+ self .cy [p ],4 ] - self .f [coord [0 ]+ 2 * self .cx [p ],coord [1 ]+ 2 * self .cy [p ],4 ]
194
+ self .f [coord [0 ],coord [1 ],7 ] = 2 * self .f [coord [0 ]+ self .cx [p ],coord [1 ]+ self .cy [p ],7 ] - self .f [coord [0 ]+ 2 * self .cx [p ],coord [1 ]+ 2 * self .cy [p ],7 ]
195
+ self .f [coord [0 ],coord [1 ],8 ] = 2 * self .f [coord [0 ]+ self .cx [p ],coord [1 ]+ self .cy [p ],8 ] - self .f [coord [0 ]+ 2 * self .cx [p ],coord [1 ]+ 2 * self .cy [p ],8 ]
196
+
197
+
123
198
124
199
def findArrow (self ,i ,j ):
125
200
arrow = numpy .zeros (8 )
@@ -142,23 +217,26 @@ def collide(self):
142
217
if self .initialization == 0 :
143
218
self .initialize_ ()
144
219
145
- self .BGKcollide ()
146
-
147
-
148
-
149
-
220
+ self .updateRhoU () #13
221
+ self .BGKcollide () #25
150
222
151
223
def BGKcollide (self ):
224
+
152
225
self .t1 = self .UMap [:,:,0 ]* self .UMap [:,:,0 ] + self .UMap [:,:,1 ]* self .UMap [:,:,1 ]
153
226
if not hasattr (self ,'t2' ):
154
227
self .t2 = numpy .zeros (self .f .shape )
155
- for k in numpy .arange (9 ):
156
- self .t2 [:,:,k ] = self .UMap [:,:,0 ]* self .cx [k ]+ self .UMap [:,:,1 ]* self .cy [k ]
157
- self .feq [:,:,k ] = self .rhoMap * self .distribution [k ]* (1 + 3 * self .t2 [:,:,k ]+ 4.5 * self .t2 [:,:,k ]* self .t2 [:,:,k ]- 1.5 * self .t1 )
158
228
229
+ self .t2 = self .UMap [:,:,0 ]* numpy .swapaxes ([[self .cx ]],0 ,2 )+ self .UMap [:,:,1 ]* numpy .swapaxes ([[self .cy ]],0 ,2 )
230
+ self .feq = self .rhoMap * numpy .swapaxes ([[self .distribution ]],0 ,2 )* (1 + 3 * self .t2 + 4.5 * self .t2 * self .t2 - 1.5 * self .t1 )
231
+ self .feq = numpy .swapaxes (numpy .swapaxes (self .feq ,0 ,1 ),1 ,2 )
232
+
233
+ # for k in numpy.arange(9):
234
+ # self.t2[:,:,k] = self.UMap[:,:,0]*self.cx[k]+self.UMap[:,:,1]*self.cy[k]
235
+ # self.feq[:,:,k] = self.rhoMap*self.distribution[k]*(1+3*self.t2[:,:,k]+4.5*self.t2[:,:,k]*self.t2[:,:,k]-1.5*self.t1)
159
236
self .f = self .f + self .omega_9 * (self .feq - self .f )
160
237
161
238
239
+
162
240
def stream (self ):
163
241
#bounceback 2 # 75% computation time
164
242
# for i in numpy.arange(self.dynamics.shape[0]):
@@ -168,6 +246,8 @@ def stream(self):
168
246
# #if self.surrundingDynamics[i,j,k] in [1,3,4]: #half way bounceback: modify f on near bulk fluids
169
247
# self.f[i,j,k] = self.f[(i+self.cx[k])%self.f.shape[0],(j+self.cy[k])%self.f.shape[1],self.opposite[k]]
170
248
249
+
250
+
171
251
#pre-stream for bounceBack
172
252
self .tmp_f = self .f .copy ()
173
253
for k in numpy .arange (1 ,9 ):
@@ -179,7 +259,9 @@ def stream(self):
179
259
self .f [:,:,k ] = numpy .roll (numpy .roll (self .f [:,:,k ],self .cx [k ],0 ),self .cy [k ],1 )
180
260
181
261
#calculate rhoMap given f after stream
182
- self .updateRhoU ()
262
+
263
+
264
+
183
265
184
266
def updateRhoU (self ):
185
267
self .rhoMap = self .f .sum (2 )
@@ -235,12 +317,11 @@ def getDynamicsCoords(self,dynamicsIndex):
235
317
return numpy .int_ (dynamicsCoords )
236
318
237
319
238
-
239
320
if __name__ == "__main__" :
240
321
#parameters
241
322
numpy .set_printoptions (3 )
242
- nx = 11
243
- ny = 5
323
+ nx = 30
324
+ ny = 10
244
325
center_x = 3
245
326
center_y = 3
246
327
radius = 2
@@ -281,41 +362,52 @@ def getDynamicsCoords(self,dynamicsIndex):
281
362
282
363
sLattice .defineDynamics (superG ,1 ,bulk1 )# SuperGeometry, materialNum, dynamics
283
364
sLattice .defineDynamics (superG ,2 ,bulk1 )
284
- sLattice .defineDynamics (superG ,3 ,BBvelocity (omega ))
285
- sLattice .defineDynamics (superG ,4 ,BBpressure (omega ))
365
+ sLattice .defineDynamics (superG ,4 ,BBvelocity (omega ))
366
+ #sLattice.defineDynamics(superG,4,BBpressure(omega))
367
+ sLattice .defineDynamics (superG ,3 ,BBpressure (omega ))
286
368
sLattice .defineDynamics (superG ,5 ,BBwall ())
287
369
288
-
289
-
290
370
#print(sLattice.dynamics)
291
371
#print(sLattice.omega)
292
372
#print(sLattice.dynamics)
293
373
294
374
#print(sLattice.getUyMap())
375
+
376
+
377
+
378
+ outputDirectory = 'data'
379
+ if not os .path .exists (outputDirectory ):
380
+ os .makedirs (outputDirectory )
381
+
382
+
295
383
print ('initial average rho: {}' .format (sLattice .getAverageRho ()))
296
- maxVelocity = numpy .array ([- 0.1 ,0 ])
384
+ maxVelocity = numpy .array ([0.1 ,0 ])
297
385
#poV = Poiseuille2D(superG,3,maxVelocity,0.5).getVelocityField() #SuperGeometry,materialNum,maxVelocity,distance2Wall
298
- poV = numpy .array ([- 0.1 ,0 ])
299
- sLattice .defineU_BC (superG ,3 ,poV )
300
- sLattice .defineRho_BC (superG ,4 ,1 )
386
+ poV = numpy .array (maxVelocity )
301
387
388
+ sLattice .defineU_BC (superG ,4 ,poV )
389
+ sLattice .defineRho_BC (superG ,3 ,1 )
390
+ #sLattice.openBC(superG,4)
302
391
#print('initial Ux:\n{}\n==============================='.format(sLattice.getUxMap()))
303
-
304
- print (sLattice .getUxMap ())
305
392
numpy .set_printoptions (3 )
306
393
307
- print (sLattice .initialization )
308
- for i in numpy .arange (1000 ):
309
- if i % 100 == 0 :
310
- print ('{}/1000' .format (i ))
394
+
395
+ print (sLattice .getUxMap ())
396
+ print (sLattice .rhoMap )
397
+ for iT in numpy .arange (1000 ):
398
+ # if iT%1000 == 0:
399
+ # print('{}/1000'.format(iT))
400
+ # print(sLattice.getUxMap())
311
401
312
402
sLattice .collide ()
313
403
sLattice .stream ()
314
- sLattice .defineU_BC (superG ,3 ,poV )
315
- sLattice .defineRho_BC (superG ,4 ,1 )
316
-
317
-
318
-
404
+ sLattice .defineU_BC (superG ,4 ,poV )
405
+ sLattice .defineRho_BC (superG ,3 ,1 )
406
+ #sLattice.defineRho_BC(superG,3,1)
407
+ #sLattice.openBC(superG,4)
408
+ # if iT%500==0:
409
+ # numpy.savetxt('{}/VelocityProfile_{}'.format(outputDirectory,iT),sLattice.getUxMap())
410
+ # print('{}/10000'.format(iT))
319
411
320
412
#print(sLattice.getUxMap())
321
413
#print(sLattice.getAverageRho())
@@ -325,13 +417,15 @@ def getDynamicsCoords(self,dynamicsIndex):
325
417
#print(sLattice.surrundingDynamics[:,:,1])
326
418
327
419
#print(sLattice.f[:,:,1])
328
- print ('final Ux:\n {}\n ===============================' .format (sLattice .getUxMap ()))
420
+ print ('===============================final Ux:\n {}\n ' .format (sLattice .getUxMap ()))
421
+ print ('===============================final Uy:\n {}\n ' .format (sLattice .getUyMap ()))
329
422
#print(sLattice.getUyMap())
330
423
#print(sLattice.getRhoMap())
331
424
#print(sLattice.getRhoMap().sum())
332
425
print ('final average rho: {}' .format (sLattice .getAverageRho ()))
333
426
print (sLattice .getRhoMap ())
334
427
335
428
#print(sLattice.dynamics)
336
- print (sLattice .f .shape )
337
- #numpy.savetxt('tmp_file_Ux.txt',sLattice.getUxMap())
429
+ #numpy.savetxt('tmp_file_Ux.txt',sLattice.getUxMap())
430
+ #print(sLattice.dynamics)
431
+
0 commit comments