Project

General

Profile

Bug #1352

pull-code constant-force direction gives unexpected error about distance larger than box size

Added by Chris Neale almost 4 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Low
Category:
-
Target version:
Affected version - extra info:
4.5.5, 4.6.1, 4.6.3
Affected version:
Difficulty:
uncategorized
Close

Description

I am trying to use the pull code to add a constant force in a particular direction.
I am getting an error that the initial distance is greater than 1/2 the box size.
(error in 4.5.5, 4.6.1, 4.6.3)

I checked the online .mdp options:
http://manual.gromacs.org/online/mdp_opt.html#pull

which read as if there is no concept of "distance" in this case, just an applied force along the specified vector.

My .mdp options are:
pull = constant-force
pull_geometry = direction
pull_dim = Y Y Y
pull_nstxout = 500
pull_nstfout = 500
pull_ngroups = 1
pull_group1 = r_1_&_CA
pull_pbcatom1 = 0
pull_k1 = 30
pull_vec1 = -0.848 -0.179 0.497

And when I run:
grompp -p ../this.top -c ../start.gro -n ../index.ndx -f this.mdp

The error message is:
Pull group 1 'r_1_&_CA' has 1 atoms
Number of degrees of freedom in T-Coupling group System is 113574.00

WARNING 1 [file this.mdp]:
You are using an absolute reference for pulling, but the rest of the
system does not have an absolute reference. This will lead to artifacts.

Largest charge group radii for Van der Waals: 0.040, 0.040 nm
Largest charge group radii for Coulomb: 0.079, 0.079 nm
Calculating fourier grid dimensions for X Y Z
Using a fourier grid of 64x64x96, spacing 0.117 0.117 0.110
Pull group natoms pbc atom distance at start reference at t=0
0 0 0
1 1 0
-------------------------------------------------------
Program grompp, VERSION 4.6.3
Source code file: /project/p/pomes/cneale/GPC/exe/intel/gromacs-4.6.3/source/src/mdlib/pull.c, line: 331

Fatal error:
Distance of pull group 1 (4.706043 nm) is larger than 0.49 times the box size (3.738000)
For more information and tips for troubleshooting, please check the GROMACS
website at http://www.gromacs.org/Documentation/Errors
-------------------------------------------------------

###

initial position of r_1_&_CA: 5.466 3.477 2.453
pull_vec1: -0.848 -0.179 0.497
box: 7.47600 7.47600 10.55300
shortest distance from initial position of r_1_&_CA to (0,0,0): 2.01 3.477 2.453 = 4.706

But why does it matter what the distance from (0,0,0) to the initial position is?

Moreover, adding pull_start = yes does not change the error , nor does setting pull_init1 = 5.466 3.477 2.453
(I didn't expect pull_init1 to have any effect, but I tried it just in case).

Finally, If I do use direction-periodic, I don't get an error with grompp, but I get the following output,
which is hard for me to align with my current understanding of what the pull code should be doing:

Pull group natoms pbc atom distance at start reference at t=0
0 0 0
1 1 0 2.301 0.000

(why is there a "distance at start" and why is the reference at t=0 affected if I set:
pull_init1 = 5.466 3.477 2.453

Pull group natoms pbc atom distance at start reference at t=0
0 0 0
1 1 0 2.301 5.466

when pull_init1 is supposed to be ignored for constant-force pulling?

This may be related to: http://gromacs.5086.x6.nabble.com/constant-force-pulling-td5010180.html

I originally posted this at: http://lists.gromacs.org/pipermail/gmx-users/2013-October/084598.html

Commenting out the gmx_fatal() call in src/mdlib/pull.c, line: 331 and recompiling grompp and mdrun
allows the run to proceed. Everything is stable for 250 ps. I will report if it fails.

Proposed solution is to:
(a) wrap the gmx_fatal call at line 331 of src/mdlib/pull.c like this:

    if (max_dist2 >= 0 && dr2 > 0.98*0.98*max_dist2 && !(pull->eGeom == epullgDIR && ePull == epullCONST_F))
    {
        gmx_fatal(FARGS, "Distance of pull group %d (%f nm) is larger than 0.49 times the box size (%f)", g, sqrt(dr2), sqrt(max_dist2));
    }
    // requires sending the value of ePull to get_pullgrps_dr() in src/mdlib/pull.c calling functions do_constraint() get_pullgrp_dr() pull_constraint() get_pullgrp_distance() and in src/mdlib/constr.c constrain() and perhaps other functions that I have missed (or why not redefine ePull as a boolean flag and have all of the relevant information (including the enumerated ePull in the pull type?).

(b) Modify the output to the log file in the src/kernel/readpull.c function set_pull_init() so that it doesn't output an intital distance when pull->eGeom == epullgDIR for the output that comes after:

    fprintf(stderr, "Pull group  natoms  pbc atom  distance at start     reference at t=0\n");

Thank you,
Chris.

redmine.tgz - files to check the unexpected error (2.78 MB) Chris Neale, 10/05/2013 05:10 PM

Associated revisions

Revision d72236eb (diff)
Added by Rossen Apostolov over 3 years ago

Added a note about using direction-periodic pulling.

Refs #1352.

Change-Id: I867fe1372082063bb221880e8021089f9ded14e7

History

#1 Updated by Chris Neale almost 4 years ago

Files attached can be run through grompp and mdrun successfully only after commenting out the gmx_fatal() call at line 331 in pull.c

#2 Updated by Chris Neale almost 4 years ago

I am currently running 500 simulations, all of which are still running stably after 5 ns of simulation each (total of 2.5 us) using the binary in which I have commented out the above mentioned gmx_fatal() call. Furthermore, the force vector seems to be acting as I intended.

#3 Updated by Berk Hess almost 4 years ago

I think this is one of the cases where direction-periodic is useful: it circumvents the check (and does some other magic which, I hope, should not affect your results).

#4 Updated by Berk Hess almost 4 years ago

  • Status changed from New to Feedback wanted

#5 Updated by Rossen Apostolov over 3 years ago

Bump: Berk, shall we e.g. modify the log output as Chris suggests or not just leave it the way it is?

#6 Updated by Gerrit Code Review Bot over 3 years ago

Gerrit received a related patchset '1' for Issue #1352.
Uploader: Rossen Apostolov ()
Change-Id: If7793ad08cfb975a6893ba9f54ebabc64cbd0fb0
Gerrit URL: https://gerrit.gromacs.org/3376

#7 Updated by Rossen Apostolov over 3 years ago

I added a note about it in 5.0. Let me know what you think.

#8 Updated by Rossen Apostolov over 3 years ago

  • Status changed from Feedback wanted to Fix uploaded

#9 Updated by Gerrit Code Review Bot over 3 years ago

Gerrit received a related patchset '1' for Issue #1352.
Uploader: Rossen Apostolov ()
Change-Id: If7793ad08cfb975a6893ba9f54ebabc64cbd0fb0
Gerrit URL: https://gerrit.gromacs.org/3410

#10 Updated by Gerrit Code Review Bot over 3 years ago

Gerrit received a related patchset '1' for Issue #1352.
Uploader: Rossen Apostolov ()
Change-Id: I867fe1372082063bb221880e8021089f9ded14e7
Gerrit URL: https://gerrit.gromacs.org/3411

#11 Updated by Rossen Apostolov over 3 years ago

  • Assignee set to Rossen Apostolov
  • Target version set to 4.6.x

#12 Updated by Rossen Apostolov about 3 years ago

  • Status changed from Fix uploaded to Closed

Also available in: Atom PDF