bug fix for create_atoms single remap and triclinic
This commit is contained in:
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user