Printing force on an atom

Hello Users,

I’m attempting to print the force on an atom during the course of a pulling simulation. My current code is:

variable cfx equal fx[175]
variable cfy equal fy[175]
variable cfz equal fz[175]
variable total_force equal sqrt({cfx}*{cfx}+{cfy}*{cfy}+{cfz}*{cfz})

fix pull_force cterm print 5 “${total_force}” file cterm_force.txt

However, this is not returning an updated force. Any hints to the correct way to output a changing force?


John Doe,

Use ${VAR} when variable VAR is a constant, while v_VAR when variable
VAR is a changing variable.