[lammps-users] outputting force from a frozen atom?

Hello all,

This is similar to a question that was asked a few days ago, but is
there a way to freeze an atom (setforce group 0.0 0.0 0.0) and be able
to output the force _before_ the setforce fix clears it to zero? For
doing atomistic mechanical testing, this would be necessary for
determining how much force is needed to hold a molecule in place as it
is moved through a system over time. (run x every 1000
displace_atoms ...) Any ideas on how to accomplish this?


Dusty Majure

The fix setforce command stores the force on the
entire group of atoms before it changes it. This
can be accessed by thermo output or a variable, etc.
So if your group was the single atom you wanted,
it would be what you ask.



Thanks for pointing me in the right direction, but I'm still having
problems getting it to work after reading the documentation. Below is a
snippet of my input. I am wanting thermo to output the total force (or
at least all the forces on the atoms) of the groups one_ring and
outer_rings in the Z-direction. Could you tell me where I went wrong?
All I get from the thermo output for my variables are 0.0's.

# Get the total z-force for both groups
variable z1 equal fcm(one_ring,z)
variable z2 equal fcm(outer_rings,z)

# Assign fix to hold these rings in place on z-axis
fix 1 one_ring setforce NULL NULL 0.0
fix 2 outer_rings setforce 0.0 0.0 0.0

# Change thermo to output my variables
thermo 4000
thermo_style custom step cpu ke pe etotal v_z1 v_z2

# Run simulation
run 1200000 every 4000 displace_atoms center move 0.000 0.000 0.05
units box

Thank you,


It's the fix that stores the force before it was changed. So you
want somthing like:

thermo_style custom step cpu ke pe etotal f_1[3] f_2[3]

for z-component of force.