Merge pull request #1512 from mkanski/rotate_molecules

Extend support of "rotate" keyword to all styles of "create_atoms"
This commit is contained in:
Axel Kohlmeyer 2019-07-30 10:53:37 -04:00 committed by GitHub
commit 3eadfa15ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -242,9 +242,8 @@ write_dump all atom sinusoid.lammpstrj :pre
:c,image(JPG/sinusoid_small.jpg,JPG/sinusoid.jpg)
The {rotate} keyword can only be used with the {single} style and
when adding a single molecule. It allows to specify the orientation
at which the molecule is inserted. The axis of rotation is
The {rotate} keyword allows specification of the orientation
at which molecules are inserted. The axis of rotation is
determined by the rotation vector (Rx,Ry,Rz) that goes through the
insertion point. The specified {theta} determines the angle of
rotation around that axis. Note that the direction of rotation for

View File

@ -173,8 +173,6 @@ void CreateAtoms::command(int narg, char **arg)
} else error->all(FLERR,"Illegal create_atoms command");
iarg += 3;
} else if (strcmp(arg[iarg],"rotate") == 0) {
if (style != SINGLE)
error->all(FLERR,"Cannot use create_atoms rotate unless single style");
if (iarg+5 > narg) error->all(FLERR,"Illegal create_atoms command");
double thetaone;
double axisone[3];
@ -675,7 +673,9 @@ void CreateAtoms::add_random()
coord[1] >= sublo[1] && coord[1] < subhi[1] &&
coord[2] >= sublo[2] && coord[2] < subhi[2]) {
if (mode == ATOM) atom->avec->create_atom(ntype,xone);
else add_molecule(xone);
else if (quatone[0] == 0 && quatone[1] == 0 && quatone[2] == 0)
add_molecule(xone);
else add_molecule(xone, quatone);
}
}
@ -829,7 +829,9 @@ void CreateAtoms::add_lattice()
// add the atom or entire molecule to my list of atoms
if (mode == ATOM) atom->avec->create_atom(basistype[m],x);
else add_molecule(x);
else if (quatone[0] == 0 && quatone[1] == 0 && quatone[2] == 0)
add_molecule(x);
else add_molecule(x,quatone);
}
}
}