From 3a93c3a8ed49d20b47aed181d98f64921b864a3d Mon Sep 17 00:00:00 2001 From: Paul Bauer Date: Thu, 27 Feb 2020 11:47:26 +0100 Subject: [PATCH] Remove frozen atoms from VCM groups Atoms are removed during preprocessing. Also add release note missing for previous patch. Fixes #2553 Change-Id: I4fd52d50a9ef3af4ed11f9b507902d4ac59ed487 --- docs/release-notes/2020/2020.1.rst | 18 ++++++++++++++++++ src/gromacs/gmxpreprocess/readir.cpp | 20 ++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/docs/release-notes/2020/2020.1.rst b/docs/release-notes/2020/2020.1.rst index c860e8cbca..1f4c882408 100644 --- a/docs/release-notes/2020/2020.1.rst +++ b/docs/release-notes/2020/2020.1.rst @@ -139,6 +139,24 @@ segmentation fault. :issue:`3389` +Remove frozen atoms from center of mass removal groups +"""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Frozen atoms would still contribute to the mass of the group, while not being moved, +leading to the movement of the remaining issues to be too small. Now, frozen atoms are +removed from the center of mass removal groups to avoid this. + +:issue:`2553` + +Fix possible issue with picking undefined NB kernel types +""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +The CPU reference implementations for the NB kernels were missing some definitions for specific kernel +types. This only affected installations that have SIMD explicitly turned off, something that is +unlikely to happen in production environments. + +:issue:`2728` + Fixes for ``gmx`` tools ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/gromacs/gmxpreprocess/readir.cpp b/src/gromacs/gmxpreprocess/readir.cpp index a217abfaa9..ac4a8059d6 100644 --- a/src/gromacs/gmxpreprocess/readir.cpp +++ b/src/gromacs/gmxpreprocess/readir.cpp @@ -3686,6 +3686,26 @@ void do_index(const char* mdparin, "This may lead to artifacts.\n" "In most cases one should use one group for the whole system."); } + /* Including frozen atoms in center of mass removal groups would lead to their + * mass contributing to the total group mass, while not being moved with the other atoms. + * This would mean that the total movement for the atoms in the group would be too small. + * To avoid this, frozen atoms are explicitly removed from the center of mass removal groups. + */ + for (const auto& atom : groups->groupNumbers[SimulationAtomGroupType::Freeze]) + { + auto position = std::find( + groups->groupNumbers[SimulationAtomGroupType::MassCenterVelocityRemoval].begin(), + groups->groupNumbers[SimulationAtomGroupType::MassCenterVelocityRemoval].end(), atom); + if (position != groups->groupNumbers[SimulationAtomGroupType::MassCenterVelocityRemoval].end()) + { + std::string message = gmx::formatString( + "Can not have atoms in both Freeze and Center of Mass removal groups" + "Removing atom %d from Center of Mass removal", + static_cast(atom)); + warning_note(wi, message); + groups->groupNumbers[SimulationAtomGroupType::MassCenterVelocityRemoval].erase(position); + } + } /* Now we have filled the freeze struct, so we can calculate NRDF */ calc_nrdf(mtop, ir, gnames); -- 2.11.4.GIT