I want to run a simulation: a slab of liquid water confined between two plate,and want to control the pressure on the plane in a constant value.one of the plane is fixed and the other can move freely.
I use the command :"compute group/group" to calculate the force between the liquid water and the moveable plane and obain the force in normal direction ,say, c_1[3]. I use "nve/noforce" to move the moveable plane to get a fittable position of it. I change the "nve/noforce" programe, and add a parameter which is expected to be equal to c_1[3]. But I compile the program successfully but fail to run the input file.
Is there anyone can tell me how to extract the c_1[3] and use it in my renewed nve/noforce command?
Any help will be welcome and appreciated.
eg. compute 1 moveable_plane group/group water
variable xx equal c_1[3]
fix 1 moveable_plane nve/noforce $xx
I want to run a simulation: a slab of liquid water confined between two plate,and want to control the pressure on the plane in a constant value.one of the plane is fixed and the other can move freely.
I use the command :"compute group/group" to calculate the force between the liquid water and the moveable plane and obain the force in normal direction ,say, c_1[3]. I use "nve/noforce" to move the moveable plane to get a fittable position of it. I change the "nve/noforce" programe, and add a parameter which is expected to be equal to c_1[3]. But I compile the program successfully but fail to run the input file.
Is there anyone can tell me how to extract the c_1[3] and use it in my renewed nve/noforce command?
Any help will be welcome and appreciated.
why so complicated? why can't you use fix aveforce like everybody else?
eg. compute 1 moveable_plane group/group water
variable xx equal c_1[3]
fix 1 moveable_plane nve/noforce $xx
without looking at the docs for fix nve/noforce there are two problems here:
1) with expansion, the variable will be expanded immediately, which
is not what you want
2\) expansion of variable with more than one character requires the
use of curly braces.
please see the documentation for variables for more details to avoid
these issues in the future, but as i mentioned above, there is no need
to go through these hoops at all (besides, i fail to see how this can
work correctly in the first place).