@@ -169,36 +169,33 @@ function lbm3d(n)
169
169
numactivenodes = sum (1 - BOUND)
170
170
171
171
@time while (ts < 4000 && (1e-10 < abs ((prevavu- avu)/ avu))) || ts < 100
172
- tic ()
173
- # Propagate -- nearest and next-nearest neighbors
174
- for i = 2 : 19
175
- circshift3d1! (F, i, prop_shifts[i- 1 ])
172
+ tprop += @elapsed begin
173
+ # Propagate -- nearest and next-nearest neighbors
174
+ for i = 2 : 19
175
+ circshift3d1! (F, i, prop_shifts[i- 1 ])
176
+ end
176
177
end
177
- tprop = tprop + toq ()
178
178
179
179
# Densities bouncing back at next timestep
180
180
BOUNCEDBACK = F[TO_REFLECT]
181
181
182
- tic ()
183
-
184
- # Relax; calculate equilibrium state (FEQ) with equivalent speed and density to F
185
- @threads for chunk = 1 : nchunk
186
- relax! (F, UX, UY, UZ, nx, ny, nz, deltaU, t1D, t2D, t3D, sSQU, chunkid, nchunk)
187
- end
188
- for o in ON
189
- UX[o] = UY[o] = UZ[o] = t1D[o] = t2D[o] = t3D[o] = sSQU[o] = 0.0
182
+ trelax += @elapsed begin
183
+ # Relax; calculate equilibrium state (FEQ) with equivalent speed and density to F
184
+ @threads for chunk = 1 : nchunk
185
+ relax! (F, UX, UY, UZ, nx, ny, nz, deltaU, t1D, t2D, t3D, sSQU, chunkid, nchunk)
186
+ end
187
+ for o in ON
188
+ UX[o] = UY[o] = UZ[o] = t1D[o] = t2D[o] = t3D[o] = sSQU[o] = 0.0
189
+ end
190
190
end
191
191
192
- trelax = trelax + toq ()
193
- tic ()
194
-
195
- # Calculate equilibrium distribution: stationary
196
- @threads for chunk= 1 : nchunk
197
- calc_equi! (F, FEQ, t1D, t2D, t3D, U, UX, UY, UZ, sSQU, nx, ny, nz, omega)
192
+ tequi += @elapsed begin
193
+ # Calculate equilibrium distribution: stationary
194
+ @threads for chunk= 1 : nchunk
195
+ calc_equi! (F, FEQ, t1D, t2D, t3D, U, UX, UY, UZ, sSQU, nx, ny, nz, omega)
196
+ end
198
197
end
199
198
200
- tequi = tequi + toq ()
201
-
202
199
F[REFLECTED] = BOUNCEDBACK
203
200
204
201
prevavu = avu
0 commit comments