After restarting the simulation, strange problemsoccur (Lost atoms)

Hi Steve
I looked the Pseudo-code in developer guide which explains how the Verlet:run () method works. My understanding is that MD force is computed by the methods from pair->compute () to kspace->compute (). While the fix setforce command will invoke the fix->post_force () method which deals with the external force. So if I set the force components in y,z direction as NULL by this command

fix still wall setforce 0.0 NULL NULL

It means that the force components in y,z direction should same as the MD force which is calculated by the methods from pair->compute () to kspace->compute ().
Therefore, for my first simulaiton (all walls are fixed) I should use
velocity bot_wall set NULL NULL NULL units box
velocity top_wall set NULL NULL NULL units box

fix still wall setforce 0.0 0.0 0.0

As the force in y,z should be 0.

In terms of my second case.
In my second simulation, I have one fixed layer and one flexible layer (the thermostat is applied to the flexible layer). I want to keep both layers moving with a constant velocity at x direction so the force in x direction should be 0 for both layers, and force in y z direction for fixed layer should be 0 as well .As for force in the y,z direction for the flexible layer, I want to keep it as which is decided by potential. So I use these command:

velocity fix_wall set NULL NULL NULL units box
velocity flexible_wall set NULL NULL NULL units box
fix 1 fix_wall setforce 0.0 0.0 0.0
fix 2 flexible_wall setforce 0.0 NULL NULL

Is my understanding right?

If not, could you please explain more?

The restart file does store the velocity. Does it also store the force?

Fan Li

------------------ Original ------------------

Your Q was why you are losing atoms. If in the 2nd simulation
you allow z forces to move atoms wherever they want,
you can lose atoms if they cross the z boundary. I assume
you still have

boundary p p f

in the 2nd simulation? Since you didn’t say otherwise.
The boundary settings are in the restart file.

You can use the change_box command
in the 2nd simulation to change the boundary conditions
if you want. If you don’t I’m guessing that’s why you lose atoms.

Restart files do not store forces, b/c they can be compute
from the atom coords.

Steve