git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@10628 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -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
|
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;
|
if (me) return;
|
||||||
|
|
||||||
const char *outfile = "tmp.restart.inertia";
|
char outfile[128];
|
||||||
|
sprintf(outfile,"%s.rigid",file);
|
||||||
FILE *fp = fopen(outfile,"w");
|
FILE *fp = fopen(outfile,"w");
|
||||||
if (fp == NULL) {
|
if (fp == NULL) {
|
||||||
char str[128];
|
char str[128];
|
||||||
@ -2184,7 +2185,7 @@ void FixRigid::write_restart_file()
|
|||||||
}
|
}
|
||||||
|
|
||||||
fprintf(fp,"fix rigid mass, COM, inertia tensor info for "
|
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);
|
nbody,update->ntimestep);
|
||||||
fprintf(fp,"%d\n",nbody);
|
fprintf(fp,"%d\n",nbody);
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class FixRigid : public Fix {
|
|||||||
virtual void final_integrate();
|
virtual void final_integrate();
|
||||||
void initial_integrate_respa(int, int, int);
|
void initial_integrate_respa(int, int, int);
|
||||||
void final_integrate_respa(int, int);
|
void final_integrate_respa(int, int);
|
||||||
void write_restart_file();
|
void write_restart_file(char *);
|
||||||
virtual double compute_scalar();
|
virtual double compute_scalar();
|
||||||
virtual int modify_param(int, char **) {return 0;}
|
virtual int modify_param(int, char **) {return 0;}
|
||||||
|
|
||||||
|
|||||||
@ -2172,7 +2172,7 @@ void FixRigidSmall::readfile(int which, double **array, int *inbody)
|
|||||||
each proc contributes info for rigid bodies it owns
|
each proc contributes info for rigid bodies it owns
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void FixRigidSmall::write_restart_file()
|
void FixRigidSmall::write_restart_file(char *file)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
@ -2183,7 +2183,8 @@ void FixRigidSmall::write_restart_file()
|
|||||||
// proc 0 opens file and writes header
|
// proc 0 opens file and writes header
|
||||||
|
|
||||||
if (me == 0) {
|
if (me == 0) {
|
||||||
const char *outfile = "tmp.restart.inertia";
|
char outfile[128];
|
||||||
|
sprintf(outfile,"%s.rigid",file);
|
||||||
fp = fopen(outfile,"w");
|
fp = fopen(outfile,"w");
|
||||||
if (fp == NULL) {
|
if (fp == NULL) {
|
||||||
char str[128];
|
char str[128];
|
||||||
@ -2192,7 +2193,7 @@ void FixRigidSmall::write_restart_file()
|
|||||||
}
|
}
|
||||||
|
|
||||||
fprintf(fp,"fix rigid mass, COM, inertia tensor info for "
|
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);
|
nbody,update->ntimestep);
|
||||||
fprintf(fp,"%d\n",nbody);
|
fprintf(fp,"%d\n",nbody);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,7 +43,7 @@ class FixRigidSmall : public Fix {
|
|||||||
virtual void final_integrate();
|
virtual void final_integrate();
|
||||||
void initial_integrate_respa(int, int, int);
|
void initial_integrate_respa(int, int, int);
|
||||||
void final_integrate_respa(int, int);
|
void final_integrate_respa(int, int);
|
||||||
void write_restart_file();
|
void write_restart_file(char *);
|
||||||
|
|
||||||
void grow_arrays(int);
|
void grow_arrays(int);
|
||||||
void copy_arrays(int, int, int);
|
void copy_arrays(int, int, int);
|
||||||
|
|||||||
@ -109,7 +109,7 @@ class Fix : protected Pointers {
|
|||||||
virtual void end_of_step() {}
|
virtual void end_of_step() {}
|
||||||
virtual void post_run() {}
|
virtual void post_run() {}
|
||||||
virtual void write_restart(FILE *) {}
|
virtual void write_restart(FILE *) {}
|
||||||
virtual void write_restart_file() {}
|
virtual void write_restart_file(char *) {}
|
||||||
virtual void restart(char *) {}
|
virtual void restart(char *) {}
|
||||||
|
|
||||||
virtual void grow_arrays(int) {}
|
virtual void grow_arrays(int) {}
|
||||||
|
|||||||
@ -298,7 +298,7 @@ void WriteRestart::write(char *file)
|
|||||||
|
|
||||||
for (int ifix = 0; ifix < modify->nfix; ifix++)
|
for (int ifix = 0; ifix < modify->nfix; ifix++)
|
||||||
if (modify->fix[ifix]->restart_file)
|
if (modify->fix[ifix]->restart_file)
|
||||||
modify->fix[ifix]->write_restart_file();
|
modify->fix[ifix]->write_restart_file(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user