Dear AKai this is taken out from Google, it may be helful for you.
I am preparing my own program, which may be much complcated then ever one may think of it. But I can put my nose into it any way I want. What your are looking for Neumann BC. For a rectangular geometry, You have to apply two force/area couples acting on the edges in opposite directions to be sure you have established mechanical equilibriumwith respect to moments. (I use indirect boundary element method).
''I want to apply shear stress on a system with a dislocation in it. It
seems to be several ways to realize it. For simplification, I suppose the
system is isotropic elasticity. Thus I can turn the stress into the
equivalent strain, and then in turn to be the displacements of the outermost
atoms. By doing so, I can add such displacements in data file or use command
"displace_atoms".
Another way is to use command "fix/addforce" to do the same thing. Here I
get confuse that whether "fix/addforce" or "fix/setforce". I prefer the
former. Because I want to minimize the total energy of the whole system
under zero temperature, thus the shear stress just means there is some extra
force on some boundary atoms, and by minimization, the total force on those
atoms can be reduced.
On the other hand, if I use "fix/setforce", I cannot expect that those
atoms can get to their equilibrium positions because they always feel the
forces which are set by "fix/setforce".
Based on those consideration, I think even for the dynamical simulation
under finite temperature, I should use "fix/addforce" or "displace_atoms"
instead of "fix/setforce". Am I right? or is there better way to apply an
Miss Zhao, since the program is using zero temperature optimization procedure that means either enthalpy or energy of the system is employed in your program depending upon whether one keeps volume or the externally applied forces as constant?
For Neumann BC, you have the keep the applied shear forces at BC constant during the optimization (that means enthalpy supposed to be minimizing).
My guess is: To keep BC atoms displacement fixed is wrong. Fix add force at BC is right approach to the problem. Don't forget in theory of elasticity the boundary traction forces act as the intensity of the elastic Greens functions, which dictates the solution of the elastic displacement problem.
Freeze the top and bottom part of your model(In Lammps, you can do it by using setforce 0 0 0). Apply constant deformation rate(velocity) to those freeze atoms.
Calculate the your desired stress tensor depending on your loading condition. Iit should do the work.