Project

General

Profile

Bug #2230

gmx density hangs when computing charge density with -symm

Added by Semen Yesylevskyy over 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
analysis tools
Target version:
-
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

gmx density hangs when computing charge density in the system with shell particles if -symm is provided:

$ gmx density -dens charge -f traj_comp.xtc -sl 100 -symm
...
Select the group to center density profiles around:
Group     0 (         System) has  2292 elements
Group     1 (          Other) has   225 elements
Group     2 (             AU) has   225 elements
Group     3 (          Water) has  2067 elements
Group     4 (            SOL) has  2067 elements
Group     5 (      non-Water) has   225 elements
Select a group: 2
Selected 2: 'AU'

Select 1 group to calculate density for:
Group     0 (         System) has  2292 elements
Group     1 (          Other) has   225 elements
Group     2 (             AU) has   225 elements
Group     3 (          Water) has  2067 elements
Group     4 (            SOL) has  2067 elements
Group     5 (      non-Water) has   225 elements
Select a group: 4
Selected 4: 'SOL'
Reading frame       0 time    0.000

...HANGS FOREVER...

If no -symm is asked it works fine.

The system has shell particles for polarization, which may cause the bug. In other systems without shells this option works well.

bug.zip (4.91 MB) bug.zip Semen Yesylevskyy, 08/11/2017 11:48 AM
gmx_density.c (26 KB) gmx_density.c klark chen, 09/05/2017 09:43 AM

Associated revisions

Revision 8a67cc42 (diff)
Added by Erik Lindahl almost 2 years ago

Fix gmx density for non-mass calculations

Implemented fix proposed by Klark Chen and Reid
Van Lehn so that we always use mass and never
charge/electron density to center systems.

Fixes #2230.

Change-Id: Id49741bd44349d43a27b5f20f4e498d2fd4ba1f9

History

#1 Updated by klark chen over 2 years ago

My gmx density (gmx 5.1.4) also hangs when computing charge density on a bilayer system with option -center. Since -symm automatically turns on -center(as stated in the document), it is most probably a reproduction of this bug, and codes related to -center could be traced in priority.

#2 Updated by klark chen over 2 years ago

The issue relevant to -center and charge density was mentioned by Reid Van Lehn in Feature #1168. When charge or number is provided to -dens, the code simply overrides atom mass of the topology by atom charges or 1 before COM is calculated. Consequently center of charge or number is actually used for centering the system, which may not be what users desire. On the other hand, in typical systems the total charge can be very close to zero, and center_coords, the function used to calculate the center is designed for center of mass, which applies divisions by the total mass/charge, thus numerical instability may be introduced.

I made a fix for gmx_density.c to center the system by COM in all -dens cases. Quantities for density calculation are hold in a new array den_val to avoid direct overwriting of atom mass.

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

Gerrit received a related patchset '1' for Issue #2230.
Uploader: Erik Lindahl ()
Change-Id: gromacs~release-2018~Id49741bd44349d43a27b5f20f4e498d2fd4ba1f9
Gerrit URL: https://gerrit.gromacs.org/7408

#4 Updated by Erik Lindahl almost 2 years ago

  • Status changed from New to Fix uploaded

#5 Updated by Erik Lindahl almost 2 years ago

  • Status changed from Fix uploaded to Resolved

#6 Updated by Erik Lindahl almost 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF