diff --git a/doc/src/create_atoms.txt b/doc/src/create_atoms.txt index d80e2d45f1..e673849793 100644 --- a/doc/src/create_atoms.txt +++ b/doc/src/create_atoms.txt @@ -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 to specify 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 diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index 52e4256fca..8869171115 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -176,8 +176,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]; @@ -678,7 +676,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); } } @@ -832,7 +832,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); } } }