[lammps-users] help understanding Error when using fix addforce

Dear lammps users,

I am trying to use fix addforce to move a graphene layer in a block of polystyrene. I pull the graphene in one directoin and the polystyrene in the opposite direction.

I am getting the error "Cannot use variable energy with constant force in fix addforce"

I have read the comment on this error in the lammps manual many times but it does not point me in the right direction. I have tried modifying other commands in my script (below) that might effect energy but I continue to get the error. Perhaps I am missing the obvious but I could really use help at this point in understanding this error.

I have another question on this fix. Is it only implmented once in the script no matter how may steps are run? This would seem to make sense but it is not made clear in the manual.

Thanks,

Bill Evans
Postdoctoral Research Associate
Rensselaer Polytechnic Inst.
Nanotechnology Center MRC 275A
110 8th St.
Troy, NY 12180

I don't see how this error could be generated. It is
only relevant (and checked for) if you are use the "energy"
option of the fix addforce command. When I put
your 2 addforce lines into another script, I don't
see this error, nor any memory issues like an
uninitialized variable in fix addforce.

If a clean build doesn't get rid of this problem, I would
put print statements in fix_addforce.cpp before
the error is printed, to see why it is being generated.

I have another question on this fix. Is it only implmented once in the script no matter how may steps are run? This would seem to >make sense but it is not made clear in the manual.

I'm not sure what you are asking. This fix adds a force
every timestep during a run. If you use 2 addforce commands
in the script, then 2 sets of forces will be added every step.

Steve