[lammps-users] setforce in in.crack


I am using LAMMPS since a few days. I am interested to learn how crack simulations are setup using LAMMPS.
I have followed the example file given in the example directory. I want to know the use of setforce in this example.

I learnt from the manual setforce command is used for setting the force components on each atom (in the group)
to specified values or NULL (doesn’t alter the force)

In this example, setforce is used to make y and z components of force zero and retaining x-component.

fix 1 boundary setforce NULL 0.0 0.0

I thought x- and z- components were to be made zero retaining the y- components (since crack is propagating in
the x- direction and force is applied -using upper velocity- along y- component)

Can anyone explain this to me why setforce is set like this and how is this helping the crack propagation.


In the 2d example, an upward y velocity is give to atoms in a top layer,
and a 0 y velocity to atoms in a bottom layer. We want those
atoms to move continously, with a constant velocity.

So the setforce command does not constrain x motion (NULL), but
turns off forces in y, so that the velocities continue unabated.