Bicrystal simulation

   I'm trying to do an energy minimization on a a bicrystal lattice in a cubic simulation box. I have periodic boundary conditions along the Y and Z directions but free surfaces along the X-faces. I'd like to constrain a set of atoms near each X-face (chosen as being within a certain distance from that face). By constrain I mean they should move as one "block" (relative distances unchanged) and should not be part in the energy calculation. But the other atoms should interact with the atoms in the blocks in the usual defined manner.

    One way I could think of doing this was defining these "blocks" as a separate group of atoms and their interaction as a set of steep energy wells at the desired distances. I was wondering whether there is a better way to do this in LAMMPS.


The fix aveforce command does something like this,
and can be used with energy minimization.