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;
//...................................................................
// Update Phi
char id;
int S = N/NBLOCKS/NTHREADS + 1;
for (int s=0; s<S; s++){
//........Get 1-D index for this thread....................
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)
Na = Den[n];
Nb = Den[N+n];
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){

View File

@@ -168,8 +168,9 @@ __global__ void dvc_ComputeDensityD3Q7(char *ID, double *disteven, double *dist
for (int s=0; s<S; s++){
//........Get 1-D index for this thread....................
n = S*blockIdx.x*blockDim.x + s*blockDim.x + threadIdx.x;
if (n<N){
id = ID[n];
if (n<N && id > 0 ){
if ( id != 0 ){
// Read the distributions
f0 = disteven[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){
int GRID = count / 512 + 1;