# Periodic boundary for Flat-bottomed position restraints

**URL:** <https://gromacs.bioexcel.eu/t/periodic-boundary-for-flat-bottomed-position-restraints/11813>\
**Category:** User discussions\
**Created:** [March 26, 2025, 8:12am UTC](https://gromacs.bioexcel.eu/t/periodic-boundary-for-flat-bottomed-position-restraints/11813 "2025-03-26T08:12:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xudi22](https://avatars.discourse-cdn.com/v4/letter/x/c4cdca/32.png) [@xudi22](https://gromacs.bioexcel.eu/u/xudi22)\
**Post date:** [March 26, 2025, 8:12am UTC](https://gromacs.bioexcel.eu/t/periodic-boundary-for-flat-bottomed-position-restraints/11813/1 "2025-03-26T08:12:05Z")

</div>

GROMACS version: 2023.3  
GROMACS modification: No  
Hi,  
I am using flat-bottomed position restraints to constrain all atoms within a cylinder of radius r. I used the Not inverted method, so r is a positive value, and the system is fixed at the center. However, I’m not sure how GROMACS handles this restraint potential in a periodic boundary box. Can anyone help clarify this?  
[position\_restraints]  
; id funct g r k  
1 2 8 2.0 10000  
The guidelines I followed, [Restraints - GROMACS 2024 documentation](https://manual.gromacs.org/2024.0/reference-manual/functions/restraints.html#flat-bottomed-position-restraints) and [Methodology for flat-bottomed position restraints](https://gromacs.bioexcel.eu/t/methodology-for-flat-bottomed-position-restraints/9366) .

---

<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 26, 2025, 9:57am UTC](https://gromacs.bioexcel.eu/t/periodic-boundary-for-flat-bottomed-position-restraints/11813/2 "2025-03-26T09:57:31Z")

</div>

Hi @xudi22

What do you mean specifically? The cylinder will be most likely defined by some combination of positions that you provide to GROMACS with the `-r` flag, depending on what you are restraining. Then when the forces are calculated there will be an additional force on those atoms that you are restraining which depends on where they are with respect to the cylinder. These positions will be corrected for PBCs, so the “absolute” position doesn’t matter, only the one relative to the cylinder.

---

<div class="post-metadata">

**Author:** ![xudi22](https://avatars.discourse-cdn.com/v4/letter/x/c4cdca/32.png) [@xudi22](https://gromacs.bioexcel.eu/u/xudi22)\
**Post date:** [March 26, 2025, 1:48pm UTC](https://gromacs.bioexcel.eu/t/periodic-boundary-for-flat-bottomed-position-restraints/11813/3 "2025-03-26T13:48:51Z")

</div>

Thank you very much!  
When setting the radius, they always mention using negative values, but I used positive numbers instead. I’m wondering if they actually work the same way.  
I now realize they are consistent—it’s just the positioning setup that differs. The PBCs works as usual.

---

<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 26, 2025, 2:15pm UTC](https://gromacs.bioexcel.eu/t/periodic-boundary-for-flat-bottomed-position-restraints/11813/4 "2025-03-26T14:15:58Z")

</div>

I think the radius sign is really just to have a compact way of representing both states of a cylinder restraint, that is, push in or push out. With one you get a potential wall that confines inside, with the other one that confines outside - in both cases the radius of the cylinder is still the absolute value or the `r` you use, irrespective of whatever PBC setup you have! :)
