Control edge atomic mobility

Dear lammps users,

I'm using lammps to simulate clay layers in the periodic npt box. In my
simulations, there are three kinds of layers(top, bottom and middle) in which the middle one
is smaller than the others in x and y  directions and while the top and bottom layers fully cover
the planar area of the box, the middle layer has discontinuity in the edges. 
I constrained all layers to only move in the z direction by:

fix          freeze layers setforce 0.0 0.0 NULL

Using this command, I observed the edge atoms of the middle layer have huge oscillations in the z
direction due to the discontinuity, so I used:

fix             holdEdge edgeAtoms aveforce NULL NULL 0.0

to control the atomic movements, but the problem is that this work gives
incorrect results for the box size in the z direction and causes less
contraction/expansion of the box in that direction. I welcome any idea.

Thanks,
Meysam

W/out aveforce, what is causing the oscillations?
What do you mean by “discontinuity”? How do
you know the oscillatoins are not physically correct?

Steve

Steve,

The middle layer has discontinuities in both x and y directions
b/c as I said this layer is smaller than the other layers and can
not fully cover the periodic box area in those directions.

As a result in the discontinuity edges, the particles have
large movements in the z direction. I need to control this
movements to have more exact result b/c these particles

can interact with the inter-layer components.

Meysam

Steve,
The middle layer has discontinuities in both x and y directions
b/c as I said this layer is smaller than the other layers and can
not fully cover the periodic box area in those directions.
As a result in the discontinuity edges, the particles have
large movements in the z direction. I need to control this
movements to have more exact result b/c these particles
can interact with the inter-layer components.

either those atoms move the way they should, or your model (potentials
or setup) is bad. it doesn't get any better by not allowing particles
to move where you don't want them to move. this all sounds more like
you are trying to become a competition to pixar and do a new animated
movie rather than some real science.

axel.