From 286baa3d7aba3ce39b647b091d0a2de1a738e4d8 Mon Sep 17 00:00:00 2001 From: Mark Abraham Date: Thu, 4 Apr 2019 11:29:24 +0200 Subject: [PATCH] Use potential-shift as default modifier The potential-shift-verlet modifier is no longer useful, as potential-shift was the default with the only cut-off scheme remaining. That is now explicit. The former modifier is now named to reflect that it doesn't do anything. The documentation no longer mentions that modifier, but if a user supplies an .mdp file using it, grompp silently adopts the behaviour of the potential-shift modifier. No .tpr files contain that value, as grompp always converted it to something else, but in any case this patch doesn't change the situation if somehow such a .tpr does exist. Change-Id: Ie4f848a298750b9749ebb083812bad06b2faa45c --- docs/user-guide/mdp-options.rst | 20 ++++---------------- src/gromacs/gmxpreprocess/readir.cpp | 20 +++++++------------- src/gromacs/mdtypes/md_enums.h | 4 ++-- 3 files changed, 13 insertions(+), 31 deletions(-) diff --git a/docs/user-guide/mdp-options.rst b/docs/user-guide/mdp-options.rst index 8ae3921743..711c877128 100644 --- a/docs/user-guide/mdp-options.rst +++ b/docs/user-guide/mdp-options.rst @@ -704,11 +704,6 @@ Electrostatics .. mdp:: coulomb-modifier - .. mdp-value:: Potential-shift-Verlet - - Selects Potential-shift with the Verlet cutoff-scheme, as it is - (nearly) free; selects None with the group cutoff-scheme. - .. mdp-value:: Potential-shift Shift the Coulomb potential by a constant such that it is zero @@ -718,9 +713,8 @@ Electrostatics .. mdp-value:: None - Use an unmodified Coulomb potential. With the group scheme this - means no exact cut-off is used, energies and forces are - calculated for all pairs in the pair list. + Use an unmodified Coulomb potential. This can be useful + when comparing energies with those computed with other software. .. mdp:: rcoulomb-switch @@ -808,11 +802,6 @@ Van der Waals .. mdp:: vdw-modifier - .. mdp-value:: Potential-shift-Verlet - - Selects Potential-shift with the Verlet cutoff-scheme, as it is - (nearly) free; selects None with the group cutoff-scheme. - .. mdp-value:: Potential-shift Shift the Van der Waals potential by a constant such that it is @@ -822,9 +811,8 @@ Van der Waals .. mdp-value:: None - Use an unmodified Van der Waals potential. With the group scheme - this means no exact cut-off is used, energies and forces are - calculated for all pairs in the pair list. + Use an unmodified Van der Waals potential. This can be useful + when comparing energies with those computed with other software. .. mdp-value:: Force-switch diff --git a/src/gromacs/gmxpreprocess/readir.cpp b/src/gromacs/gmxpreprocess/readir.cpp index be95157da7..88a5b4473a 100644 --- a/src/gromacs/gmxpreprocess/readir.cpp +++ b/src/gromacs/gmxpreprocess/readir.cpp @@ -227,18 +227,12 @@ static int lcd(int n1, int n2) return d; } -static void process_interaction_modifier(const t_inputrec *ir, int *eintmod) +//! Convert legacy mdp entries to modern ones. +static void process_interaction_modifier(int *eintmod) { - if (*eintmod == eintmodPOTSHIFT_VERLET) + if (*eintmod == eintmodPOTSHIFT_VERLET_UNSUPPORTED) { - if (ir->cutoff_scheme == ecutsVERLET) - { - *eintmod = eintmodPOTSHIFT; - } - else - { - *eintmod = eintmodNONE; - } + *eintmod = eintmodPOTSHIFT; } } @@ -286,8 +280,8 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts, sprintf(err_buf, "nstlist can not be smaller than 0. (If you were trying to use the heuristic neighbour-list update scheme for efficient buffering for improved energy conservation, please use the Verlet cut-off scheme instead.)"); CHECK(ir->nstlist < 0); - process_interaction_modifier(ir, &ir->coulomb_modifier); - process_interaction_modifier(ir, &ir->vdw_modifier); + process_interaction_modifier(&ir->coulomb_modifier); + process_interaction_modifier(&ir->vdw_modifier); if (ir->cutoff_scheme == ecutsGROUP) { @@ -350,7 +344,7 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts, if (!(ir->coulomb_modifier == eintmodNONE || ir->coulomb_modifier == eintmodPOTSHIFT)) { - sprintf(warn_buf, "coulomb_modifier=%s is not supported with the Verlet cut-off scheme", eintmod_names[ir->coulomb_modifier]); + sprintf(warn_buf, "coulomb_modifier=%s is not supported", eintmod_names[ir->coulomb_modifier]); warning_error(wi, warn_buf); } diff --git a/src/gromacs/mdtypes/md_enums.h b/src/gromacs/mdtypes/md_enums.h index 27f2a6a9b3..ed005b3219 100644 --- a/src/gromacs/mdtypes/md_enums.h +++ b/src/gromacs/mdtypes/md_enums.h @@ -148,11 +148,11 @@ extern const char *ecutscheme_names[ecutsNR+1]; /*! \brief Coulomb / VdW interaction modifiers. * - * grompp replaces eintmodPOTSHIFT_VERLET by eintmodPOTSHIFT or eintmodNONE. + * grompp replaces eintmodPOTSHIFT_VERLET_UNSUPPORTED by eintmodPOTSHIFT. * Exactcutoff is only used by Reaction-field-zero, and is not user-selectable. */ enum eintmod { - eintmodPOTSHIFT_VERLET, eintmodPOTSHIFT, eintmodNONE, eintmodPOTSWITCH, eintmodEXACTCUTOFF, eintmodFORCESWITCH, eintmodNR + eintmodPOTSHIFT_VERLET_UNSUPPORTED, eintmodPOTSHIFT, eintmodNONE, eintmodPOTSWITCH, eintmodEXACTCUTOFF, eintmodFORCESWITCH, eintmodNR }; //! String corresponding to interaction modifiers extern const char *eintmod_names[eintmodNR+1]; -- 2.11.4.GIT