From 0fc44c315c7d185e8310a439207dd6b177578f18 Mon Sep 17 00:00:00 2001 From: James E McClure Date: Sat, 28 Nov 2015 18:02:56 -0500 Subject: [PATCH 1/2] Fixed typo in D3Q19.cpp / D3Q19.cu --- cpu/D3Q19.cpp | 6 +++--- gpu/D3Q19.cu | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpu/D3Q19.cpp b/cpu/D3Q19.cpp index c16e6c0a..4f460fea 100644 --- a/cpu/D3Q19.cpp +++ b/cpu/D3Q19.cpp @@ -387,10 +387,10 @@ extern "C" void ComputeVelocityD3Q19(char *ID, double *disteven, double *distodd } else{ for(int q=0; q<9; q++){ - f_even[q*N+n] = -1.0; - f_odd[q*N+n] = -1.0; + disteven[q*N+n] = -1.0; + distodd[q*N+n] = -1.0; } - f_even[9*N+n] = -1.0; + disteven[9*N+n] = -1.0; } } } diff --git a/gpu/D3Q19.cu b/gpu/D3Q19.cu index 2c36fad3..f240a416 100644 --- a/gpu/D3Q19.cu +++ b/gpu/D3Q19.cu @@ -298,10 +298,10 @@ __global__ void dvc_ComputeVelocityD3Q19(char *ID, double *disteven, double *di } else{ for(int q=0; q<9; q++){ - f_even[q*N+n] = -1.0; - f_odd[q*N+n] = -1.0; + disteven[q*N+n] = -1.0; + distodd[q*N+n] = -1.0; } - f_even[9*N+n] = -1.0; + disteven[9*N+n] = -1.0; } } From a10006917db6c9dd83127ba1a59d23a9e3ca5fb1 Mon Sep 17 00:00:00 2001 From: James E McClure Date: Sat, 28 Nov 2015 19:39:01 -0500 Subject: [PATCH 2/2] Fixed bug in gpu/D3Q19.cu from re-initilizing distribution within solid (both CPU and GPU versions should now be OK) --- gpu/D3Q19.cu | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/gpu/D3Q19.cu b/gpu/D3Q19.cu index f240a416..866e141e 100644 --- a/gpu/D3Q19.cu +++ b/gpu/D3Q19.cu @@ -262,6 +262,11 @@ __global__ void dvc_ComputeVelocityD3Q19(char *ID, double *disteven, double *di id = ID[n]; if (id==0){ vel[n] = 0.0; vel[N+n] = 0.0; vel[2*N+n]=0.0; + for(int q=0; q<9; q++){ + disteven[q*N+n] = -1.0; + distodd[q*N+n] = -1.0; + } + disteven[9*N+n] = -1.0; } else{ //........................................................................ @@ -296,14 +301,6 @@ __global__ void dvc_ComputeVelocityD3Q19(char *ID, double *disteven, double *di vel[2*N+n] = vz; //........................................................................ } - else{ - for(int q=0; q<9; q++){ - disteven[q*N+n] = -1.0; - distodd[q*N+n] = -1.0; - } - disteven[9*N+n] = -1.0; - } - } } }