forked from lijiext/lammps
Allowed non-full_energy with triclinic
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14359 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
762f48e528
commit
921bcfb12d
|
@ -392,8 +392,7 @@ void FixGCMC::init()
|
|||
(force->pair == NULL) ||
|
||||
(force->pair->single_enable == 0) ||
|
||||
(force->pair_match("hybrid",0)) ||
|
||||
(force->pair_match("eam",0)) ||
|
||||
(triclinic == 1)
|
||||
(force->pair_match("eam",0))
|
||||
) {
|
||||
full_flag = true;
|
||||
if (comm->me == 0)
|
||||
|
|
|
@ -599,28 +599,30 @@ void Domain::pbc()
|
|||
int Domain::inside(double* x)
|
||||
{
|
||||
double *lo,*hi;
|
||||
double delta[3];
|
||||
double lamda[3];
|
||||
|
||||
if (triclinic == 0) {
|
||||
lo = boxlo;
|
||||
hi = boxhi;
|
||||
} else {
|
||||
lo = boxlo_lamda;
|
||||
hi = boxhi_lamda;
|
||||
|
||||
delta[0] = x[0] - boxlo[0];
|
||||
delta[1] = x[1] - boxlo[1];
|
||||
delta[2] = x[2] - boxlo[2];
|
||||
|
||||
x[0] = h_inv[0]*delta[0] + h_inv[5]*delta[1] + h_inv[4]*delta[2];
|
||||
x[1] = h_inv[1]*delta[1] + h_inv[3]*delta[2];
|
||||
x[2] = h_inv[2]*delta[2];
|
||||
}
|
||||
|
||||
if (x[0] < lo[0] || x[0] >= hi[0] ||
|
||||
x[1] < lo[1] || x[1] >= hi[1] ||
|
||||
x[2] < lo[2] || x[2] >= hi[2]) return 0;
|
||||
else return 1;
|
||||
|
||||
} else {
|
||||
lo = boxlo_lamda;
|
||||
hi = boxhi_lamda;
|
||||
|
||||
x2lamda(x,lamda);
|
||||
|
||||
if (lamda[0] < lo[0] || lamda[0] >= hi[0] ||
|
||||
lamda[1] < lo[1] || lamda[1] >= hi[1] ||
|
||||
lamda[2] < lo[2] || lamda[2] >= hi[2]) return 0;
|
||||
else return 1;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
@ -631,30 +633,31 @@ int Domain::inside(double* x)
|
|||
int Domain::inside_nonperiodic(double* x)
|
||||
{
|
||||
double *lo,*hi;
|
||||
double delta[3];
|
||||
double lamda[3];
|
||||
|
||||
if (xperiodic && yperiodic && zperiodic) return 1;
|
||||
|
||||
if (triclinic == 0) {
|
||||
lo = boxlo;
|
||||
hi = boxhi;
|
||||
} else {
|
||||
lo = boxlo_lamda;
|
||||
hi = boxhi_lamda;
|
||||
|
||||
delta[0] = x[0] - boxlo[0];
|
||||
delta[1] = x[1] - boxlo[1];
|
||||
delta[2] = x[2] - boxlo[2];
|
||||
|
||||
x[0] = h_inv[0]*delta[0] + h_inv[5]*delta[1] + h_inv[4]*delta[2];
|
||||
x[1] = h_inv[1]*delta[1] + h_inv[3]*delta[2];
|
||||
x[2] = h_inv[2]*delta[2];
|
||||
}
|
||||
|
||||
if (!xperiodic && (x[0] < lo[0] || x[0] >= hi[0])) return 0;
|
||||
if (!yperiodic && (x[1] < lo[1] || x[1] >= hi[1])) return 0;
|
||||
if (!zperiodic && (x[2] < lo[2] || x[2] >= hi[2])) return 0;
|
||||
return 1;
|
||||
|
||||
} else {
|
||||
lo = boxlo_lamda;
|
||||
hi = boxhi_lamda;
|
||||
|
||||
x2lamda(x,lamda);
|
||||
|
||||
if (!xperiodic && (lamda[0] < lo[0] || lamda[0] >= hi[0])) return 0;
|
||||
if (!yperiodic && (lamda[1] < lo[1] || lamda[1] >= hi[1])) return 0;
|
||||
if (!zperiodic && (lamda[2] < lo[2] || lamda[2] >= hi[2])) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue