HOW to set C-C bond length to remain constant in simulation

Dear all,
I am working on graphene/CNT stretching and a highly cited article mentioned that 2 modes determined the deformation process:
(1) angle bending while bond length is constant
(2) bond stretching while angle is constant.

I want to reappear these process,so I plan to apply [fix restrain]command. [fix restrain] command uses “atom1,atom2 = IDs of 2 atoms in bond”. Can I use “fix 1 all restrain bond 1 2 …” to set all bonds constant?

Besides,Should “bond_style harmonic” and “fix_modify 1 energy yes” commands be used together?

Any help will be greatly appreciated. Thanks
Best regards,

units 		   metal
dimension  	   3
boundary 	   s  p	 s
atom_style	   atomic
neighbor       2.0 nsq      
neigh_modify every 1 delay 0 check yes


pair_style airebo  3.0 1 1		 
pair_coeff * * CH.airebo   C  
###//////////set C-C bond length//////////
bond_style harmonic 
fix 1 all restrain bond  1  2  2000.0  2000.0  1.42
fix_modify 1 energy yes

reset_timestep	  0
timestep          0.001
min_style         cg
minimize   1.0e-30 1.0e-30 10000 10000

No. A restraint is just an additional force. This is the same as increasing the force constant in the bond_coeff command or the corresponding setting in the parameter file for manybody potentials.

Keeping a bond length really constant is a non-trivial operation in MD (it is much easier in Monte Carlo simulations). In LAMMPS such constraints can be applied with fix shake (or fix rattle), but those cannot handle connected clusters, so it won’t work for graphene sheets or nanotubes.

You input example uses AIREBO and there are no explicit bonds with AIREBO. Using explicit bonds in your topology and a bond style would be a mistake and causing errors. Also using bonds is incompatible with atom style atomic. Also fix restrain does not require an explicit bond to be defined.

The purpose of fix_modify energy yes is explained in the manual. It has nothing to do with a bond style.

Overall, your input and questions indicate that you need to spend much more time reading the documentation and learning about different kinds of force fields and MD methodology.

I am really appreciate your help. and I will read the documentation in more detail.