How to add force to specified region instead of atoms

Dear Sir or Madam,

    In Lammps, How to add an extra force beside the Lenard-Jones potential to the specified region ? What i mean is the atoms are moving randomly; the atoms moving in this region will have this extra force; and when atoms escape from this region, this force is gone. Namely the extra force only works in the region.

    When i tried command "fix addforce", the output shows that when atoms escape from that region, they still have this force. This could not satisfy my requirement.

    Thanks a lot! Have a good day!

Eric

Dear Sir or Madam,

In Lammps, How to add an extra force beside the Lenard-Jones potential to the specified region ? What i mean is the atoms are moving randomly; the atoms moving in this region will have this extra force; and when atoms escape from this region, this force is gone. Namely the extra force only works in the region.

that feature is implemented as the region option in fix addforce.

When i tried command "fix addforce", the output shows that when atoms escape from that region, they still have this force. This could not satisfy my requirement.

please provide an input that *proves* that the region option of fix
addforce doesn't work.
are you sure it is not because of mixing up lattice units with box units?

axel.

Dear Sir or Madam,

In Lammps, How to add an extra force beside the Lenard-Jones potential to the specified region ? What i mean is the atoms are moving randomly; the atoms moving in this region will have this extra force; and when atoms escape from this region, this force is gone. Namely the extra force only works in the region.

When i tried command "fix addforce", the output shows that when atoms escape from that region, they still have this force. This could not satisfy my requirement.

i don't think that fix addforce is your problem.

if you run your simulation without it, you get
the same, completely messed up trajectory.
that means, that your entire initial configuration
and model is unphysical. you need to correct
that first and then we can talk about fix addforce
(which i am certain is working correctly).

axel.