git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@4216 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -40,6 +40,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
|
||||
{
|
||||
if (narg < 4) error->all("Illegal fix move command");
|
||||
|
||||
restart_global = 1;
|
||||
restart_peratom = 1;
|
||||
peratom_flag = 1;
|
||||
size_peratom_cols = 3;
|
||||
@ -795,6 +796,35 @@ double FixMove::memory_usage()
|
||||
return bytes;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
pack entire state of Fix into one write
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixMove::write_restart(FILE *fp)
|
||||
{
|
||||
int n = 0;
|
||||
double list[1];
|
||||
list[n++] = time_origin;
|
||||
|
||||
if (comm->me == 0) {
|
||||
int size = n * sizeof(double);
|
||||
fwrite(&size,sizeof(int),1,fp);
|
||||
fwrite(list,sizeof(double),n,fp);
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
use state info from restart file to restart the Fix
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void FixMove::restart(char *buf)
|
||||
{
|
||||
int n = 0;
|
||||
double *list = (double *) buf;
|
||||
|
||||
time_origin = static_cast<int> (list[n++]);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
allocate atom-based array
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user