# Generating posre.itp for Silica Nanoparticle

**URL:** <https://gromacs.bioexcel.eu/t/generating-posre-itp-for-silica-nanoparticle/7961>\
**Category:** User discussions\
**Tags:** simulation-setup\
**Created:** [January 2, 2024, 8:19pm UTC](https://gromacs.bioexcel.eu/t/generating-posre-itp-for-silica-nanoparticle/7961 "2024-01-02T20:19:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![keinerfan](https://avatars.discourse-cdn.com/v4/letter/k/e495f1/32.png) [@keinerfan](https://gromacs.bioexcel.eu/u/keinerfan)\
**Post date:** [January 2, 2024, 8:19pm UTC](https://gromacs.bioexcel.eu/t/generating-posre-itp-for-silica-nanoparticle/7961/1 "2024-01-02T20:19:48Z")

</div>

GROMACS version:  
GROMACS modification: Yes/No  
Here post your question  
In my simulation setup involving a silica nanoparticle (`NMB`), I encountered issues at nvt equilibrium due to the absence of a `posre.itp` file, resulting in the following errors during simulation setup:  
ERROR 314 [file NMB.itp, line 21]: No default Position Rest. types  
ERROR 315 [file posre.itp, line 6]: Atom index (2) in position\_restraints out of bounds (1-1).  
Facing this challenge, I sought to generate a `posre.itp` file for my silica particles. To do so, I employed the `make_ndx` and `genrest` commands, following commonly suggested procedures. However, despite my efforts, this approach did not yield the desired outcome, and the issues persisted.  
Can anyone help me with this errors?

---

<div class="post-metadata">

**Author:** ![milosz.wieczor](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@milosz.wieczor](https://gromacs.bioexcel.eu/u/milosz.wieczor)\
**Post date:** [January 3, 2024, 3:15pm UTC](https://gromacs.bioexcel.eu/t/generating-posre-itp-for-silica-nanoparticle/7961/2 "2024-01-03T15:15:21Z")

</div>

Hi, it seems that your original `posre.itp` was malformed or misplaced for whatever reason - the error suggests it was included in a single-atom `[moleculetype]` so that atom index 2 is out of bound. Remember that a position restraint section will belong to a given molecule based on separation by `[moleculetype]` headers, and the indices will be matched against ones defined in its molecule’s `[atoms]` section.

In principle, there’s nothing complicated in creating a (conditional) `[position_restraint]` entry by hand and wrapping it in a conditional `#ifdef POSRES` and `#endif`commands, just follow the format from any correctly formed topology.

That being said, there’s both a [gromacs tool](https://manual.gromacs.org/documentation/5.1.1/onlinehelp/gmx-genrestr.html) and a [gromologist command](https://gitlab.com/KomBioMol/gromologist#adding-position-restraints) to add position restraints to existing topologies, so choose which way works for you best.

---

<div class="post-metadata">

**Author:** ![keinerfan](https://avatars.discourse-cdn.com/v4/letter/k/e495f1/32.png) [@keinerfan](https://gromacs.bioexcel.eu/u/keinerfan)\
**Post date:** [January 4, 2024, 2:14pm UTC](https://gromacs.bioexcel.eu/t/generating-posre-itp-for-silica-nanoparticle/7961/3 "2024-01-04T14:14:37Z")

</div>

Hello again i used gromologist and tried to add posres to my topol with this command : " t.add\_posres(keyword = ‘POSRES’, value = 1000) "  
and encountered this : " [position\_restraints] already present in molecule CR2, skipping" i dont know why this happens and how to overpass it , is this because i tried to restrain atoms with genrester command before or because of sth else?

---

<div class="post-metadata">

**Author:** ![keinerfan](https://avatars.discourse-cdn.com/v4/letter/k/e495f1/32.png) [@keinerfan](https://gromacs.bioexcel.eu/u/keinerfan)\
**Post date:** [January 6, 2024, 2:52pm UTC](https://gromacs.bioexcel.eu/t/generating-posre-itp-for-silica-nanoparticle/7961/5 "2024-01-06T14:52:35Z")

</div>

@milosz.wieczor  
Hello again i used gromologist and tried to add posres to my topol with this command : " t.add\_posres(keyword = ‘POSRES’, value = 1000) "  
and encountered this : " [position\_restraints] already present in molecule CR2, skipping" i dont know why this happens and how to overpass it , is this because i tried to restrain atoms with genrester command before or because of sth else?  
[/quote]

---

<div class="post-metadata">

**Author:** ![milosz.wieczor](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@milosz.wieczor](https://gromacs.bioexcel.eu/u/milosz.wieczor)\
**Post date:** [January 6, 2024, 5:54pm UTC](https://gromacs.bioexcel.eu/t/generating-posre-itp-for-silica-nanoparticle/7961/6 "2024-01-06T17:54:35Z")

</div>

If it says it’s already present, then remove it from the file and add it from scratch. This check is to prevent users from unknowingly adding new restraints on top of already existing ones.

---

<div class="post-metadata">

**Author:** ![keinerfan](https://avatars.discourse-cdn.com/v4/letter/k/e495f1/32.png) [@keinerfan](https://gromacs.bioexcel.eu/u/keinerfan)\
**Post date:** [January 7, 2024, 1:15pm UTC](https://gromacs.bioexcel.eu/t/generating-posre-itp-for-silica-nanoparticle/7961/7 "2024-01-07T13:15:40Z")

</div>

my system doesnt have a restraint file and I havent included any restraints in my topology file so how does this happens?  
@milosz.wieczor

---

<div class="post-metadata">

**Author:** ![milosz.wieczor](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@milosz.wieczor](https://gromacs.bioexcel.eu/u/milosz.wieczor)\
**Post date:** [January 7, 2024, 10:00pm UTC](https://gromacs.bioexcel.eu/t/generating-posre-itp-for-silica-nanoparticle/7961/8 "2024-01-07T22:00:59Z")

</div>

When you run `add_posres` on the whole topology, it will go through all defined molecules that have \> 5 atoms, and try to add a position\_restraints section to them. It might print this message when it encounters a chain that already has the section, but it should anyway add the restraints to other molecules - that might be what happened to you.

If that’s not the case, then create a standalone topology file (just read and save the .top with Gromologist) and search within the file for “position\_restraints”, it might be hidden somewhere as a nested #include.

---

<div class="post-metadata">

**Author:** ![keinerfan](https://avatars.discourse-cdn.com/v4/letter/k/e495f1/32.png) [@keinerfan](https://gromacs.bioexcel.eu/u/keinerfan)\
**Post date:** [January 9, 2024, 9:26am UTC](https://gromacs.bioexcel.eu/t/generating-posre-itp-for-silica-nanoparticle/7961/9 "2024-01-09T09:26:05Z")

</div>

@milosz.wieczor thnx for your reply and help i have managed to overcome that isssue
