diff --git a/tests/lbpm_refine_pp.cpp b/tests/lbpm_refine_pp.cpp index f7b75635..ca3feb12 100644 --- a/tests/lbpm_refine_pp.cpp +++ b/tests/lbpm_refine_pp.cpp @@ -145,13 +145,18 @@ int main(int argc, char **argv) //FILE *ID = fopen(LocalRankFilename,"wb"); //fwrite(id,1,N,ID); //fclose(ID); - +/* sprintf(LocalRankFilename,"RefineDist.%05i",rank); FILE *REFINEDIST = fopen(LocalRankFilename,"wb"); fwrite(RefinedSignDist.data(),8,rnx*rny*rnz,REFINEDIST); fclose(REFINEDIST); +*/ + if ( rank==0 ) printf("Write output \n"); DoubleArray BlockDist(nx,ny,nz); + FILE *WRITEID; + char * id; + id = new char [N]; int writerank; // Write output blocks with the same sub-domain size as origina @@ -169,7 +174,20 @@ int main(int argc, char **argv) fwrite(BlockDist.data(),8,nx*ny*nz,REFINEDIST); fclose(REFINEDIST); - if ( rank==0 ) printf("Write output \n"); + for (int k=0; k 0.f) + id[k*nx*ny + j*nx + i]=2; + else + id[k*nx*ny + j*nx + i]=0; + } + } + } + sprintf(LocalRankFilename,"RefineID.%05i",writerank); + WRITEID = fopen(LocalRankFilename,"wb"); + fwrite(id,1,nx*ny*nz,WRITEID); + fclose(WRITEID); writerank = 8*Dm.kproc*nprocx*nprocy + 4*Dm.jproc*nprocx + 2*Dm.iproc+1; for (int k=0; k 0.f) + id[k*nx*ny + j*nx + i]=2; + else + id[k*nx*ny + j*nx + i]=0; + } + } + } + sprintf(LocalRankFilename,"RefineID.%05i",writerank); + WRITEID = fopen(LocalRankFilename,"wb"); + fwrite(id,1,nx*ny*nz,WRITEID); + fclose(WRITEID); + + writerank = (2*Dm.kproc)*4*nprocx*nprocy + (2*Dm.jproc+1)*2*nprocx + 2*Dm.iproc+1; for (int k=0; k 0.f) + id[k*nx*ny + j*nx + i]=2; + else + id[k*nx*ny + j*nx + i]=0; + } + } + } + sprintf(LocalRankFilename,"RefineID.%05i",writerank); + WRITEID = fopen(LocalRankFilename,"wb"); + fwrite(id,1,nx*ny*nz,WRITEID); + fclose(WRITEID); + writerank = (2*Dm.kproc)*4*nprocx*nprocy + (2*Dm.jproc+1)*2*nprocx + 2*Dm.iproc; for (int k=0; k 0.f) + id[k*nx*ny + j*nx + i]=2; + else + id[k*nx*ny + j*nx + i]=0; + } + } + } + sprintf(LocalRankFilename,"RefineID.%05i",writerank); + WRITEID = fopen(LocalRankFilename,"wb"); + fwrite(id,1,nx*ny*nz,WRITEID); + fclose(WRITEID); + + writerank = (2*Dm.kproc+1)*4*nprocx*nprocy + (2*Dm.jproc)*2*nprocx + 2*Dm.iproc; for (int k=0; k 0.f) + id[k*nx*ny + j*nx + i]=2; + else + id[k*nx*ny + j*nx + i]=0; + } + } + } + sprintf(LocalRankFilename,"RefineID.%05i",writerank); + WRITEID = fopen(LocalRankFilename,"wb"); + fwrite(id,1,nx*ny*nz,WRITEID); + fclose(WRITEID); + writerank = (2*Dm.kproc+1)*4*nprocx*nprocy + (2*Dm.jproc)*2*nprocx + 2*Dm.iproc+1; for (int k=0; k 0.f) + id[k*nx*ny + j*nx + i]=2; + else + id[k*nx*ny + j*nx + i]=0; + } + } + } + sprintf(LocalRankFilename,"RefineID.%05i",writerank); + WRITEID = fopen(LocalRankFilename,"wb"); + fwrite(id,1,nx*ny*nz,WRITEID); + fclose(WRITEID); + writerank = (2*Dm.kproc+1)*4*nprocx*nprocy + (2*Dm.jproc+1)*2*nprocx + 2*Dm.iproc; for (int k=0; k 0.f) + id[k*nx*ny + j*nx + i]=2; + else + id[k*nx*ny + j*nx + i]=0; + } + } + } + sprintf(LocalRankFilename,"RefineID.%05i",writerank); + WRITEID = fopen(LocalRankFilename,"wb"); + fwrite(id,1,nx*ny*nz,WRITEID); + fclose(WRITEID); + writerank = (2*Dm.kproc+1)*4*nprocx*nprocy + (2*Dm.jproc+1)*2*nprocx + 2*Dm.iproc+1; for (int k=0; k 0.f) + id[k*nx*ny + j*nx + i]=2; + else + id[k*nx*ny + j*nx + i]=0; + } + } + } + sprintf(LocalRankFilename,"RefineID.%05i",writerank); + WRITEID = fopen(LocalRankFilename,"wb"); + fwrite(id,1,nx*ny*nz,WRITEID); + fclose(WRITEID); }