[lammps-users] Regarding grain boundary generation in hcp crystal

Dear all
I am trying to generate a grain boundary in hcp crystal. In the result I am getting some defects (other atoms) near the outer surfaces of the box. kindly help me in resolving that problem.
First of all I converted 4 miller indices of hcp to 3 miller indices, then I used the required rotation matrix to rotate the crystal with specified angle.

After applying rotation irrational vector components are obtained in the orient command option, which is giving error when used.
so please help me in fixing the simulation box size and also how to use orient command in the correct way so as to make a perfect grain boundary.

The lattice command explains precisely how it generates atom coordinates based on rotation and other arguments. I suggest you study that doc page, try some simple examples, and see if you can figure out what does not match up with what you expect.