Hi,
I’m using the fix move
approach to calculate the potential energy between two molecules at different separation distances. This works fine — I can extract the energy as the molecules are moved apart.
Now I would like to calculate the force between two atoms in a similar way.
But since fix move
does not calculate forces (when I add the forces on all the atoms in a molecule, I get zero force), I’m not sure how to proceed. I could think of creating multiple input files with different separation lengths between the molecules and then running a single step each time. Is there any easier approach than this? something inbuilt in LAMMPS?
Here’s a simplified version of my input script:
I’m doing this to see if there is anything wrong with my ‘python style’ force field.
Thank you for any advice.
units real #Angstroms, g/mol, etc.
atom_style full #Molecule + charge
timestep 1.0
#boundary p p p
boundary p p p
read_data conf.data
########
pair_style python 15.0
pair_coeff * * mypot.FivePoint 1 2 3
#########
bond_style zero nocoeff
angle_style zero nocoeff
dihedral_style none
improper_style none
bond_coeff 1 0.24812988161300004
bond_coeff 2 0.434260425799 #
angle_coeff 1 180.0
angle_coeff 2 180.0
group lonepair type 1
group nitrogen type 2
group centrepoint type 3
neigh_modify exclude molecule/intra all
#Reset the time step counter
reset_timestep 0
# fix move
group res2 molecule 2
fix fix1 res2 move linear 0.1 0 0
dump dump_2 all custom 1 dump_all.lammpstrj id type x y z vx vy vz fx fy fz
variable KineticEnergy equal ke # Kinetic energy
variable TotalEnergy equal etotal
variable PotentialEnergy equal epair #Call the intermolecular potential energy $PotentialEnergy
#variable Temperature equal temp #
fix 3 all ave/time 1 1 1 v_PotentialEnergy v_KineticEnergy v_TotalEnergy file ave.mydata.out format " %g"
run 100
write_restart ./restart_file1
undump dump_2