Debugging TestMassConservationD3Q7

This commit is contained in:
James E McClure 2015-06-24 20:02:16 -04:00
parent 55e5845da0
commit 357133fe29
2 changed files with 12 additions and 6 deletions

View File

@ -1377,17 +1377,21 @@ __global__ void dvc_ComputePhi(char *ID, double *Phi, double *Den, int N)
double Na,Nb; double Na,Nb;
//................................................................... //...................................................................
// Update Phi // Update Phi
char id;
int S = N/NBLOCKS/NTHREADS + 1; int S = N/NBLOCKS/NTHREADS + 1;
for (int s=0; s<S; s++){ for (int s=0; s<S; s++){
//........Get 1-D index for this thread.................... //........Get 1-D index for this thread....................
n = S*blockIdx.x*blockDim.x + s*blockDim.x + threadIdx.x; n = S*blockIdx.x*blockDim.x + s*blockDim.x + threadIdx.x;
if (n<N && ID[n] > 0){ if (n<N){
id=ID[n];
if (id != 0){
// Get the density value (Streaming already performed) // Get the density value (Streaming already performed)
Na = Den[n]; Na = Den[n];
Nb = Den[N+n]; Nb = Den[N+n];
Phi[n] = (Na-Nb)/(Na+Nb); Phi[n] = (Na-Nb)/(Na+Nb);
} }
} }
}
//................................................................... //...................................................................
} }
extern "C" void InitDenColor(char *ID, double *Den, double *Phi, double das, double dbs, int Nx, int Ny, int Nz){ extern "C" void InitDenColor(char *ID, double *Den, double *Phi, double das, double dbs, int Nx, int Ny, int Nz){

View File

@ -168,8 +168,9 @@ __global__ void dvc_ComputeDensityD3Q7(char *ID, double *disteven, double *dist
for (int s=0; s<S; s++){ for (int s=0; s<S; s++){
//........Get 1-D index for this thread.................... //........Get 1-D index for this thread....................
n = S*blockIdx.x*blockDim.x + s*blockDim.x + threadIdx.x; n = S*blockIdx.x*blockDim.x + s*blockDim.x + threadIdx.x;
if (n<N){
id = ID[n]; id = ID[n];
if (n<N && id > 0 ){ if ( id != 0 ){
// Read the distributions // Read the distributions
f0 = disteven[n]; f0 = disteven[n];
f2 = disteven[N+n]; f2 = disteven[N+n];
@ -183,6 +184,7 @@ __global__ void dvc_ComputeDensityD3Q7(char *ID, double *disteven, double *dist
} }
} }
} }
}
extern "C" void PackValues(int *list, int count, double *sendbuf, double *Data, int N){ extern "C" void PackValues(int *list, int count, double *sendbuf, double *Data, int N){
int GRID = count / 512 + 1; int GRID = count / 512 + 1;