Grain boundary and Dislocation

Dear Rajib

I have limited understanding of crystals and crystal notation, so I
did not add many commands specifically for working with crystals in
moltemplate. It seems like LAMMPS has built-in commands to handle this
kind of simulation already which work well in most cases:

Check out this tutorial:

https://icme.hpc.msstate.edu/mediawiki/index.php/Grain_boundary_generation
http://lammps.sandia.gov/threads/msg33776.html

Alternatively, I suspect it is probably possible to do what you want
using moltemplate, with some effort. Moltemplate gives you a lot of
manual control. But unless you have a particularly complicated unit
cell (eg a protein crystal), or are planning to add molecules or other
complex objects into your simulation, I would use the build in LAMMPS
input script commands instead (see tutorial link above).

----- (extremely) simple geometry -----

If, for some reason, you want to use moltemplate to build a system
composed of two different crystals and if the boundary lies in the XY
plane (for example), if the lattice vectors for each crystal also
happen to lie in the XY plane, then this should be easy. In that
case, you could do it this way (extremely simple example):

Slab1 {
   cells = new UnitCell [20].(3.45, 0.00, 0.00)
                [20].(0.00, 3.45, 0.00)
                [10].(0.00, 0.00, 3.45)
}

Slab2 {
   cells = new UnitCell [10].(3.45, 0.00, 0.00)
                [20].(0.00, 3.45, 0.00)
                [20].(0.00, 0.00, 3.45)
}
slab1 = new Slab
slab2 = new Slab.rot(90,0,1,0)

write_once("Data Boundary") {
  -34.50 34.50 xlo xhi
  -34.50 34.50 ylo yhi
  -34.50 34.50 zlo zhi
}

waterbox-half.jpg