diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 2caf300804..9c58c4dadf 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -2171,11 +2171,12 @@ void FixRigid::readfile(int which, double *vec, double **array, int *inbody) only proc 0 writes list of global bodies to file ------------------------------------------------------------------------- */ -void FixRigid::write_restart_file() +void FixRigid::write_restart_file(char *file) { if (me) return; - const char *outfile = "tmp.restart.inertia"; + char outfile[128]; + sprintf(outfile,"%s.rigid",file); FILE *fp = fopen(outfile,"w"); if (fp == NULL) { char str[128]; @@ -2184,7 +2185,7 @@ void FixRigid::write_restart_file() } fprintf(fp,"fix rigid mass, COM, inertia tensor info for " - "%d bodies on timestep " TAGINT_FORMAT "\n\n", + "%d bodies on timestep " BIGINT_FORMAT "\n\n", nbody,update->ntimestep); fprintf(fp,"%d\n",nbody); diff --git a/src/RIGID/fix_rigid.h b/src/RIGID/fix_rigid.h index 097fe68481..6b86d677d8 100644 --- a/src/RIGID/fix_rigid.h +++ b/src/RIGID/fix_rigid.h @@ -36,7 +36,7 @@ class FixRigid : public Fix { virtual void final_integrate(); void initial_integrate_respa(int, int, int); void final_integrate_respa(int, int); - void write_restart_file(); + void write_restart_file(char *); virtual double compute_scalar(); virtual int modify_param(int, char **) {return 0;} diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 39a7e16c89..f1277fc4e1 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -2172,7 +2172,7 @@ void FixRigidSmall::readfile(int which, double **array, int *inbody) each proc contributes info for rigid bodies it owns ------------------------------------------------------------------------- */ -void FixRigidSmall::write_restart_file() +void FixRigidSmall::write_restart_file(char *file) { FILE *fp; @@ -2183,7 +2183,8 @@ void FixRigidSmall::write_restart_file() // proc 0 opens file and writes header if (me == 0) { - const char *outfile = "tmp.restart.inertia"; + char outfile[128]; + sprintf(outfile,"%s.rigid",file); fp = fopen(outfile,"w"); if (fp == NULL) { char str[128]; @@ -2192,7 +2193,7 @@ void FixRigidSmall::write_restart_file() } fprintf(fp,"fix rigid mass, COM, inertia tensor info for " - "%d bodies on timestep " TAGINT_FORMAT "\n\n", + "%d bodies on timestep " BIGINT_FORMAT "\n\n", nbody,update->ntimestep); fprintf(fp,"%d\n",nbody); } diff --git a/src/RIGID/fix_rigid_small.h b/src/RIGID/fix_rigid_small.h index 6fbbac5f99..e2761b0356 100644 --- a/src/RIGID/fix_rigid_small.h +++ b/src/RIGID/fix_rigid_small.h @@ -43,7 +43,7 @@ class FixRigidSmall : public Fix { virtual void final_integrate(); void initial_integrate_respa(int, int, int); void final_integrate_respa(int, int); - void write_restart_file(); + void write_restart_file(char *); void grow_arrays(int); void copy_arrays(int, int, int); diff --git a/src/fix.h b/src/fix.h index 281edc6216..002027e4fd 100644 --- a/src/fix.h +++ b/src/fix.h @@ -109,7 +109,7 @@ class Fix : protected Pointers { virtual void end_of_step() {} virtual void post_run() {} virtual void write_restart(FILE *) {} - virtual void write_restart_file() {} + virtual void write_restart_file(char *) {} virtual void restart(char *) {} virtual void grow_arrays(int) {} diff --git a/src/write_restart.cpp b/src/write_restart.cpp index 6e1dd883a2..cfdd65bb52 100644 --- a/src/write_restart.cpp +++ b/src/write_restart.cpp @@ -298,7 +298,7 @@ void WriteRestart::write(char *file) for (int ifix = 0; ifix < modify->nfix; ifix++) if (modify->fix[ifix]->restart_file) - modify->fix[ifix]->write_restart_file(); + modify->fix[ifix]->write_restart_file(file); } /* ----------------------------------------------------------------------