From 3611cfdaf8c153750ce8cc45ac239c1145eb0a2b Mon Sep 17 00:00:00 2001 From: mkanski Date: Fri, 14 Jun 2019 19:58:31 +0200 Subject: [PATCH 1/2] All styles support setting molecules' orientation --- doc/src/create_atoms.txt | 5 ++--- src/create_atoms.cpp | 10 ++++++---- 2 files changed, 8 insertions(+), 7 deletions(-) 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); } } } From d201d6c2d11f8150d11e74ad58498fd1fc678d9e Mon Sep 17 00:00:00 2001 From: mkanski Date: Tue, 30 Jul 2019 10:18:53 +0200 Subject: [PATCH 2/2] fix grammar error --- doc/src/create_atoms.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/create_atoms.txt b/doc/src/create_atoms.txt index e673849793..2c97194cba 100644 --- a/doc/src/create_atoms.txt +++ b/doc/src/create_atoms.txt @@ -242,7 +242,7 @@ write_dump all atom sinusoid.lammpstrj :pre :c,image(JPG/sinusoid_small.jpg,JPG/sinusoid.jpg) -The {rotate} keyword allows to specify the orientation +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