# Position restraint out of bonds

**URL:** <https://gromacs.bioexcel.eu/t/position-restraint-out-of-bonds/8649>\
**Category:** User discussions\
**Tags:** forcefield, mdp-parameters\
**Created:** [March 19, 2024, 4:58pm UTC](https://gromacs.bioexcel.eu/t/position-restraint-out-of-bonds/8649 "2024-03-19T16:58:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![IshaChauhan](https://avatars.discourse-cdn.com/v4/letter/i/ac91a4/32.png) [@IshaChauhan](https://gromacs.bioexcel.eu/u/IshaChauhan)\
**Post date:** [March 19, 2024, 4:58pm UTC](https://gromacs.bioexcel.eu/t/position-restraint-out-of-bonds/8649/1 "2024-03-19T16:58:41Z")

</div>

GROMACS version: 2023.3  
GROMACS modification: NO

ERROR 1 [file posres.itp, line 45]:  
Atom index (41) in position\_restraints out of bounds (1-40).  
This probably means that you have inserted topology section  
“position\_restraints”  
in a part belonging to a different molecule than you intended to.  
In that case move the “position\_restraints” section to the right  
molecule.  
I am creating a slab out of a non bonded molecule using gencof this is the error i am receiving while running the minimisation run?

---

<div class="post-metadata">

**Author:** ![obZehn](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/obzehn/32/2629_2.png) [@obZehn](https://gromacs.bioexcel.eu/u/obZehn)\
**Post date:** [March 19, 2024, 10:43pm UTC](https://gromacs.bioexcel.eu/t/position-restraint-out-of-bonds/8649/2 "2024-03-19T22:43:40Z")

</div>

This is probably related to wrong position restraints definition or you are including the position restraint .itp file in the wrong line of the topology. What are you doing, precisely?

---

<div class="post-metadata">

**Author:** ![IshaChauhan](https://avatars.discourse-cdn.com/v4/letter/i/ac91a4/32.png) [@IshaChauhan](https://gromacs.bioexcel.eu/u/IshaChauhan)\
**Post date:** [March 20, 2024, 12:56pm UTC](https://gromacs.bioexcel.eu/t/position-restraint-out-of-bonds/8649/3 "2024-03-20T12:56:50Z")

</div>

I have included the position restraint in the itp file but i have made a slab out of a single atom, so somehow it is not recognizing the rest of position restraint

---

<div class="post-metadata">

**Author:** ![obZehn](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/obzehn/32/2629_2.png) [@obZehn](https://gromacs.bioexcel.eu/u/obZehn)\
**Post date:** [March 20, 2024, 1:55pm UTC](https://gromacs.bioexcel.eu/t/position-restraint-out-of-bonds/8649/4 "2024-03-20T13:55:04Z")

</div>

I don’t understand what you do mean with ‘a slab out of a single atom’. Did you use gmx genrestr for generating the restraints? What .gro file did you provide to genrestr?

Also, including the .itp in the topology is okay, but it has to be in the right part of it, otherwise you can get errors, as the output from your grompp is telling you “This probably means that you have inserted topology section  
“position\_restraints”  
in a part belonging to a different molecule than you intended to.”
