Fixed bug in lbpm_segmented_decomp porosity calculation

This commit is contained in:
James E McClure 2016-02-28 17:50:44 -05:00
parent cae26e1c28
commit c6e3004101

View File

@ -213,16 +213,16 @@ int main(int argc, char **argv)
int total = 0; int total = 0;
int countGlobal = 0; int countGlobal = 0;
int totalGlobal = 0; int totalGlobal = 0;
for (int k=1; k<Nz-1; k++){ for (k=1;k<nz-1;k++){
for (int j=1; j<Ny-1; j++){ for (j=1;j<ny-1;j++){
for (int i=1; i<Nx-1; i++){ for (i=1;i<nx-1;i++){
n=k*Nx*Ny+j*Nx+i; n=k*Nx*Ny+j*Nx+i;
total++; total++;
if (Dm.id[n] == 0){ if (Dm.id[n] == 0){
count++; count++;
} }
} }
} }
} }
MPI_Allreduce(&count,&countGlobal,1,MPI_INT,MPI_SUM,comm); MPI_Allreduce(&count,&countGlobal,1,MPI_INT,MPI_SUM,comm);
MPI_Allreduce(&total,&totalGlobal,1,MPI_INT,MPI_SUM,comm); MPI_Allreduce(&total,&totalGlobal,1,MPI_INT,MPI_SUM,comm);