replicating system

Dear All,
I need replicate and mirror my simulation box. As far as I know there is “replicate” command which let us duplicate our simulation box, but anyone knows if there is any option I can use to mirror the system during replication?
Thanks in advance

1 Like

The replicate command has no option for that. However the “displace_atoms move”
command allows you to define an atom-style variable for (e.g.) delx
that is applied to every atom. You could define a variable as
a function of each atoms x coord which does the mirroring operation
and apply it only to the right half of your replicated system, to effectively
flip their x coords. So that the right half of the replicated system
ends up being a mirror of the left half.


If you are willing to create a lammps “DATA” file to store the geometry and topology of the system, then you can use a tool that can modify or build LAMMPS data files, to perform the replicate and mirror operations. In particularly, moltemplate and topotools can replicate a system. I’m more familiar with moltemplate, so I’ll provide instructions how to do it using that tool. Moltemplate can rotate, scale, move and invert(mirror) object coordinates.

First, if you don’t yet have a data file, use the “write_data” command to generate one.

Then install “moltemplate” and use “” to convert the contents of that data file into a moltemplate object: -name “SmallSystem” YOUR_INPUT_SCRIPT DATA_FILE >

Then create a “” file containing this text (or something similar)

import “
sys1 = new SmallSystem.move(1.5,0,0)
sys2 = new SmallSystem.scale(-1,1,1).move(-1.5,0,0)
write_once(“Data Boundary”) {
-30.0 30.0 xlo xhi
-30.0 30.0 ylo yhi
-30.0 30.0 zlo zhi

— end of “” —

Then run moltemplate using: -vmd

If you don’t have VMD installed, then omit the “-vmd” argument

If I made a mistake above, hopefully it still gives you an idea what to do

The moltemplate manual explains how to use “” and “scale(-1,1,1)” (appendix B, and section 3.3, respectively)

Example 2:
Here’s another example. “” extracts two different molecules and replicates and rotates one of them. (picture before, after) Your case is different because you want to replicate the entire system.

Hope this helps


Dear Andrew,
Thanks a lot for your help. To use moltemplate for moving molecules in my box, I installed moltemplate first and followed the instructions using the example for converting a LAMMPS data file into .lt file. I finished the first step which was conversion of lammps data file into .lt files but when I wanted to do the second step to produce new data files for lammps, I got the following error and no lammps data file is created.
I used this command:

$ ./ v2.8.8 2018-10-02