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

This commit is contained in:
sjplimp
2014-09-09 15:01:58 +00:00
parent e898a2c91b
commit ac246386d0
2 changed files with 21 additions and 17 deletions

View File

@ -242,11 +242,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) :
atom->add_callback(0);
atom->add_callback(1);
maxatom = atom->nmax;
if (displaceflag) memory->create(displace,maxatom,3,"move:displace");
else displace = NULL;
if (velocityflag) memory->create(velocity,maxatom,3,"move:velocity");
else velocity = NULL;
displace = velocity = NULL;
// xoriginal = initial unwrapped positions of atoms
@ -368,6 +364,14 @@ void FixMove::init()
if (vzvarstr && vzvarstyle == ATOM) velocityflag = 1;
}
maxatom = atom->nmax;
memory->destroy(displace);
memory->destroy(velocity);
if (displaceflag) memory->create(displace,maxatom,3,"move:displace");
else displace = NULL;
if (velocityflag) memory->create(velocity,maxatom,3,"move:velocity");
else velocity = NULL;
if (strstr(update->integrate_style,"respa"))
nlevels_respa = ((Respa *) update->integrate)->nlevels;
}