Add note for COM removal with position restraints
authorBerk Hess <hess@kth.se>
Mon, 16 Dec 2019 09:50:06 +0000 (10:50 +0100)
committerArtem Zhmurov <zhmurov@gmail.com>
Tue, 17 Dec 2019 23:53:10 +0000 (00:53 +0100)
Center of mass motion removal in combination with position restraints
will often cause artifacts. We should (automatically) disable this,
but this will disrupt workflows, so for now grompp will issue a note.

Refs #3244

Change-Id: If983e918d26f0af2fab96d44d0f2b1fc3cedb901

src/gromacs/gmxpreprocess/readir.cpp

index d6dbbe240cc215fe0462b9a06553d53c807ee83d..35f663a8f40e34f9900fc9c59f36bddd54830749 100644 (file)
@@ -3863,12 +3863,12 @@ static void check_disre(const gmx_mtop_t* mtop)
     }
 }
 
-static bool absolute_reference(t_inputrec* ir, gmx_mtop_t* sys, bool posres_only, ivec AbsRef)
+static bool absolute_reference(const t_inputrec* ir, const gmx_mtop_t* sys, const bool posres_only, ivec AbsRef)
 {
     int                  d, g, i;
     gmx_mtop_ilistloop_t iloop;
     int                  nmol;
-    t_iparams*           pr;
+    const t_iparams*     pr;
 
     clear_ivec(AbsRef);
 
@@ -4086,6 +4086,13 @@ void triple_check(const char* mdparin, t_inputrec* ir, gmx_mtop_t* sys, warninp_
 
     set_warning_line(wi, mdparin, -1);
 
+    if (absolute_reference(ir, sys, false, AbsRef))
+    {
+        warning_note(wi,
+                     "Removing center of mass motion in the presence of position restraints might "
+                     "cause artifacts");
+    }
+
     if (ir->cutoff_scheme == ecutsVERLET && ir->verletbuf_tol > 0 && ir->nstlist > 1
         && ((EI_MD(ir->eI) || EI_SD(ir->eI)) && (ir->etc == etcVRESCALE || ir->etc == etcBERENDSEN)))
     {