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:
athomps 2015-12-11 23:15:38 +00:00
parent 762f48e528
commit 921bcfb12d
2 changed files with 30 additions and 28 deletions

View File

@ -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)
@ -643,8 +642,8 @@ void FixGCMC::pre_exchange()
int random_int_fraction =
static_cast<int>(random_equal->uniform()*ncycles) + 1;
if (random_int_fraction <= nmcmoves) {
if (random_equal->uniform() < 0.5) attempt_molecule_translation_full();
else attempt_molecule_rotation_full();
if (random_equal->uniform() < 0.5) attempt_molecule_translation_full();
else attempt_molecule_rotation_full();
} else {
if (random_equal->uniform() < 0.5) attempt_molecule_deletion_full();
else attempt_molecule_insertion_full();
@ -662,12 +661,12 @@ void FixGCMC::pre_exchange()
}
}
}
if (triclinic) domain->x2lamda(atom->nlocal);
if (triclinic) domain->x2lamda(atom->nlocal);
domain->pbc();
comm->exchange();
atom->nghost = 0;
comm->borders();
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
if (triclinic) domain->lamda2x(atom->nlocal+atom->nghost);
} else {

View File

@ -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;
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;
delta[0] = x[0] - boxlo[0];
delta[1] = x[1] - boxlo[1];
delta[2] = x[2] - boxlo[2];
x2lamda(x,lamda);
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 (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;
}
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;
}
/* ----------------------------------------------------------------------
@ -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;
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;
delta[0] = x[0] - boxlo[0];
delta[1] = x[1] - boxlo[1];
delta[2] = x[2] - boxlo[2];
x2lamda(x,lamda);
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 && (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;
}
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;
}
/* ----------------------------------------------------------------------