-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathstreaming.m
More file actions
47 lines (44 loc) · 844 Bytes
/
streaming.m
File metadata and controls
47 lines (44 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
%% streaming
for i=1:nx
in=i-1;
ip=i+1;
for j=1:ny
if j>1
jn=j-1;
else
jn=ny;
end
if j<ny
jp=j+1;
else
jp=1;
end
% ftemp id distribution at time = t+1
% f is distribution at current time
if jn~=0
ftemp(i , jn , 4) = f(i,j,4);
end
ftemp(i , j , 9) = f(i,j,9);
if jp~=ny+1
ftemp(i , jp , 2) = f(i,j,2);
end
if in~=0
ftemp(in, j , 3) = f(i,j,3);
if jp~=ny+1
ftemp(in, jp , 6) = f(i,j,6);
end
if jn~=0
ftemp(in, jn , 7) = f(i,j,7);
end
end
if ip~=nx+1
if jp~=ny+1
ftemp(ip, jp , 5) = f(i,j,5);
end
if jn~=0
ftemp(ip, jn , 8) = f(i,j,8);
end
ftemp(ip, j , 1) = f(i,j,1);
end
end
end