Output from setforce command

Hi,

I have been using the setforce command to input a force on a group with a single particle. I am trying to output the total forces being applied to that atom for each run of the system as well as the force output from my setforce command. Unfortunately the output from the fix (using f_setforce[1]) is different to the input value used in the setforce command. The manual says that the output from the fix is due to changes in the forces before the fix is applied but the difference between the output setforce in each run doesn’t match the original input value?
I get the right force value when I use the compute force on the atom but not with the setforce output.
Is there something else the setforce is calculating which I need to subtract?
I’ve made sure that is in eV/ang for my metal system before this but I was unsure if some other conversion is applied to it.
Any help wold be much appreciated.

Thanks in advance.

Hi,

I have been using the setforce command to input a force on a group with a
single particle. I am trying to output the total forces being applied to
that atom for each run of the system as well as the force output from my
setforce command. Unfortunately the output from the fix (using
f_setforce[1]) is different to the input value used in the setforce command.
The manual says that the output from the fix is due to changes in the forces
before the fix is applied but the difference between the output setforce in
each run doesn't match the original input value?

i think that you are misreading the documentation. it says:

This fix computes a global 3-vector of forces, which can be accessed
by various output commands.
This is the total force on the group of atoms before the forces on
individual atoms are changed by the fix.

so what you can access is the total force on the group _before_ it is
_overwritten_ by fix setforce.

I get the right force value when I use the compute force on the atom but
not with the setforce output.
Is there something else the setforce is calculating which I need to
subtract?

i don't understand your questions. perhaps you need to provide a small
test input to demonstrate what you believe is in conflict with the
documentation.

axel.

Hi Axel,

Thanks for looking at this. > I get the right force value when I use the compute force on the atom but

not with the setforce output.
Is there something else the setforce is calculating which I need to
subtract?

What I meant by this was that the difference between the output from setforce between runs didn't equate to the input force value that should be applied on the atom whereas the compute force on the same atom has the expected force value.
My main question is why the value from the compute force/atom would be different to the subtracted value of the setforce output between runs?

Thanks in advance.

Hi Axel,

Thanks for looking at this. > I get the right force value when I use the compute force on the atom but

not with the setforce output.
Is there something else the setforce is calculating which I need to
subtract?

What I meant by this was that the difference between the output from setforce between runs didn't equate to the input force value that should be applied on the atom whereas the compute force on the same atom has the expected force value.

without context, i.e. seeing an actual input this is impossible to answer.

My main question is why the value from the compute force/atom would be different to the subtracted value of the setforce output between runs?

as mentioned before, it is not clear to me what you are asking. please
provide a simple input example demonstrating where LAMMPS doesn't do
what the documentation says.

keep in mind, that - unlike you - it don't know what you are thinking
and i cannot see what you are doing, and from your questions and
statements it is not at all clear what your questions are in reference
to.
details matter A LOT in these things.

axel.