I am new to LAMMPS and have a few questions related to it - in particular, plotting a force vs strain curve of a CNT undergoing uniaxial (1) tension and (2) compression.
By making use of fix nvt and fix deform, I manage to simulate the CNT undergoing tension and compression. I have also checked the visualization via VMD and indeed the CNT does break or buckle depending on it being subjected to tensile or compressive force.
And according to the many literatures available, when the CNT breaks from tension or buckles from compression, the force at the boundary atoms should be 0. Likewise, the strain energy per atom (here strain energy is defined as the current energy - initial energy) should be 0 too. Based on that, I tried to gather the total forces at the boundary atoms. But I realise that:
(1) At time step = 0, the force isn’t 0. And at the time step when the CNT has fully buckled (for compression) the force at the boundary isn’t 0 too.
(2) I tried to use fix setforce 0 0 0 and it turns out that at every timestep, the force at the boundary atoms are always 0.
Following is my codes for compression. May I know what is wrong with my codes? I need to plot the force vs strain curve correctly and I hope that I am extracting the force information correctly.