[lammps-users] fix addforce command

I am getting an “ERROR: Illegal fix addforce command” message, which implies I have a syntax error somewhere. Please help me find where I’m coding incorrectly.

Here’s a snippet of my code:
region gap block -5.0 5.0 -5.0 5.0 -10.0 10.0 units box

create_atoms 1 single 0 0 0 units box
group A type 1

fix A_field A addforce 0.0 0.0 0.01 region gap

I’ve tried naming my groups and regions differently to no avail. When I remove the “region gap” keywords, the code runs perfectly. I can provide more of my code as needed.

Thanks for any input,


The script below runs fine for me (bench/in.lj + your commands).
Are you running the current version of LAMMPS?