# Problem with intermolecular restraints

**URL:** https://gromacs.bioexcel.eu/t/problem-with-intermolecular-restraints/235
**Category:** User discussions
**Created:** [June 3, 2020, 8:47am UTC](https://gromacs.bioexcel.eu/t/problem-with-intermolecular-restraints/235 "2020-06-03T08:47:20Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![amin\_sagar](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@amin\_sagar](https://gromacs.bioexcel.eu/u/amin_sagar)
#### Post date: [June 3, 2020, 8:47am UTC](https://gromacs.bioexcel.eu/t/problem-with-intermolecular-restraints/235/1 "2020-06-03T08:47:20Z")

</div>

GROMACS version: 2020  
GROMACS modification: No  
Dear All,  
I am trying to simulate a protein-protein complex using Martini force field. The complex dissociates in the absence of any restraints. So, I am trying to impose distance restraints on the interface residues.  
I wrote the following .itp file

; distance restraints for adam-vdw  
[intermolecular\_interactions]  
[distance\_restraints]  
; ai aj type index type’ low up1 up2 fac  
248 1335 1 0 1 0.0 0.3 0.4 1.0

The atom numbers are global.  
I then included this file in the topology file as follows

#include “martini\_3.0.b.3.2/martini\_v3.0.b.3.2-1.3.itp”  
#include “Protein\_A.itp”  
#include “Protein\_B.itp”  
#include “A-B-dist.itp”  
#include “martini\_3.0.b.3.2/martini\_v3.0\_ions.itp”  
#include “martini\_3.0.b.3.2/martini\_v3.0\_solvents.itp”

[system]  
; name  
Insanely solvated protein.

[molecules]  
; name number  
Protein\_A 1  
Protein\_B 1  
WN 40086  
TNA 447  
TCL 435

When I use this way to set up the simulation, I get the following error  
Fatal error:  
Syntax error - File A-B-dist.itp, line 2  
Last line read:  
‘[intermolecular\_interactions]’  
Invalid order for directive intermolecular\_interactions

Could someone please help me in understanding the proper order or what else I am doing wrong here?  
I would be grateful for any suggestions.  
Best,  
Amin.

---

<div class="post-metadata">

### Author: ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)
#### Post date: [June 5, 2020, 12:14pm UTC](https://gromacs.bioexcel.eu/t/problem-with-intermolecular-restraints/235/2 "2020-06-05T12:14:45Z")

</div>

Intermolecular interactions have to be defined at the very end of the system `.top` file, as global atom numbers are only established after processing the `[molecules]` directive.

---

<div class="post-metadata">

### Author: ![amin\_sagar](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@amin\_sagar](https://gromacs.bioexcel.eu/u/amin_sagar)
#### Post date: [June 5, 2020, 12:51pm UTC](https://gromacs.bioexcel.eu/t/problem-with-intermolecular-restraints/235/3 "2020-06-05T12:51:10Z")

</div>

Thanks a lot. Works Perfectly.

Amin.
