bug fix for create_atoms single remap and triclinic

This commit is contained in:
Steve Plimpton
2018-10-18 11:22:51 -06:00
parent 0ec9b9a71a
commit dcde84eb53

View File

@ -569,10 +569,20 @@ void CreateAtoms::add_single()
}
// if triclinic, convert to lamda coords (0-1)
// with remapflag set and periodic dims,
// resulting coord must satisfy 0.0 <= coord < 1.0
double lamda[3],*coord;
if (triclinic) {
domain->x2lamda(xone,lamda);
if (remapflag) {
if (domain->xperiodic && (lamda[0] < 0.0 || lamda[0] >= 1.0))
lamda[0] = 0.0;
if (domain->yperiodic && (lamda[1] < 0.0 || lamda[1] >= 1.0))
lamda[1] = 0.0;
if (domain->zperiodic && (lamda[2] < 0.0 || lamda[2] >= 1.0))
lamda[2] = 0.0;
}
coord = lamda;
} else coord = xone;