# How to deal with external forces for every atom in GROMACS?

**URL:** <https://gromacs.bioexcel.eu/t/how-to-deal-with-external-forces-for-every-atom-in-gromacs/5814>\
**Category:** User discussions\
**Created:** [February 16, 2023, 3:17pm UTC](https://gromacs.bioexcel.eu/t/how-to-deal-with-external-forces-for-every-atom-in-gromacs/5814 "2023-02-16T15:17:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeonardoGiammorcaro](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@LeonardoGiammorcaro](https://gromacs.bioexcel.eu/u/LeonardoGiammorcaro)\
**Post date:** [February 16, 2023, 3:17pm UTC](https://gromacs.bioexcel.eu/t/how-to-deal-with-external-forces-for-every-atom-in-gromacs/5814/1 "2023-02-16T15:17:50Z")

</div>

GROMACS version:2022.4  
GROMACS modification: No

Hi,  
I’m trying to simulate a molecule in an external force field, for this reason I would like to know if is it possible to assign a different force (or acceleration) to every atom.  
I looked at “pull code” and “accelerate” option in mdp input file, but it seems to me that’s only possible to assign an acceleration to a group, and not to single atoms.  
How can I solve it?

Thanks to everyone

---

<div class="post-metadata">

**Author:** ![MichelePellegrino](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/michelepellegrino/32/628_2.png) [@MichelePellegrino](https://gromacs.bioexcel.eu/u/MichelePellegrino)\
**Post date:** [February 17, 2023, 9:17am UTC](https://gromacs.bioexcel.eu/t/how-to-deal-with-external-forces-for-every-atom-in-gromacs/5814/2 "2023-02-17T09:17:26Z")

</div>

Hi Leonardo,

Yes, both accelerate and pull work with groups. Therefore I think there’s no way to apply an external force on a single atom, unless that atom is defined as its own group.

I have been looking at the accelerate code recently and it doesn’t seem too complex, though. So maybe you could try to implement this feature yourself.
