No example in the manual

GROMACS version: 2019.6
GROMACS modification: No

I want to add a cylindrical restraint along the z-axis.
However, there is no example in the manual.
Then, how can I apply it?

Manual provides only g=8 information (axis of cylinder parallel to z-axis).
What is the format of restraint information?
What about radius? what about the length of cylinder? what about force constant?

Please update and make the manual more friendly.

Hi - if you have a request, please file an issue here:

The functional form is described here:

Cylindrical restraints are under flat-bottom potentials, the restraint format is described here and contains the inputs for radius and force constant:

The restraints have infinite length along the specified axis. If you really want to constrain a finite-length cylinder, you could add a few flat-bottom layer restraints along that axis.

Thank you Kevinboyd for the reply.

I have read the manual, but I couldn’t find any flat-bottomed rest. example.

According to the top-format of flat-bottomed restraint, an example could be

at.n g r k (cylinder)

  1    2    8   0.5   1000

at.n g z k (layer)

  1    2    5   2.0 (1.0)?   1000

I want to limit the all water in x-y direction with 0.5 nm radius the cylinder only in -1.0 < z < 1.0, but I want to free them in z-direction.
Water in z<-1.0 or z>1.0 should be free even in x-y direction too.
Current restraint has infinite length of the cylinder.

If I combine cylinder and layer, then waters are limited inside the cylinder.
The above example limits the length of z-axis of the cylinder, the water molecules are limited inside the cylinder.
This is not what I want. Water should be free to move in z-direction outside of the cylinder, and outside water can come into the cylinder (for example the simulation box is 40x40x40), and the water in the cylinder should be able to get out in z-direction.

How can I achieve this goal?

If I want to modify the source code of the Gromacs to achieve this?
Which code should I touch? Any guideline for modification of the source code?

All I want is a finite length of cylindrical position restraint.

Thank you.


Looks like you have the functional forms correct.

So what you want is a double-open ended cylinder? That won’t work with flat-bottom potentials, and I doubt the source code could be easily modified.

I suggest trying dummy atoms - fixed-in-place particles that only interact with a subset of the system with repulsive interactions. That would give you the flexibility you need. Details here:

Yesylevskyy SO, Rivel T & Ramseyer C The influence of curvature on the properties of the plasma membrane. Insights from atomistic molecular dynamics simulations. Sci. Rep. 7, 16078 (2017).

and I’ve used them in the past as well for constraining lipid systems to cylindrical shapes - I wrote a tool to set up those systems that you could probably use to create pure dummy particle setups you could then solvate/combine with other structures:

If that’s not appealing, you may be able to use NAMD grid forces to create a roughly cylindrical potential, though I haven’t tried that.


Interesting… I will take a look.
Thank you for the information.

Have a great day.