git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@4216 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2010-06-01 16:17:48 +00:00
parent f9c9763bfd
commit 3ad6f1e88a
3 changed files with 34 additions and 0 deletions

View File

@ -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
------------------------------------------------------------------------- */