git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8312 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -98,12 +98,6 @@ Domain::~Domain()
|
||||
|
||||
void Domain::init()
|
||||
{
|
||||
// check for too small a periodic box for molecular system
|
||||
|
||||
if (atom->molecular && box_too_small())
|
||||
error->all(FLERR,"Bond/angle/dihedral extent must be < "
|
||||
"half of periodic box dimension");
|
||||
|
||||
// set box_change if box dimensions/shape ever changes
|
||||
// due to shrink-wrapping, fixes that change volume (npt, vol/rescale, etc)
|
||||
|
||||
@ -525,16 +519,16 @@ void Domain::pbc()
|
||||
/* ----------------------------------------------------------------------
|
||||
check that no pair of atoms in a bonded interaction
|
||||
are further apart than half a periodic box length
|
||||
return 1 if any pair is, else 0
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
int Domain::box_too_small()
|
||||
void Domain::box_too_small_check()
|
||||
{
|
||||
int i,j,k;
|
||||
|
||||
// only need to check if some dimension is periodic
|
||||
// only need to check if system is molecluar and some dimension is periodic
|
||||
|
||||
if (!xperiodic && !yperiodic && (dimension == 2 || !zperiodic)) return 0;
|
||||
if (!atom->molecular) return;
|
||||
if (!xperiodic && !yperiodic && (dimension == 2 || !zperiodic)) return;
|
||||
|
||||
// maxbondall = longest current bond length
|
||||
// NOTE: if box is tiny (less than 2 * bond-length),
|
||||
@ -552,7 +546,7 @@ int Domain::box_too_small()
|
||||
for (i = 0; i < nlocal; i++)
|
||||
for (j = 0; j < num_bond[i]; j++) {
|
||||
k = atom->map(bond_atom[i][j]);
|
||||
if (k < 0) error->one(FLERR,"Bond atom missing in box size check");
|
||||
if (k == -1) error->one(FLERR,"Bond atom missing in box size check");
|
||||
delx = x[i][0] - x[k][0];
|
||||
dely = x[i][1] - x[k][1];
|
||||
delz = x[i][2] - x[k][2];
|
||||
@ -576,10 +570,14 @@ int Domain::box_too_small()
|
||||
// else when use minimg() in bond/angle/dihdral compute,
|
||||
// could calculate incorrect distance between 2 atoms
|
||||
|
||||
if (xperiodic && maxdelta > xprd_half) return 1;
|
||||
if (yperiodic && maxdelta > yprd_half) return 1;
|
||||
if (dimension == 3 && zperiodic && maxdelta > zprd_half) return 1;
|
||||
return 0;
|
||||
int flag = 0;
|
||||
if (xperiodic && maxdelta > xprd_half) flag = 1;
|
||||
if (yperiodic && maxdelta > yprd_half) flag = 1;
|
||||
if (dimension == 3 && zperiodic && maxdelta > zprd_half) flag = 1;
|
||||
|
||||
if (flag)
|
||||
error->all(FLERR,
|
||||
"Bond/angle/dihedral extent > half of periodic box length");
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -93,7 +93,7 @@ class Domain : protected Pointers {
|
||||
virtual void set_local_box();
|
||||
virtual void reset_box();
|
||||
virtual void pbc();
|
||||
int box_too_small();
|
||||
void box_too_small_check();
|
||||
int minimum_image_check(double, double, double);
|
||||
void minimum_image(double &, double &, double &);
|
||||
void minimum_image(double *);
|
||||
|
||||
@ -234,6 +234,7 @@ void Min::setup()
|
||||
if (atom->sortfreq > 0) atom->sort();
|
||||
comm->borders();
|
||||
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
|
||||
domain->box_too_small_check();
|
||||
neighbor->build();
|
||||
neighbor->ncalls = 0;
|
||||
|
||||
@ -319,6 +320,7 @@ void Min::setup_minimal(int flag)
|
||||
comm->exchange();
|
||||
comm->borders();
|
||||
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
|
||||
domain->box_too_small_check();
|
||||
neighbor->build();
|
||||
neighbor->ncalls = 0;
|
||||
}
|
||||
@ -432,6 +434,8 @@ void Min::cleanup()
|
||||
// delete fix at end of run, so its atom arrays won't persist
|
||||
|
||||
modify->delete_fix("MINIMIZE");
|
||||
|
||||
domain->box_too_small_check();
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
@ -363,6 +363,7 @@ void Respa::setup()
|
||||
if (atom->sortfreq > 0) atom->sort();
|
||||
comm->borders();
|
||||
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
|
||||
domain->box_too_small_check();
|
||||
neighbor->build();
|
||||
neighbor->ncalls = 0;
|
||||
|
||||
@ -427,6 +428,7 @@ void Respa::setup_minimal(int flag)
|
||||
comm->exchange();
|
||||
comm->borders();
|
||||
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
|
||||
domain->box_too_small_check();
|
||||
neighbor->build();
|
||||
neighbor->ncalls = 0;
|
||||
}
|
||||
@ -501,6 +503,7 @@ void Respa::cleanup()
|
||||
{
|
||||
modify->post_run();
|
||||
modify->delete_fix("RESPA");
|
||||
domain->box_too_small_check();
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
@ -111,6 +111,7 @@ void Verlet::setup()
|
||||
if (atom->sortfreq > 0) atom->sort();
|
||||
comm->borders();
|
||||
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
|
||||
domain->box_too_small_check();
|
||||
neighbor->build();
|
||||
neighbor->ncalls = 0;
|
||||
|
||||
@ -167,6 +168,7 @@ void Verlet::setup_minimal(int flag)
|
||||
comm->exchange();
|
||||
comm->borders();
|
||||
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
|
||||
domain->box_too_small_check();
|
||||
neighbor->build();
|
||||
neighbor->ncalls = 0;
|
||||
}
|
||||
@ -309,6 +311,7 @@ void Verlet::run(int n)
|
||||
void Verlet::cleanup()
|
||||
{
|
||||
modify->post_run();
|
||||
domain->box_too_small_check();
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user