Skip to content

Commit 8cf146e

Browse files
committed
Working version 1
1 parent e8da959 commit 8cf146e

File tree

4 files changed

+184
-78
lines changed

4 files changed

+184
-78
lines changed

models/flow/d2q9/Dynamics.c.Rt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ CudaDeviceFunction vector_t getU(){
5252
u.y += BC[1]*0.5;
5353
}
5454
<?R } ?>
55+
if (NodeType == NODE_Wall) {
56+
u.x = 0;
57+
u.y = 0;
58+
}
5559
u.x += GravitationX*0.5;
5660
u.y += GravitationY*0.5;
5761
u.z = 0.0;
@@ -62,7 +66,7 @@ CudaDeviceFunction float2 Color() {
6266
float2 ret;
6367
vector_t u = getU();
6468
ret.x = sqrt(u.x*u.x + u.y*u.y);
65-
if (NodeType == NODE_Wall){
69+
if (NodeType == NODE_Solid){
6670
ret.y = 0;
6771
} else {
6872
ret.y = 1;

src/LatticeContainer.inc.cpp.Rt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ CudaDeviceFunction void NodeToColor( int x, int y, int z, uchar4 *optr )
379379
if (ISFINITE(l)) {
380380

381381
l = l * 111;
382-
/*
382+
383383
if ( (l <-111)) {r = 255; g = 255; b = 255; }
384384
if ((l >= -111) && (l < -11)) {r = 255*(-l-11)/100; g = 255; b = 255; }
385385
if ((l >= -11) && (l < -1)) {r = 0; g = (255*(-l-1))/10; b = 255; }
@@ -388,13 +388,7 @@ if (ISFINITE(l)) {
388388
if ((l >= 1) && (l < 11)) {r = 255; g = 255*(l-1)/10; b = 0; }
389389
if ((l >= 11) && (l < 111)) {r = 255; g = 255; b = 255*(l-11)/100; }
390390
if ((l >= 111) ) {r = 255; g = 255; b = 255; }
391-
*/
392-
if ( (l < -11)) {r = 255; g = 0; b = 0; }
393-
if ((l >= -11) && (l < -1)) {r = 0; g = 255*(1-(-l-1)/10); b = 0; }
394-
if ((l >= -1) && (l < 0)) {r = 255; g = 255; b = 255*(1+l); }
395-
if ((l >= 0) && (l < 1)) {r = 255; g = 255*(1-l); b = 255; }
396-
if ((l >= 1) && (l < 11)) {r = 255; g = 0; b = 255*(1-(l-1)/10); }
397-
if ((l >= 11) ) {r = 255; g = 0; b = 0; }
391+
398392
r=r*w;
399393
g=g*w + (1-w)*255;
400394
b=b*w;

0 commit comments

Comments
 (0)