This commit is contained in:
James E McClure
2018-05-12 21:46:48 -04:00
parent 0ceb0b51c7
commit 047ead1a7e

View File

@@ -243,7 +243,8 @@ int main(int argc, char **argv)
int count = 0;
int total = 0;
int totalGlobal = nx*ny*nz*nprocs;
int totalGlobal = 0;
int countGlobal = 0;
for (k=1;k<nz-1;k++){
for (j=1;j<ny-1;j++){
for (i=1;i<nx-1;i++){
@@ -255,9 +256,10 @@ int main(int argc, char **argv)
}
}
}
MPI_Allreduce(&total,&totalGlobal,1,MPI_INT,MPI_SUM,comm);
MPI_Allreduce(&count,&countGlobal,1,MPI_INT,MPI_SUM,comm);
float porosity = float(totalGlobal-countGlobal)/totalGlobal;
if (rank==0) printf("Porosity=%f\n",porosity);
float poros = float(totalGlobal-countGlobal)/totalGlobal;
if (rank==0) printf("Porosity=%f\n",poros);
// Initialize the signed distance function