git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5567 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -105,7 +105,6 @@ void Force::init()
|
|||||||
|
|
||||||
if (kspace) kspace->init(); // kspace must come before pair
|
if (kspace) kspace->init(); // kspace must come before pair
|
||||||
if (pair) pair->init(); // so g_ewald is defined
|
if (pair) pair->init(); // so g_ewald is defined
|
||||||
if (bond) bond->init();
|
|
||||||
if (angle) angle->init();
|
if (angle) angle->init();
|
||||||
if (dihedral) dihedral->init();
|
if (dihedral) dihedral->init();
|
||||||
if (improper) improper->init();
|
if (improper) improper->init();
|
||||||
|
|||||||
@ -208,6 +208,10 @@ void Neighbor::init()
|
|||||||
// cutneigh = force cutoff + skin if cutforce > 0, else cutneigh = 0
|
// cutneigh = force cutoff + skin if cutforce > 0, else cutneigh = 0
|
||||||
|
|
||||||
triggersq = 0.25*skin*skin;
|
triggersq = 0.25*skin*skin;
|
||||||
|
shrinkcheck = 0;
|
||||||
|
if (domain->box_change && (domain->xperiodic || domain->yperiodic ||
|
||||||
|
(dimension == 3 && domain->zperiodic)))
|
||||||
|
shrinkcheck = 1;
|
||||||
|
|
||||||
n = atom->ntypes;
|
n = atom->ntypes;
|
||||||
if (cutneighsq == NULL) {
|
if (cutneighsq == NULL) {
|
||||||
@ -996,11 +1000,23 @@ int Neighbor::decide()
|
|||||||
} else return 0;
|
} else return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ----------------------------------------------------------------------
|
||||||
|
if any atom moved trigger distance (half of neighbor skin) return 1
|
||||||
|
shrink trigger distance if periodic box dimension has decreased
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int Neighbor::check_distance()
|
int Neighbor::check_distance()
|
||||||
{
|
{
|
||||||
double delx,dely,delz,rsq;
|
double delx,dely,delz,rsq,deltasq;
|
||||||
|
|
||||||
|
if (shrinkcheck) {
|
||||||
|
double delta = 0.0;
|
||||||
|
if (domain->xperiodic) delta = MIN(delta,domain->xprd-xprdhold);
|
||||||
|
if (domain->yperiodic) delta = MIN(delta,domain->yprd-yprdhold);
|
||||||
|
if (domain->zperiodic) delta = MIN(delta,domain->zprd-zprdhold);
|
||||||
|
delta = 0.5*skin - delta;
|
||||||
|
deltasq = delta*delta;
|
||||||
|
} else deltasq = triggersq;
|
||||||
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
@ -1012,7 +1028,7 @@ int Neighbor::check_distance()
|
|||||||
dely = x[i][1] - xhold[i][1];
|
dely = x[i][1] - xhold[i][1];
|
||||||
delz = x[i][2] - xhold[i][2];
|
delz = x[i][2] - xhold[i][2];
|
||||||
rsq = delx*delx + dely*dely + delz*delz;
|
rsq = delx*delx + dely*dely + delz*delz;
|
||||||
if (rsq > triggersq) flag = 1;
|
if (rsq > deltasq) flag = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int flagall;
|
int flagall;
|
||||||
@ -1033,7 +1049,7 @@ void Neighbor::build()
|
|||||||
ago = 0;
|
ago = 0;
|
||||||
ncalls++;
|
ncalls++;
|
||||||
|
|
||||||
// store current atom positions if needed
|
// store current atom positions and box size if needed
|
||||||
|
|
||||||
if (dist_check) {
|
if (dist_check) {
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
@ -1049,6 +1065,9 @@ void Neighbor::build()
|
|||||||
xhold[i][1] = x[i][1];
|
xhold[i][1] = x[i][1];
|
||||||
xhold[i][2] = x[i][2];
|
xhold[i][2] = x[i][2];
|
||||||
}
|
}
|
||||||
|
xprdhold = domain->xprd;
|
||||||
|
yprdhold = domain->yprd;
|
||||||
|
zprdhold = domain->zprd;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if necessary, extend atom arrays in pairwise lists
|
// if necessary, extend atom arrays in pairwise lists
|
||||||
|
|||||||
@ -91,8 +91,10 @@ class Neighbor : protected Pointers {
|
|||||||
|
|
||||||
double triggersq; // trigger = build when atom moves this dist
|
double triggersq; // trigger = build when atom moves this dist
|
||||||
|
|
||||||
double **xhold; // atom coords at last neighbor build
|
double **xhold; // atom coords at last neighbor build
|
||||||
int maxhold; // size of xhold array
|
int maxhold; // size of xhold array
|
||||||
|
double xprdhold,yprdhold,zprdhold; // box size at last neighbor build
|
||||||
|
int shrinkcheck;
|
||||||
|
|
||||||
int nbinx,nbiny,nbinz; // # of global bins
|
int nbinx,nbiny,nbinz; // # of global bins
|
||||||
int *bins; // ptr to next atom in each bin
|
int *bins; // ptr to next atom in each bin
|
||||||
|
|||||||
Reference in New Issue
Block a user