In this preset, illustrative of the surface overlayer problem, the red and the blue planes are given different equilibrium lattice constants. The red atoms, with lattice constant a, are fixed. The blue plane has equilibrium constant c and is modeled with harmonic nearest neighbor forces. The fixed red atoms provide a periodic potential attracting the blue atoms to lie above the red sites. The c/a ratio is at your disposal.
To illustrate the energetics, the c/a ratio is chosen to be 1.2. As a result, the lattices do not line up very well. If you run the program you will see the system accommodate by making distortions of the blue plane which better take advantage of the attractive interactions with the red atoms. After the adjustment, the blue atoms are much closer to their nearest red partner, but at a cost of strain in the blue lattice where the atom separations are no longer the equilibrium value.
To look at dislocation behavior we will make the c/a ratio equal to one so that the two layers match for the perfect crystal. The dislocation is then introduced as a particular distortion of this perfect arrangement.
When you are done with all of the presets, return to this one and interpret the relaxed configuration in terms of a "network of dislocations".