Feature #1929

gmx solvate only updates topology when the solvent is "SOL"

Added by Chris Neale over 4 years ago. Updated almost 2 years ago.

Target version:


"gmx solvate -p" only updates topology when the solvent is "SOL". It would be nice to add this feature for other solvents as well.

For example, compare that it works for SOL:

touch empty.mdp {
echo title
echo 0
echo 3 3 3
} > empty.gro
gmx solvate -cp empty.gro -cs spc216.gro -p -o out.gro

  1. now lists the number of SOL added.

However, when I instead try:
gmx solvate -cp empty.gro -cs ./methanol5ns.gro -p -o out.gro

then the out.gro output is as expected but the lines are not added to the .top file as desired.

Note that the following output from gmx solvate indicates that the necessary information is already known by the program that the molecule is MEOH and 354 such residues were added.

Sorting configuration
Found 1 molecule type:
MEOH ( 6 atoms): 354 residues
Generated solvent containing 2124 atoms in 354 residues
Writing generated configuration to out.gro

Output configuration contains 2124 atoms in 354 residues
Volume : 27 (nm^3)
Density : 741.494 (g/l)
Number of SOL molecules: 0

I have included a charmm methanol .itp and .gro for reproduction, but you don't even need that. Just take share/gromacs/top/spc216.gro and change all "SOL" to some other name and again gmx solvate will fail to update the topology.

methanol5ns.gro (456 KB) methanol5ns.gro Chris Neale, 03/25/2016 11:17 PM
meoh.itp (1.56 KB) meoh.itp Chris Neale, 03/25/2016 11:17 PM
solvate.patch (3.73 KB) solvate.patch Pedro Lacerda, 08/07/2016 03:45 PM

Associated revisions

Revision 9931becc (diff)
Added by Kevin Boyd almost 2 years ago

Fix gmx solvate topology updating

The topology update of gmx solvate was hardcoded to SOL molecules
(and some of the reported quantities also registered HOH and WAT).

Changed to allow updates based on any solvent molecule information.

Also, now allows for updates with multiple solvent molecule types
in the input solvent configuration

Added test case for topology update with multiple solvents

fixes #1929

Change-Id: If506e0f509c8a25cb615fb8d3f15b4dfdb239afa


#1 Updated by Pedro Lacerda almost 4 years ago

Something like the following non-working patch may do the job. The solvent name is hard-coded in solvate.cpp. Simply get the name from the first molecule in the solvent structure. It works only for a single molecule solvent.

I did not verify but there is a hard-coded distance frequency to put the solvent in the box. If there is a empty region between two solvent molecules because the hard-coded distance is too great, or the program failed to acquire the correct one from solvent structure, the program will results in a defective structure with empty regions between solvent molecules. The scheme to remove overlapping molecules does not apply of course, except if the `defaultDistance` is too low.

#2 Updated by Kevin Boyd almost 2 years ago

  • Status changed from New to In Progress
  • Assignee set to Kevin Boyd
  • Target version set to 2018.3

#3 Updated by Gerrit Code Review Bot almost 2 years ago

Gerrit received a related patchset '1' for Issue #1929.
Uploader: Kevin Boyd ()
Change-Id: gromacs~release-2018~If506e0f509c8a25cb615fb8d3f15b4dfdb239afa
Gerrit URL:

#4 Updated by Kevin Boyd almost 2 years ago

  • Status changed from In Progress to Resolved

#5 Updated by Paul Bauer almost 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF