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

This commit is contained in:
sjplimp
2010-03-25 16:24:30 +00:00
parent 3a6ea84a72
commit ff4be99542
26 changed files with 211 additions and 213 deletions

View File

@ -453,9 +453,9 @@ void FixNPT::initial_integrate(int vflag)
}
}
// remap simulation box and all owned atoms by 1/2 step
// remap simulation box by 1/2 step
remap(0);
remap();
// update x by full step for atoms in group
@ -467,10 +467,10 @@ void FixNPT::initial_integrate(int vflag)
}
}
// remap simulation box and all owned atoms by 1/2 step
// remap simulation box by 1/2 step
// redo KSpace coeffs since volume has changed
remap(0);
remap();
if (kspace_flag) force->kspace->setup();
}
@ -585,18 +585,8 @@ void FixNPT::final_integrate()
/* ---------------------------------------------------------------------- */
void FixNPT::initial_integrate_respa(int vflag, int ilevel, int flag)
void FixNPT::initial_integrate_respa(int vflag, int ilevel, int iloop)
{
// if flag = 1, then is 2nd call at outermost level from rRESPA
// perform 2nd half of box remap on own + ghost atoms and return
// redo KSpace coeffs since volume has changed
if (flag == 1) {
remap(1);
if (kspace_flag) force->kspace->setup();
return;
}
// set timesteps by level
double dtfm;
@ -673,9 +663,10 @@ void FixNPT::initial_integrate_respa(int vflag, int ilevel, int flag)
}
}
// remap simulation box and all owned atoms by 1/2 step
// remap simulation box by 1/2 step
remap(0);
remap();
remap2flag = 1;
} else {
@ -704,6 +695,10 @@ void FixNPT::initial_integrate_respa(int vflag, int ilevel, int flag)
}
// innermost level - also update x for atoms in group
// if remap2flag:
// this is 1st call at innermost level from rRESPA after 1st half remap
// perform 2nd half of box remap
// redo KSpace coeffs since volume has changed
if (ilevel == 0) {
for (int i = 0; i < nlocal; i++) {
@ -713,12 +708,17 @@ void FixNPT::initial_integrate_respa(int vflag, int ilevel, int flag)
x[i][2] += dtv * v[i][2];
}
}
if (remap2flag) {
remap();
if (kspace_flag) force->kspace->setup();
remap2flag = 0;
}
}
}
/* ---------------------------------------------------------------------- */
void FixNPT::final_integrate_respa(int ilevel)
void FixNPT::final_integrate_respa(int ilevel, int iloop)
{
double dtfm;
@ -798,26 +798,24 @@ void FixNPT::couple()
/* ----------------------------------------------------------------------
change box size
remap owned or owned+ghost atoms depending on flag
remap all atoms or fix group atoms depending on allremap flag
if rigid bodies exist, scale rigid body centers-of-mass
------------------------------------------------------------------------- */
void FixNPT::remap(int flag)
void FixNPT::remap()
{
int i,n;
int i;
double oldlo,oldhi,ctr;
double **x = atom->x;
int *mask = atom->mask;
if (flag) n = atom->nlocal + atom->nghost;
else n = atom->nlocal;
int nlocal = atom->nlocal;
// convert pertinent atoms and rigid bodies to lamda coords
if (allremap) domain->x2lamda(n);
if (allremap) domain->x2lamda(nlocal);
else {
for (i = 0; i < n; i++)
for (i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
domain->x2lamda(x[i],x[i]);
}
@ -843,9 +841,9 @@ void FixNPT::remap(int flag)
// convert pertinent atoms and rigid bodies back to box coords
if (allremap) domain->lamda2x(n);
if (allremap) domain->lamda2x(nlocal);
else {
for (i = 0; i < n; i++)
for (i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
domain->lamda2x(x[i],x[i]);
}