void save_file(np,xp,yp,up,vp,rax,ray,tp,dp,mp,fname,time,fn)
int np,time,fn;
double *xp,*yp,*up,*vp,*rax,*ray,*tp,*dp;
int *mp;
char fname[];
{
FILE *fp;
int i,k;
char fname_full[200];
sprintf(fname_full,"%s_nor.%05d",fname,fn);
fp=fopen(fname_full,"wt");
if(fp==NULL) {printf("\n Cannot create file1 %s \n",fname_full);exit(1);}
fprintf(fp,"%d\n",np);
for(k=0;k<np;k++)
fprintf(fp,"%lf %lf %7.6e %7.6e %lf %lf %d\n",xp[k],yp[k],up[k],vp[k],tp[k],dp[k],mp[k]);
if(fclose(fp)==EOF)
{printf("\n Error in closing file %s \n",fname_full);exit(1);}
}
void save_file(np,xp,yp,up,vp,rax,ray,tp,dp,mp,fname,time,fn)
int np,time,fn;
double *xp,*yp,*up,*vp,*rax,*ray,*tp,*dp;
int *mp;
char fname[];
{
FILE *fp;
int i,k;
char fname_full[200];
sprintf(fname_full,"%s_nor.%05d",fname,fn);
fp=fopen(fname_full,"wt");
if(fp==NULL) {printf("\n Cannot create file1 %s \n",fname_full);exit(1);}
fprintf(fp,"%d\n",np);
for(k=0;k<np;k++)
fprintf(fp,"%lf %lf %7.6e %7.6e %lf %lf %d\n",xp[k],yp[k],up[k],vp[k],tp[k],dp[k],mp[k]);
if(fclose(fp)==EOF)
{printf("\n Error in closing file %s \n",fname_full);exit(1);}
}
To copy to clipboard, switch view to plain text mode
Bookmarks