# Error with "Distance between pull groups" and PBC for lipid bilayer and molecule interaction

**URL:** <https://gromacs.bioexcel.eu/t/error-with-distance-between-pull-groups-and-pbc-for-lipid-bilayer-and-molecule-interaction/6510>\
**Category:** User discussions\
**Tags:** mdp-parameters\
**Created:** [May 29, 2023, 2:19pm UTC](https://gromacs.bioexcel.eu/t/error-with-distance-between-pull-groups-and-pbc-for-lipid-bilayer-and-molecule-interaction/6510 "2023-05-29T14:19:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brijesh](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@Brijesh](https://gromacs.bioexcel.eu/u/Brijesh)\
**Post date:** [May 29, 2023, 2:19pm UTC](https://gromacs.bioexcel.eu/t/error-with-distance-between-pull-groups-and-pbc-for-lipid-bilayer-and-molecule-interaction/6510/1 "2023-05-29T14:19:45Z")

</div>

GROMACS version:5.1.4  
GROMACS modification: Yes/No  
Dear GROMACS Users,  
Can anyone help me with my problems pulling a molecule toward the lipid bilayer in MD simulation in GROMACS?  
I am using the pull code from Prof Justin Lemkul in the Umbrella sampling tutorial using Gromacs as a reference for pulling a molecule towards the plasma membrane model.  
[md\_pull.mdp](https://gromacs.bioexcel.eu/uploads/short-url/s6tgsucqbDrG8nXzvXZYyr1zQ8G.mdp) (2.3 KB)

On using this command, I get  
gmx grompp -f md\_pull.mdp -c md\_final.gro -p topol.top -r md\_final.gro -n new.ndx -t md\_final.cpt -o pull.tpr

I get an error stating: Can not have dynamic box while using pull geometry “direction-periodic” (dim z).

 ![Screenshot from 2023-05-29 19-41-46](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/b/b3a36e2e972756b5dbf0a5b56fb125cf5538ecc0.png)

Have a nice day

Thanks and regards  
Brijesh

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [May 29, 2023, 7:02pm UTC](https://gromacs.bioexcel.eu/t/error-with-distance-between-pull-groups-and-pbc-for-lipid-bilayer-and-molecule-interaction/6510/2 "2023-05-29T19:02:48Z")

</div>

Does Justins tutorial use geometry=distance-periodic?

Geometry distance-periodic is pulling molecules over distances of more than half the box and should almost never used. With a membrane one should use geometry=cylinder.

---

<div class="post-metadata">

**Author:** ![Brijesh](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@Brijesh](https://gromacs.bioexcel.eu/u/Brijesh)\
**Post date:** [May 31, 2023, 5:49pm UTC](https://gromacs.bioexcel.eu/t/error-with-distance-between-pull-groups-and-pbc-for-lipid-bilayer-and-molecule-interaction/6510/3 "2023-05-31T17:49:16Z")

</div>

Dear Hess,

Thanks for replying  
Prof. Lemkul uses pull\_coord1\_geometry = distance as given in the tutorial. I tried with this, but he pulls the protein chain there.  
Here, I want to bring molecule towards the membrane. For this, I first gave **pull\_coord1\_rate vale = -ve** , which gave an error stating “ **When the maximum distance from a pull group reference atom to other atoms in the group is larger than 0.5 times half the box size a centrally placed atom should be chosen as pbc atom. Pull group 2 is larger than that and does not have a specific atom selected as reference atom** ”.

This same error comes when I use pull\_coord1\_geometry = distance and cylinder.

Have a nice day  
Thanks and Regards  
Brijesh

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [June 2, 2023, 7:04am UTC](https://gromacs.bioexcel.eu/t/error-with-distance-between-pull-groups-and-pbc-for-lipid-bilayer-and-molecule-interaction/6510/4 "2023-06-02T07:04:39Z")

</div>

You would get that error with geometry=distance, but not with geometry=cylinder, if you chose the bilayer as the first group. Did you choose the bilayer as the first group?

---

<div class="post-metadata">

**Author:** ![Brijesh](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@Brijesh](https://gromacs.bioexcel.eu/u/Brijesh)\
**Post date:** [June 7, 2023, 7:22am UTC](https://gromacs.bioexcel.eu/t/error-with-distance-between-pull-groups-and-pbc-for-lipid-bilayer-and-molecule-interaction/6510/5 "2023-06-07T07:22:34Z")

</div>

Dear Hess,

```auto
pull = yes
pull-ncoords = 1
pull-ngroups = 2
pull-group1-name = LIG
pull-group2-name = DOPC_DOPG
pull-coord1-type = umbrella
pull-coord1-geometry = direction/cylinder
pull-coord1-dim = N N Y
pull_coord1_vec = 0.0 0.0 -1.0
pull-coord1-groups = 1 2
pull-coord1_start = yes
pull-coord1-rate = -0.01
pull-coord1-k = 1000.0

```

For pull-coord1-geometry, I used direction/distance/cylinder.  
This works if I keep the box size at least 4 times of the distance between the molecule and the membrane.

Thanks for help

Have a nice day

Thanks and regards  
Brijesh

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [June 7, 2023, 11:15am UTC](https://gromacs.bioexcel.eu/t/error-with-distance-between-pull-groups-and-pbc-for-lipid-bilayer-and-molecule-interaction/6510/6 "2023-06-07T11:15:30Z")

</div>

You should use geometry=cylinder and swap the names of group 1 and 2. You might then also need to change the sign of the pull vector.

---

<div class="post-metadata">

**Author:** ![Brijesh](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@Brijesh](https://gromacs.bioexcel.eu/u/Brijesh)\
**Post date:** [June 8, 2023, 12:24pm UTC](https://gromacs.bioexcel.eu/t/error-with-distance-between-pull-groups-and-pbc-for-lipid-bilayer-and-molecule-interaction/6510/7 "2023-06-08T12:24:50Z")

</div>

Dear Hess,

Thanks for the suggestion.  
I will try your suggestion and will update you.

Have a great day

Thanks and regards  
Brijesh
