Addforce not work with variable

I did three simple tests( but I’m not sure if it is good enough to explain

what problem I have):
1)input the command:
fix 3 water addforce 0.0 0.0 -v_force region forcing
2)delete the command like this:
#fix 3 water addforce 0.0 0.0 -v_force region forcing.

The output energy,temperature,pressure,volume and even the coordinate of
atoms were totally the same. I think ‘-v_force’ seems not work. But if I

yes. it cannot work.

nothing in the the documentation says that you
can use an expression instead of a variable or number.
you have to define the force variable to be the
negative of what it currently is.

PEBCAC,
axel.

I see. I am really so sorry. I read the document again and again but even didn’t realize that. Thanks so… much.

I want to add a force which is computed from a specified constant pressure just like what I wrote in the input file. In ‘real’ unit, I’m not sure if I need to transfer the pressure unit from ‘atm’ to ‘kcal/(AAA)’?

I really appreciate your help.

Hang

I want to add a force which is computed from a specified constant pressure
just like what I wrote in the input file. In 'real' unit, I'm not sure if
I need to transfer the pressure unit from 'atm' to 'kcal/(A*A*A)'?

what you have to do is a bit complicated. i've never done
this before, but the steps are just straightforward.
a) compute the (average) total force on the area of interest
    that would correspond the desired pressure. that, of course,
    requires proper conversion of units to whatever you use.
b) divide that number be the number of atoms that
    you are using fix addforce on.
c) apply that force component using fix addforce.

axel.