relaxation and periodic boundary conditions

Dear all lammps' users,

I want to make a (100) diamond substrate relax, that is reach a configuration of minimized potential energy, before using it for subsequent deposition.
The C-C bonds are modelled using the REBO potential.
The boundary conditions are periodic in the x and y direction and non-periodic shrink-wrapped in the z direction.
By using the "minimize" command the substrate relaxes in the z direction but does not in the x and y direction, due to the periodic boundary conditions.
The lattice parameter of the obtained configuration is far from that expected for diamond. The obtained configuration is not physical !
I guess that it's due to the periodic conditions in x and y directions which prevent relaxation in that directions.
The "fix box/relax command" seems to be able to solve the problem but I am wondering if it possible with that command to make the relaxation possible in x and y
directions maintaining the periodic boudary conditions ?
Thanks !

dear laurent,

a few comments and questions on the general procedure.

first of all, you should be aware that all classical potentials
have limited transferability, i.e. they are parameterized to
reproduce certain properties at a certain ranges of temperature
and density states, but not for *all*. so you need to check
what your specific choice of potential is good for.

second, you need to decide whether you want to relax to
a 0K configuration (which means to use minimize) or finite
temperature (which means to do an equilibration with fix npt
and then pick a representative conformation after checking
the averages). please also keep in mind that if you set the
temperature with the velocity command, you will manipulate
the kinetic contribution to the stress tensor (i.e. pressure),
so it would affect the minimization, but since it will still go
to the minimum of the potential, you would get an inconsistent

finally, when relaxing a substrate, people generally pick an
equilibrated bulk configuration, so that the bulk lattice is already
set to the proper dimensions. you _cannot_ optimize those
dimensions with a small slab; the result will be bogus. for
some potentials, you may be better off to just build a regular
crystal using the experimental lattice constant for the desired
temperature. you then hold the 2 lowest layers fixed at bulk
lattice constant (as much as needed by the cutoff of the
potential) and then let the atoms above those move. you
can place a thermostat on the middle layer of atoms, which
has to be chose big enough to have all relaxation/expansion/reconstruction
happen as needed, yet do not thermalize the top few layers.
this "frozen/thermalized/nve" setup will mimic a bulk system
with a relaxed surface most closely. of course you need to
run an MD (or minimization) on this until you have a properly
relaxed/equilibrated setup.

at that point, you should save and stash away a restart/data file
of this setup, since this can be re-used for other future experiments.

as a final comment. it is *very* dangerous in the business of
simulations to guess and speculate. this will almost always
lead to wrong conclusions and bogus simulations. things work
or don't work for a reason, and without understanding this reason
(be it systematic or statistical, be it due to the nature of the
model or the choice of simulation settings) one should not
continue, since there may be severe problems with the simulation
that may surface later when already a lot of time has been
spent on running calculation.

hope this helps,

yes, the fix box/relax command should let
the box size (and thus lattice constant) in
the periodic directions x,y to relax during