/******************************************************** % % Written by: % -- % John L. Weatherwax 2006-05-29 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- */ #include #include #include "mpi.h" #include "global_grid.h" #include "sim_consts.h" #include "saveBoxes.h" /* Save individual particle boxes for use in visualization for debugging and other purposes */ void saveBoxes(int my_rank){ int pi; char filename[150]; FILE* Fp; /* create the filename... */ sprintf(filename,"ParSimResults/proc_box_%d.dat",my_rank); Fp=fopen(filename,"w"); if( Fp==NULL ){ fprintf(stderr,"trouble opening file!\n"); MPI_Abort(MPI_COMM_WORLD,1); } /* save box dimension */ fprintf(Fp,"%10f %10f\n",procInfo.bx,procInfo.by); /* save box center */ fprintf(Fp,"%10f %10f\n",procInfo.my_cx,procInfo.my_cy); /* save lower left corner */ fprintf(Fp,"%10f %10f\n",procInfo.my_lx,procInfo.my_ly); /* save upper right corner */ fprintf(Fp,"%10f %10f\n",procInfo.my_ux,procInfo.my_uy); fclose(Fp); }