From f3d8d46e3e825a90033fa6a56e7dd17074021abc Mon Sep 17 00:00:00 2001 From: Pascal Merz Date: Wed, 27 Jan 2021 22:06:00 +0000 Subject: [PATCH] Remove constant acceleration groups Per Redmine discussion, this has been broken for about 10 years. Simplifying the update and global energy code is nice, and some integrators will now be a trifle faster. The value of SimulationAtomGroupType::Count can't change because reading old .tpr files relies on it, but the enumeration value has a new name so that any relevant code rebasing over this change can't silently still compile. This does mean that loops over egcNR are now slightly less efficient than they could be, and some of those are in the per-step update code. But that is likely not worth changing in the current form of the code. Originally authored by Mark Abraham at https://gerrit.gromacs.org/c/gromacs/+/8944. Fixes #1354 --- .../algorithms/group-concept.rst | 9 - .../2022/major/removed-functionality.rst | 7 + docs/user-guide/mdp-options.rst | 14 - src/gromacs/fileio/tpxio.cpp | 30 +- src/gromacs/gmxpreprocess/grompp.cpp | 4 +- src/gromacs/gmxpreprocess/readir.cpp | 123 +------- ...arametersWithValuesIncludingAssignment.xml | 2 - .../GetIrTest_AcceptsElectricField.xml | 2 - ...IrTest_AcceptsElectricFieldOscillating.xml | 2 - .../GetIrTest_AcceptsElectricFieldPulsed.xml | 2 - .../refdata/GetIrTest_AcceptsEmptyLines.xml | 2 - .../GetIrTest_AcceptsImplicitSolventNo.xml | 2 - .../GetIrTest_AcceptsKeyWithoutValue.xml | 2 - .../tests/refdata/GetIrTest_AcceptsMimic.xml | 2 - ...IrTest_HandlesDifferentKindsOfMdpLines.xml | 2 - src/gromacs/mdlib/coupling.cpp | 51 +-- src/gromacs/mdlib/energyoutput.cpp | 43 --- src/gromacs/mdlib/energyoutput.h | 5 - src/gromacs/mdlib/md_support.cpp | 34 +- src/gromacs/mdlib/mdatoms.cpp | 11 +- src/gromacs/mdlib/tests/energyoutput.cpp | 16 +- src/gromacs/mdlib/tests/leapfrogtestdata.cpp | 3 +- ...ameters_EnergyOutputTest_CheckOutput_0.xml | 58 +--- ...ameters_EnergyOutputTest_CheckOutput_1.xml | 58 +--- ...meters_EnergyOutputTest_CheckOutput_10.xml | 58 +--- ...ameters_EnergyOutputTest_CheckOutput_2.xml | 58 +--- ...ameters_EnergyOutputTest_CheckOutput_3.xml | 2 +- ...ameters_EnergyOutputTest_CheckOutput_4.xml | 292 +----------------- ...ameters_EnergyOutputTest_CheckOutput_5.xml | 58 +--- ...ameters_EnergyOutputTest_CheckOutput_6.xml | 58 +--- ...ameters_EnergyOutputTest_CheckOutput_7.xml | 58 +--- ...ameters_EnergyOutputTest_CheckOutput_8.xml | 58 +--- ...ameters_EnergyOutputTest_CheckOutput_9.xml | 58 +--- src/gromacs/mdlib/tgroup.cpp | 111 +------ src/gromacs/mdlib/tgroup.h | 23 +- src/gromacs/mdlib/update.cpp | 75 +---- src/gromacs/mdrun/runner.cpp | 9 +- src/gromacs/mdrun/shellfc.cpp | 4 +- src/gromacs/mdtypes/group.h | 22 +- src/gromacs/mdtypes/inputrec.cpp | 19 +- src/gromacs/mdtypes/inputrec.h | 8 +- src/gromacs/mdtypes/mdatom.h | 4 +- .../modularsimulator/modularsimulator.cpp | 6 +- src/gromacs/tools/dump.cpp | 6 +- src/gromacs/topology/topology.cpp | 4 +- src/gromacs/topology/topology.h | 4 +- 46 files changed, 143 insertions(+), 1336 deletions(-) diff --git a/docs/reference-manual/algorithms/group-concept.rst b/docs/reference-manual/algorithms/group-concept.rst index 2df2655a2e..1c97ea602c 100644 --- a/docs/reference-manual/algorithms/group-concept.rst +++ b/docs/reference-manual/algorithms/group-concept.rst @@ -40,15 +40,6 @@ freeze group simulation, and afterward use position restraints in conjunction with constant pressure. -accelerate group - - On each atom in an “accelerate group” an acceleration - :math:`\mathbf{a}^g` is imposed. This is equivalent to - an external force. This feature makes it possible to drive the - system into a non-equilibrium state and enables the performance of - non-equilibrium MD and hence to obtain transport properties. - (Deprecated) - energy-monitor group Mutual interactions between all energy-monitor groups are compiled diff --git a/docs/release-notes/2022/major/removed-functionality.rst b/docs/release-notes/2022/major/removed-functionality.rst index 3ddd4f5f1b..f94042ac41 100644 --- a/docs/release-notes/2022/major/removed-functionality.rst +++ b/docs/release-notes/2022/major/removed-functionality.rst @@ -1,6 +1,13 @@ Removed functionality ^^^^^^^^^^^^^^^^^^^^^ +Removed constant-acceleration groups support +"""""""""""""""""""""""""""""""""""""""""""" +This code has been broken since before GROMACS 4.6, so it has been +removed. + +:issue:`1354` + .. Note to developers! Please use """"""" to underline the individual entries for fixed issues in the subfolders, otherwise the formatting on the webpage is messed up. diff --git a/docs/user-guide/mdp-options.rst b/docs/user-guide/mdp-options.rst index 6a6fd20750..030c7bb637 100644 --- a/docs/user-guide/mdp-options.rst +++ b/docs/user-guide/mdp-options.rst @@ -2954,20 +2954,6 @@ Expanded Ensemble calculations Non-equilibrium MD ^^^^^^^^^^^^^^^^^^ -.. mdp:: acc-grps - - groups for constant acceleration (*e.g.* ``Protein Sol``) all atoms - in groups Protein and Sol will experience constant acceleration as - specified in the :mdp:`accelerate` line. (Deprecated) - -.. mdp:: accelerate - - (0) [nm ps\ :sup:`-2`] - acceleration for :mdp:`acc-grps`; x, y and z for each group - (*e.g.* ``0.1 0.0 0.0 -0.1 0.0 0.0`` means that first group has - constant acceleration of 0.1 nm ps\ :sup:`-2` in X direction, second group - the opposite). (Deprecated) - .. mdp:: freezegrps Groups that are to be frozen (*i.e.* their X, Y, and/or Z position diff --git a/src/gromacs/fileio/tpxio.cpp b/src/gromacs/fileio/tpxio.cpp index 568922aa44..6620f1d6db 100644 --- a/src/gromacs/fileio/tpxio.cpp +++ b/src/gromacs/fileio/tpxio.cpp @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team. - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -134,7 +134,8 @@ enum tpxv tpxv_StoreNonBondedInteractionExclusionGroup, /**< Store the non bonded interaction exclusion group in the topology */ tpxv_VSite1, /**< Added 1 type virtual site */ tpxv_MTS, /**< Added multiple time stepping */ - tpxv_Count /**< the total number of tpxv versions */ + tpxv_RemovedConstantAcceleration, /**< Removed support for constant acceleration NEMD. */ + tpxv_Count /**< the total number of tpxv versions */ }; /*! \brief Version number of the file format written to run input @@ -1548,7 +1549,11 @@ static void do_inputrec(gmx::ISerializer* serializer, t_inputrec* ir, int file_v { ir->opts.nhchainlength = 1; } - serializer->doInt(&ir->opts.ngacc); + int removedOptsNgacc = 0; + if (serializer->reading() && file_version < tpxv_RemovedConstantAcceleration) + { + serializer->doInt(&removedOptsNgacc); + } serializer->doInt(&ir->opts.ngfrz); serializer->doInt(&ir->opts.ngener); @@ -1562,7 +1567,6 @@ static void do_inputrec(gmx::ISerializer* serializer, t_inputrec* ir, int file_v snew(ir->opts.anneal_temp, ir->opts.ngtc); snew(ir->opts.tau_t, ir->opts.ngtc); snew(ir->opts.nFreeze, ir->opts.ngfrz); - snew(ir->opts.acc, ir->opts.ngacc); snew(ir->opts.egp_flags, ir->opts.ngener * ir->opts.ngener); } if (ir->opts.ngtc > 0) @@ -1575,9 +1579,18 @@ static void do_inputrec(gmx::ISerializer* serializer, t_inputrec* ir, int file_v { serializer->doIvecArray(ir->opts.nFreeze, ir->opts.ngfrz); } - if (ir->opts.ngacc > 0) + if (serializer->reading() && file_version < tpxv_RemovedConstantAcceleration && removedOptsNgacc > 0) { - serializer->doRvecArray(ir->opts.acc, ir->opts.ngacc); + std::vector dummy; + dummy.resize(removedOptsNgacc); + serializer->doRvecArray(reinterpret_cast(dummy.data()), removedOptsNgacc); + ir->useConstantAcceleration = std::any_of(dummy.begin(), dummy.end(), [](const gmx::RVec& vec) { + return vec[XX] != 0.0 || vec[YY] != 0.0 || vec[ZZ] != 0.0; + }); + } + else + { + ir->useConstantAcceleration = false; } serializer->doIntArray(ir->opts.egp_flags, ir->opts.ngener * ir->opts.ngener); @@ -2593,6 +2606,11 @@ static void do_mtop(gmx::ISerializer* serializer, gmx_mtop_t* mtop, int file_ver } do_groups(serializer, &mtop->groups, &(mtop->symtab)); + if (file_version < tpxv_RemovedConstantAcceleration) + { + mtop->groups.groups[SimulationAtomGroupType::AccelerationUnused].clear(); + mtop->groups.groupNumbers[SimulationAtomGroupType::AccelerationUnused].clear(); + } mtop->haveMoleculeIndices = true; diff --git a/src/gromacs/gmxpreprocess/grompp.cpp b/src/gromacs/gmxpreprocess/grompp.cpp index 9072de479c..441007676f 100644 --- a/src/gromacs/gmxpreprocess/grompp.cpp +++ b/src/gromacs/gmxpreprocess/grompp.cpp @@ -1743,9 +1743,7 @@ int gmx_grompp(int argc, char* argv[]) "Then a coordinate file is read and velocities can be generated", "from a Maxwellian distribution if requested.", "[THISMODULE] also reads parameters for [gmx-mdrun] ", - "(eg. number of MD steps, time step, cut-off), and others such as", - "NEMD parameters, which are corrected so that the net acceleration", - "is zero.", + "(eg. number of MD steps, time step, cut-off).", "Eventually a binary file is produced that can serve as the sole input", "file for the MD program.[PAR]", diff --git a/src/gromacs/gmxpreprocess/readir.cpp b/src/gromacs/gmxpreprocess/readir.cpp index 5456e16f63..499fbbd16b 100644 --- a/src/gromacs/gmxpreprocess/readir.cpp +++ b/src/gromacs/gmxpreprocess/readir.cpp @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2013,2014,2015,2016,2017, The GROMACS development team. - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -101,11 +101,10 @@ struct gmx_inputrec_strings { - char tcgrps[STRLEN], tau_t[STRLEN], ref_t[STRLEN], acc[STRLEN], accgrps[STRLEN], freeze[STRLEN], - frdim[STRLEN], energy[STRLEN], user1[STRLEN], user2[STRLEN], vcm[STRLEN], - x_compressed_groups[STRLEN], couple_moltype[STRLEN], orirefitgrp[STRLEN], - egptable[STRLEN], egpexcl[STRLEN], wall_atomtype[STRLEN], wall_density[STRLEN], - deform[STRLEN], QMMM[STRLEN], imd_grp[STRLEN]; + char tcgrps[STRLEN], tau_t[STRLEN], ref_t[STRLEN], freeze[STRLEN], frdim[STRLEN], + energy[STRLEN], user1[STRLEN], user2[STRLEN], vcm[STRLEN], x_compressed_groups[STRLEN], + couple_moltype[STRLEN], orirefitgrp[STRLEN], egptable[STRLEN], egpexcl[STRLEN], + wall_atomtype[STRLEN], wall_density[STRLEN], deform[STRLEN], QMMM[STRLEN], imd_grp[STRLEN]; char fep_lambda[efptNR][STRLEN]; char lambda_weights[STRLEN]; std::vector pullGroupNames; @@ -1729,33 +1728,6 @@ static void convertReals(warninp_t wi, gmx::ArrayRef inputs, } } -static void convertRvecs(warninp_t wi, gmx::ArrayRef inputs, const char* name, rvec* outputs) -{ - int i = 0, d = 0; - for (const auto& input : inputs) - { - try - { - outputs[i][d] = gmx::fromString(input); - } - catch (gmx::GromacsException&) - { - auto message = gmx::formatString( - "Invalid value for mdp option %s. %s should only consist of real numbers " - "separated by spaces.", - name, - name); - warning_error(wi, message); - } - ++d; - if (d == DIM) - { - d = 0; - ++i; - } - } -} - static void do_wall_params(t_inputrec* ir, char* wall_atomtype, char* wall_density, t_gromppopts* opts, warninp_t wi) { opts->wall_atomtype[0] = nullptr; @@ -2316,8 +2288,6 @@ void get_ir(const char* mdparin, /* Non-equilibrium MD stuff */ printStringNewline(&inp, "Non-equilibrium MD stuff"); - setStringEntry(&inp, "acc-grps", inputrecStrings->accgrps, nullptr); - setStringEntry(&inp, "accelerate", inputrecStrings->acc, nullptr); setStringEntry(&inp, "freezegrps", inputrecStrings->freeze, nullptr); setStringEntry(&inp, "freezedim", inputrecStrings->frdim, nullptr); ir->cos_accel = get_ereal(&inp, "cos-acceleration", 0, wi); @@ -3840,31 +3810,6 @@ void do_index(const char* mdparin, *defaultIndexGroups, gmx::arrayRefFromArray(gnames, defaultIndexGroups->nr)); notifier.preProcessingNotifications_.notify(defaultIndexGroupsAndNames); - auto accelerations = gmx::splitString(inputrecStrings->acc); - auto accelerationGroupNames = gmx::splitString(inputrecStrings->accgrps); - if (accelerationGroupNames.size() * DIM != accelerations.size()) - { - gmx_fatal(FARGS, - "Invalid Acceleration input: %zu groups and %zu acc. values", - accelerationGroupNames.size(), - accelerations.size()); - } - do_numbering(natoms, - groups, - accelerationGroupNames, - defaultIndexGroups, - gnames, - SimulationAtomGroupType::Acceleration, - restnm, - egrptpALL_GENREST, - bVerbose, - wi); - nr = groups->groups[SimulationAtomGroupType::Acceleration].size(); - snew(ir->opts.acc, nr); - ir->opts.ngacc = nr; - - convertRvecs(wi, accelerations, "anneal-time", ir->opts.acc); - auto freezeDims = gmx::splitString(inputrecStrings->frdim); auto freezeGroupNames = gmx::splitString(inputrecStrings->freeze); if (freezeDims.size() != DIM * freezeGroupNames.size()) @@ -4320,9 +4265,7 @@ void triple_check(const char* mdparin, t_inputrec* ir, gmx_mtop_t* sys, warninp_ char err_buf[STRLEN]; int i, m, c, nmol; - bool bCharge, bAcc; - real * mgrp, mt; - rvec acc; + bool bCharge; gmx_mtop_atomloop_block_t aloopb; ivec AbsRef; char warn_buf[STRLEN]; @@ -4522,60 +4465,6 @@ void triple_check(const char* mdparin, t_inputrec* ir, gmx_mtop_t* sys, warninp_ "constant by hand."); } - bAcc = FALSE; - for (int i = 0; (i < gmx::ssize(sys->groups.groups[SimulationAtomGroupType::Acceleration])); i++) - { - for (m = 0; (m < DIM); m++) - { - if (fabs(ir->opts.acc[i][m]) > 1e-6) - { - bAcc = TRUE; - } - } - } - if (bAcc) - { - clear_rvec(acc); - snew(mgrp, sys->groups.groups[SimulationAtomGroupType::Acceleration].size()); - for (const AtomProxy atomP : AtomRange(*sys)) - { - const t_atom& local = atomP.atom(); - int i = atomP.globalAtomNumber(); - mgrp[getGroupType(sys->groups, SimulationAtomGroupType::Acceleration, i)] += local.m; - } - mt = 0.0; - for (i = 0; (i < gmx::ssize(sys->groups.groups[SimulationAtomGroupType::Acceleration])); i++) - { - for (m = 0; (m < DIM); m++) - { - acc[m] += ir->opts.acc[i][m] * mgrp[i]; - } - mt += mgrp[i]; - } - for (m = 0; (m < DIM); m++) - { - if (fabs(acc[m]) > 1e-6) - { - const char* dim[DIM] = { "X", "Y", "Z" }; - fprintf(stderr, - "Net Acceleration in %s direction, will %s be corrected\n", - dim[m], - ir->nstcomm != 0 ? "" : "not"); - if (ir->nstcomm != 0 && m < ndof_com(ir)) - { - acc[m] /= mt; - for (i = 0; - (i < gmx::ssize(sys->groups.groups[SimulationAtomGroupType::Acceleration])); - i++) - { - ir->opts.acc[i][m] -= acc[m]; - } - } - } - } - sfree(mgrp); - } - if (ir->efep != efepNO && ir->fepvals->sc_alpha != 0 && !gmx_within_tol(sys->ffparams.reppow, 12.0, 10 * GMX_DOUBLE_EPS)) { diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsDefineParametersWithValuesIncludingAssignment.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsDefineParametersWithValuesIncludingAssignment.xml index 62ebe479c8..58d37a7ef6 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsDefineParametersWithValuesIncludingAssignment.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsDefineParametersWithValuesIncludingAssignment.xml @@ -260,8 +260,6 @@ dh_hist_size = 0 dh_hist_spacing = 0.1 ; Non-equilibrium MD stuff -acc-grps = -accelerate = freezegrps = freezedim = cos-acceleration = 0 diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricField.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricField.xml index 773cc6ea53..8dd0919803 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricField.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricField.xml @@ -260,8 +260,6 @@ dh_hist_size = 0 dh_hist_spacing = 0.1 ; Non-equilibrium MD stuff -acc-grps = -accelerate = freezegrps = freezedim = cos-acceleration = 0 diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldOscillating.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldOscillating.xml index 569e772e55..bbefcc9748 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldOscillating.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldOscillating.xml @@ -260,8 +260,6 @@ dh_hist_size = 0 dh_hist_spacing = 0.1 ; Non-equilibrium MD stuff -acc-grps = -accelerate = freezegrps = freezedim = cos-acceleration = 0 diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldPulsed.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldPulsed.xml index 021975538d..8b21cdf5ef 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldPulsed.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsElectricFieldPulsed.xml @@ -260,8 +260,6 @@ dh_hist_size = 0 dh_hist_spacing = 0.1 ; Non-equilibrium MD stuff -acc-grps = -accelerate = freezegrps = freezedim = cos-acceleration = 0 diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsEmptyLines.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsEmptyLines.xml index 216f7dcd69..72c39c0c0e 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsEmptyLines.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsEmptyLines.xml @@ -260,8 +260,6 @@ dh_hist_size = 0 dh_hist_spacing = 0.1 ; Non-equilibrium MD stuff -acc-grps = -accelerate = freezegrps = freezedim = cos-acceleration = 0 diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsImplicitSolventNo.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsImplicitSolventNo.xml index 216f7dcd69..72c39c0c0e 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsImplicitSolventNo.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsImplicitSolventNo.xml @@ -260,8 +260,6 @@ dh_hist_size = 0 dh_hist_spacing = 0.1 ; Non-equilibrium MD stuff -acc-grps = -accelerate = freezegrps = freezedim = cos-acceleration = 0 diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsKeyWithoutValue.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsKeyWithoutValue.xml index 216f7dcd69..72c39c0c0e 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsKeyWithoutValue.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsKeyWithoutValue.xml @@ -260,8 +260,6 @@ dh_hist_size = 0 dh_hist_spacing = 0.1 ; Non-equilibrium MD stuff -acc-grps = -accelerate = freezegrps = freezedim = cos-acceleration = 0 diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsMimic.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsMimic.xml index 3aa77677fd..40e229819f 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsMimic.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_AcceptsMimic.xml @@ -260,8 +260,6 @@ dh_hist_size = 0 dh_hist_spacing = 0.1 ; Non-equilibrium MD stuff -acc-grps = -accelerate = freezegrps = freezedim = cos-acceleration = 0 diff --git a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesDifferentKindsOfMdpLines.xml b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesDifferentKindsOfMdpLines.xml index 52c2a1f4f7..ed1446672a 100644 --- a/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesDifferentKindsOfMdpLines.xml +++ b/src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesDifferentKindsOfMdpLines.xml @@ -260,8 +260,6 @@ dh_hist_size = 0 dh_hist_spacing = 0.1 ; Non-equilibrium MD stuff -acc-grps = -accelerate = freezegrps = freezedim = cos-acceleration = 0 diff --git a/src/gromacs/mdlib/coupling.cpp b/src/gromacs/mdlib/coupling.cpp index fe145e8647..3f5e7b86c6 100644 --- a/src/gromacs/mdlib/coupling.cpp +++ b/src/gromacs/mdlib/coupling.cpp @@ -2039,55 +2039,20 @@ void vrescale_tcoupl(const t_inputrec* ir, int64_t step, gmx_ekindata_t* ekind, void rescale_velocities(const gmx_ekindata_t* ekind, const t_mdatoms* mdatoms, int start, int end, rvec v[]) { - unsigned short *cACC, *cTC; - int ga, gt, n, d; - real lg; - rvec vrel; - - cTC = mdatoms->cTC; - + const unsigned short* cTC = mdatoms->cTC; gmx::ArrayRef tcstat = ekind->tcstat; - if (ekind->bNEMD) + for (int n = start; n < end; n++) { - gmx::ArrayRef gstat = ekind->grpstat; - cACC = mdatoms->cACC; - - ga = 0; - gt = 0; - for (n = start; n < end; n++) + int gt = 0; + if (cTC) { - if (cACC) - { - ga = cACC[n]; - } - if (cTC) - { - gt = cTC[n]; - } - /* Only scale the velocity component relative to the COM velocity */ - rvec_sub(v[n], gstat[ga].u, vrel); - lg = tcstat[gt].lambda; - for (d = 0; d < DIM; d++) - { - v[n][d] = gstat[ga].u[d] + lg * vrel[d]; - } + gt = cTC[n]; } - } - else - { - gt = 0; - for (n = start; n < end; n++) + const real lg = tcstat[gt].lambda; + for (int d = 0; d < DIM; d++) { - if (cTC) - { - gt = cTC[n]; - } - lg = tcstat[gt].lambda; - for (d = 0; d < DIM; d++) - { - v[n][d] *= lg; - } + v[n][d] *= lg; } } } diff --git a/src/gromacs/mdlib/energyoutput.cpp b/src/gromacs/mdlib/energyoutput.cpp index 146d520b7d..f26716a3d2 100644 --- a/src/gromacs/mdlib/energyoutput.cpp +++ b/src/gromacs/mdlib/energyoutput.cpp @@ -518,29 +518,6 @@ EnergyOutput::EnergyOutput(ener_file* fp_ene, } sfree(grpnms); - nU_ = groups->groups[SimulationAtomGroupType::Acceleration].size(); - snew(tmp_v_, nU_); - if (nU_ > 1) - { - snew(grpnms, 3 * nU_); - for (i = 0; (i < nU_); i++) - { - ni = groups->groups[SimulationAtomGroupType::Acceleration][i]; - sprintf(buf, "Ux-%s", *(groups->groupNames[ni])); - grpnms[3 * i + XX] = gmx_strdup(buf); - sprintf(buf, "Uy-%s", *(groups->groupNames[ni])); - grpnms[3 * i + YY] = gmx_strdup(buf); - sprintf(buf, "Uz-%s", *(groups->groupNames[ni])); - grpnms[3 * i + ZZ] = gmx_strdup(buf); - } - iu_ = get_ebin_space(ebin_, 3 * nU_, grpnms, unit_vel); - for (i = 0; i < 3 * nU_; i++) - { - sfree(grpnms[i]); - } - sfree(grpnms); - } - /* Note that fp_ene should be valid on the master rank and null otherwise */ if (fp_ene != nullptr && startingBehavior != StartingBehavior::RestartWithAppending) { @@ -1055,15 +1032,6 @@ void EnergyOutput::addDataAtEnergyStep(bool bDoDHDL, } } - if (ekind && nU_ > 1) - { - for (int i = 0; (i < nU_); i++) - { - copy_rvec(ekind->grpstat[i].u, tmp_v_[i]); - } - add_ebin(ebin_, iu_, 3 * nU_, tmp_v_[0], bSum); - } - ebin_increase_count(1, ebin_, bSum); // BAR + thermodynamic integration values @@ -1434,17 +1402,6 @@ void EnergyOutput::printAverages(FILE* log, const SimulationGroups* groups) pr_ebin(log, ebin_, itemp_, nTC_, 4, eprAVER, true); fprintf(log, "\n"); } - if (nU_ > 1) - { - fprintf(log, "%15s %12s %12s %12s\n", "Group", "Ux", "Uy", "Uz"); - for (int i = 0; (i < nU_); i++) - { - int ni = groups->groups[SimulationAtomGroupType::Acceleration][i]; - fprintf(log, "%15s", *groups->groupNames[ni]); - pr_ebin(log, ebin_, iu_ + 3 * i, 3, 3, eprAVER, false); - } - fprintf(log, "\n"); - } } } diff --git a/src/gromacs/mdlib/energyoutput.h b/src/gromacs/mdlib/energyoutput.h index e0e2fa8571..91f8112c00 100644 --- a/src/gromacs/mdlib/energyoutput.h +++ b/src/gromacs/mdlib/energyoutput.h @@ -405,11 +405,6 @@ private: //! Index for scalling factor of MTTK int itcb_ = 0; - //! Number of acceleration groups - int nU_ = 0; - //! Index for group velocities - int iu_ = 0; - //! Array to accumulate values during update real* tmp_r_ = nullptr; //! Array to accumulate values during update diff --git a/src/gromacs/mdlib/md_support.cpp b/src/gromacs/mdlib/md_support.cpp index fc82226bfb..1f88c871db 100644 --- a/src/gromacs/mdlib/md_support.cpp +++ b/src/gromacs/mdlib/md_support.cpp @@ -88,18 +88,14 @@ static void calc_ke_part_normal(gmx::ArrayRef v, gmx_bool bEkinAveVel) { int g; - gmx::ArrayRef tcstat = ekind->tcstat; - gmx::ArrayRef grpstat = ekind->grpstat; + gmx::ArrayRef tcstat = ekind->tcstat; /* three main: VV with AveVel, vv with AveEkin, leap with AveEkin. Leap with AveVel is also an option, but not supported now. bEkinAveVel: If TRUE, we sum into ekin, if FALSE, into ekinh. */ - /* group velocities are calculated in update_ekindata and - * accumulated in acumulate_groups. - * Now the partial global and groups ekin. - */ + // Now accumulate the partial global and groups ekin. for (g = 0; (g < opts->ngtc); g++) { copy_mat(tcstat[g].ekinh, tcstat[g].ekinh_old); @@ -123,8 +119,7 @@ static void calc_ke_part_normal(gmx::ArrayRef v, // or memory allocation. It should not be able to throw, so for now // we do not need a try/catch wrapper. int start_t, end_t, n; - int ga, gt; - rvec v_corrt; + int gt; real hm; int d, m; matrix* ekin_sum; @@ -142,35 +137,26 @@ static void calc_ke_part_normal(gmx::ArrayRef v, } *dekindl_sum = 0.0; - ga = 0; gt = 0; for (n = start_t; n < end_t; n++) { - if (md->cACC) - { - ga = md->cACC[n]; - } if (md->cTC) { gt = md->cTC[n]; } hm = 0.5 * md->massT[n]; - for (d = 0; (d < DIM); d++) - { - v_corrt[d] = v[n][d] - grpstat[ga].u[d]; - } for (d = 0; (d < DIM); d++) { for (m = 0; (m < DIM); m++) { - /* if we're computing a full step velocity, v_corrt[d] has v(t). Otherwise, v(t+dt/2) */ - ekin_sum[gt][m][d] += hm * v_corrt[m] * v_corrt[d]; + /* if we're computing a full step velocity, v[d] has v(t). Otherwise, v(t+dt/2) */ + ekin_sum[gt][m][d] += hm * v[n][m] * v[n][d]; } } if (md->nMassPerturbed && md->bPerturbed[n]) { - *dekindl_sum += 0.5 * (md->massB[n] - md->massA[n]) * iprod(v_corrt, v_corrt); + *dekindl_sum += 0.5 * (md->massB[n] - md->massA[n]) * iprod(v[n], v[n]); } } } @@ -346,14 +332,6 @@ void compute_globals(gmx_global_stat* gstat, if (bTemp) { - /* Non-equilibrium MD: this is parallellized, but only does communication - * when there really is NEMD. - */ - - if (PAR(cr) && (ekind->bNEMD)) - { - accumulate_u(cr, &(ir->opts), ekind); - } if (!bReadEkin) { calc_ke_part(x, v, box, &(ir->opts), mdatoms, ekind, nrnb, bEkinAveVel); diff --git a/src/gromacs/mdlib/mdatoms.cpp b/src/gromacs/mdlib/mdatoms.cpp index 787a711f73..ff28562028 100644 --- a/src/gromacs/mdlib/mdatoms.cpp +++ b/src/gromacs/mdlib/mdatoms.cpp @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2012,2013,2014,2015,2016 by the GROMACS development team. - * Copyright (c) 2017,2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2017,2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -87,7 +87,6 @@ MDAtoms::~MDAtoms() sfree(mdatoms_->ptype); sfree(mdatoms_->cTC); sfree(mdatoms_->cENER); - sfree(mdatoms_->cACC); sfree(mdatoms_->cFREEZE); sfree(mdatoms_->cVCM); sfree(mdatoms_->cORF); @@ -289,10 +288,6 @@ void atoms2md(const gmx_mtop_t* mtop, /* We always copy cTC with domain decomposition */ } srenew(md->cENER, md->nalloc); - if (opts->ngacc > 1) - { - srenew(md->cACC, md->nalloc); - } if (opts->nFreeze && (opts->ngfrz > 1 || opts->nFreeze[0][XX] || opts->nFreeze[0][YY] || opts->nFreeze[0][ZZ])) { @@ -480,10 +475,6 @@ void atoms2md(const gmx_mtop_t* mtop, md->cTC[i] = groups.groupNumbers[SimulationAtomGroupType::TemperatureCoupling][ag]; } md->cENER[i] = getGroupType(groups, SimulationAtomGroupType::EnergyOutput, ag); - if (md->cACC) - { - md->cACC[i] = groups.groupNumbers[SimulationAtomGroupType::Acceleration][ag]; - } if (md->cVCM) { md->cVCM[i] = groups.groupNumbers[SimulationAtomGroupType::MassCenterVelocityRemoval][ag]; diff --git a/src/gromacs/mdlib/tests/energyoutput.cpp b/src/gromacs/mdlib/tests/energyoutput.cpp index 0d70031606..b6937b19c5 100644 --- a/src/gromacs/mdlib/tests/energyoutput.cpp +++ b/src/gromacs/mdlib/tests/energyoutput.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -320,10 +320,6 @@ public: mtop_.groups.groups[SimulationAtomGroupType::TemperatureCoupling][1] = 1; mtop_.groups.groups[SimulationAtomGroupType::TemperatureCoupling][2] = 2; - mtop_.groups.groups[SimulationAtomGroupType::Acceleration].resize(2); - mtop_.groups.groups[SimulationAtomGroupType::Acceleration][0] = 0; - mtop_.groups.groups[SimulationAtomGroupType::Acceleration][1] = 2; - // Nose-Hoover chains inputrec_.bPrintNHChains = true; inputrec_.opts.nhchainlength = 2; @@ -344,7 +340,6 @@ public: // Kinetic energy and related data ekindata_.tcstat.resize(mtop_.groups.groups[SimulationAtomGroupType::TemperatureCoupling].size()); - ekindata_.grpstat.resize(mtop_.groups.groups[SimulationAtomGroupType::Acceleration].size()); // This is needed so that the ebin space will be allocated inputrec_.cos_accel = 1.0; @@ -435,12 +430,9 @@ public: tcstat.T = (*testValue += 0.1); tcstat.lambda = (*testValue += 0.1); } - for (auto& grpstat : ekindata_.grpstat) - { - grpstat.u[XX] = (*testValue += 0.1); - grpstat.u[YY] = (*testValue += 0.1); - grpstat.u[ZZ] = (*testValue += 0.1); - } + // Removing constant acceleration removed a total increment of 0.6 + // To avoid unnecessary changes in reference data, we keep the increment + (*testValue += 0.6); // This conditional is to check whether the ebin was allocated. // Otherwise it will print cosacc data into the first bin. diff --git a/src/gromacs/mdlib/tests/leapfrogtestdata.cpp b/src/gromacs/mdlib/tests/leapfrogtestdata.cpp index 2725e3dd0c..be38a6b971 100644 --- a/src/gromacs/mdlib/tests/leapfrogtestdata.cpp +++ b/src/gromacs/mdlib/tests/leapfrogtestdata.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -167,7 +167,6 @@ LeapFrogTestData::LeapFrogTestData(int numAtoms, state_.box[ZZ][YY] = 0.0; state_.box[ZZ][ZZ] = 10.0; - kineticEnergyData_.bNEMD = false; kineticEnergyData_.cosacc.cos_accel = 0.0; kineticEnergyData_.nthreads = 1; diff --git a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_0.xml b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_0.xml index 9704ea6063..f100a6bc7f 100644 --- a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_0.xml +++ b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_0.xml @@ -3,7 +3,7 @@ - 97 + 91 LJ-14 kJ/mol @@ -368,30 +368,6 @@ T-Lipid K - - Ux-Protein - nm/ps - - - Uy-Protein - nm/ps - - - Uz-Protein - nm/ps - - - Ux-Lipid - nm/ps - - - Uy-Lipid - nm/ps - - - Uz-Lipid - nm/ps - 1 @@ -401,7 +377,7 @@ 0 0 - 97 + 91 LJ-14 11.499999999999995 @@ -766,35 +742,11 @@ T-Lipid 18.000000000000007 - - Ux-Protein - 18.20000000000001 - - - Uy-Protein - 18.300000000000011 - - - Uz-Protein - 18.400000000000013 - - - Ux-Lipid - 18.500000000000014 - - - Uy-Lipid - 18.600000000000016 - - - Uz-Lipid - 18.700000000000017 - - 97 + 91 Current ref_t for group Water: 25.7 Current ref_t for group Lipid: 25.8 @@ -865,9 +817,5 @@ Protein-Protein 1.31000e+01 1.32000e+01 1.34000e+01 1.35000e+01 T-Protein T-Water T-Lipid 1.76000e+01 1.78000e+01 1.80000e+01 - Group Ux Uy Uz - Protein 1.82000e+01 1.83000e+01 1.84000e+01 - Lipid 1.85000e+01 1.86000e+01 1.87000e+01 - diff --git a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_1.xml b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_1.xml index 20cd6bec07..ac633a4567 100644 --- a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_1.xml +++ b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_1.xml @@ -3,7 +3,7 @@ - 51 + 45 LJ-14 kJ/mol @@ -184,30 +184,6 @@ LJ-14:Lipid-Lipid kJ/mol - - Ux-Protein - nm/ps - - - Uy-Protein - nm/ps - - - Uz-Protein - nm/ps - - - Ux-Lipid - nm/ps - - - Uy-Lipid - nm/ps - - - Uz-Lipid - nm/ps - 1 @@ -217,7 +193,7 @@ 0 0 - 51 + 45 LJ-14 11.499999999999995 @@ -398,35 +374,11 @@ LJ-14:Lipid-Lipid 17.5 - - Ux-Protein - 18.20000000000001 - - - Uy-Protein - 18.300000000000011 - - - Uz-Protein - 18.400000000000013 - - - Ux-Lipid - 18.500000000000014 - - - Uy-Lipid - 18.600000000000016 - - - Uz-Lipid - 18.700000000000017 - - 51 + 45 Current ref_t for group Water: 25.7 Current ref_t for group Lipid: 25.8 @@ -470,9 +422,5 @@ Protein-Protein 1.31000e+01 1.32000e+01 1.34000e+01 1.35000e+01 Water-Lipid 1.56000e+01 1.57000e+01 1.59000e+01 1.60000e+01 Lipid-Lipid 1.71000e+01 1.72000e+01 1.74000e+01 1.75000e+01 - Group Ux Uy Uz - Protein 1.82000e+01 1.83000e+01 1.84000e+01 - Lipid 1.85000e+01 1.86000e+01 1.87000e+01 - diff --git a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_10.xml b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_10.xml index d7bf6a3dd5..e7d41dbf15 100644 --- a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_10.xml +++ b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_10.xml @@ -3,7 +3,7 @@ - 108 + 102 LJ-14 kJ/mol @@ -412,30 +412,6 @@ T-Lipid K - - Ux-Protein - nm/ps - - - Uy-Protein - nm/ps - - - Uz-Protein - nm/ps - - - Ux-Lipid - nm/ps - - - Uy-Lipid - nm/ps - - - Uz-Lipid - nm/ps - 1 @@ -445,7 +421,7 @@ 0 0 - 108 + 102 LJ-14 11.499999999999995 @@ -854,35 +830,11 @@ T-Lipid 18.000000000000007 - - Ux-Protein - 18.20000000000001 - - - Uy-Protein - 18.300000000000011 - - - Uz-Protein - 18.400000000000013 - - - Ux-Lipid - 18.500000000000014 - - - Uy-Lipid - 18.600000000000016 - - - Uz-Lipid - 18.700000000000017 - - 108 + 102 Current ref_t for group Water: 25.7 Current ref_t for group Lipid: 25.8 @@ -956,9 +908,5 @@ Protein-Protein 1.31000e+01 1.32000e+01 1.34000e+01 1.35000e+01 T-Protein T-Water T-Lipid 1.76000e+01 1.78000e+01 1.80000e+01 - Group Ux Uy Uz - Protein 1.82000e+01 1.83000e+01 1.84000e+01 - Lipid 1.85000e+01 1.86000e+01 1.87000e+01 - diff --git a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_2.xml b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_2.xml index 9704ea6063..f100a6bc7f 100644 --- a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_2.xml +++ b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_2.xml @@ -3,7 +3,7 @@ - 97 + 91 LJ-14 kJ/mol @@ -368,30 +368,6 @@ T-Lipid K - - Ux-Protein - nm/ps - - - Uy-Protein - nm/ps - - - Uz-Protein - nm/ps - - - Ux-Lipid - nm/ps - - - Uy-Lipid - nm/ps - - - Uz-Lipid - nm/ps - 1 @@ -401,7 +377,7 @@ 0 0 - 97 + 91 LJ-14 11.499999999999995 @@ -766,35 +742,11 @@ T-Lipid 18.000000000000007 - - Ux-Protein - 18.20000000000001 - - - Uy-Protein - 18.300000000000011 - - - Uz-Protein - 18.400000000000013 - - - Ux-Lipid - 18.500000000000014 - - - Uy-Lipid - 18.600000000000016 - - - Uz-Lipid - 18.700000000000017 - - 97 + 91 Current ref_t for group Water: 25.7 Current ref_t for group Lipid: 25.8 @@ -865,9 +817,5 @@ Protein-Protein 1.31000e+01 1.32000e+01 1.34000e+01 1.35000e+01 T-Protein T-Water T-Lipid 1.76000e+01 1.78000e+01 1.80000e+01 - Group Ux Uy Uz - Protein 1.82000e+01 1.83000e+01 1.84000e+01 - Lipid 1.85000e+01 1.86000e+01 1.87000e+01 - diff --git a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_3.xml b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_3.xml index 3484d5fcbb..5376fc9a0a 100644 --- a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_3.xml +++ b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_3.xml @@ -1,7 +1,7 @@ - 97 + 91 Current ref_t for group Water: 0.0 Current ref_t for group Lipid: 0.0 diff --git a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_4.xml b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_4.xml index 783bbe699a..efc4d8958b 100644 --- a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_4.xml +++ b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_4.xml @@ -3,7 +3,7 @@ - 97 + 91 LJ-14 kJ/mol @@ -368,30 +368,6 @@ T-Lipid K - - Ux-Protein - nm/ps - - - Uy-Protein - nm/ps - - - Uz-Protein - nm/ps - - - Ux-Lipid - nm/ps - - - Uy-Lipid - nm/ps - - - Uz-Lipid - nm/ps - 10 @@ -401,7 +377,7 @@ 0 0 - 97 + 91 LJ-14 11.499999999999995 @@ -766,30 +742,6 @@ T-Lipid 18.000000000000007 - - Ux-Protein - 18.20000000000001 - - - Uy-Protein - 18.300000000000011 - - - Uz-Protein - 18.400000000000013 - - - Ux-Lipid - 18.500000000000014 - - - Uy-Lipid - 18.600000000000016 - - - Uz-Lipid - 18.700000000000017 - @@ -798,7 +750,7 @@ 100 0 - 97 + 91 LJ-14 28.900000000000162 @@ -1163,30 +1115,6 @@ T-Lipid 35.400000000000254 - - Ux-Protein - 35.600000000000257 - - - Uy-Protein - 35.700000000000259 - - - Uz-Protein - 35.80000000000026 - - - Ux-Lipid - 35.900000000000261 - - - Uy-Lipid - 36.000000000000263 - - - Uz-Lipid - 36.100000000000264 - @@ -1195,7 +1123,7 @@ 200 0 - 97 + 91 LJ-14 46.300000000000409 @@ -1560,30 +1488,6 @@ T-Lipid 52.800000000000502 - - Ux-Protein - 53.000000000000504 - - - Uy-Protein - 53.100000000000506 - - - Uz-Protein - 53.200000000000507 - - - Ux-Lipid - 53.300000000000509 - - - Uy-Lipid - 53.40000000000051 - - - Uz-Lipid - 53.500000000000512 - @@ -1592,7 +1496,7 @@ 300 0 - 97 + 91 LJ-14 63.700000000000657 @@ -1957,30 +1861,6 @@ T-Lipid 70.200000000000301 - - Ux-Protein - 70.40000000000029 - - - Uy-Protein - 70.500000000000284 - - - Uz-Protein - 70.600000000000279 - - - Ux-Lipid - 70.700000000000273 - - - Uy-Lipid - 70.800000000000267 - - - Uz-Lipid - 70.900000000000261 - @@ -1989,7 +1869,7 @@ 400 0 - 97 + 91 LJ-14 81.099999999999682 @@ -2354,30 +2234,6 @@ T-Lipid 87.599999999999312 - - Ux-Protein - 87.799999999999301 - - - Uy-Protein - 87.899999999999295 - - - Uz-Protein - 87.999999999999289 - - - Ux-Lipid - 88.099999999999284 - - - Uy-Lipid - 88.199999999999278 - - - Uz-Lipid - 88.299999999999272 - @@ -2386,7 +2242,7 @@ 500 0 - 97 + 91 LJ-14 98.499999999998693 @@ -2751,30 +2607,6 @@ T-Lipid 104.99999999999832 - - Ux-Protein - 105.19999999999831 - - - Uy-Protein - 105.29999999999831 - - - Uz-Protein - 105.3999999999983 - - - Ux-Lipid - 105.49999999999829 - - - Uy-Lipid - 105.59999999999829 - - - Uz-Lipid - 105.69999999999828 - @@ -2783,7 +2615,7 @@ 600 0 - 97 + 91 LJ-14 115.8999999999977 @@ -3148,30 +2980,6 @@ T-Lipid 122.39999999999733 - - Ux-Protein - 122.59999999999732 - - - Uy-Protein - 122.69999999999732 - - - Uz-Protein - 122.79999999999731 - - - Ux-Lipid - 122.89999999999731 - - - Uy-Lipid - 122.9999999999973 - - - Uz-Lipid - 123.09999999999729 - @@ -3180,7 +2988,7 @@ 700 0 - 97 + 91 LJ-14 133.29999999999671 @@ -3545,30 +3353,6 @@ T-Lipid 139.79999999999634 - - Ux-Protein - 139.99999999999633 - - - Uy-Protein - 140.09999999999633 - - - Uz-Protein - 140.19999999999632 - - - Ux-Lipid - 140.29999999999632 - - - Uy-Lipid - 140.39999999999631 - - - Uz-Lipid - 140.49999999999631 - @@ -3577,7 +3361,7 @@ 800 0 - 97 + 91 LJ-14 150.69999999999573 @@ -3942,30 +3726,6 @@ T-Lipid 157.19999999999536 - - Ux-Protein - 157.39999999999534 - - - Uy-Protein - 157.49999999999534 - - - Uz-Protein - 157.59999999999533 - - - Ux-Lipid - 157.69999999999533 - - - Uy-Lipid - 157.79999999999532 - - - Uz-Lipid - 157.89999999999532 - @@ -3974,7 +3734,7 @@ 900 0 - 97 + 91 LJ-14 168.09999999999474 @@ -4339,35 +4099,11 @@ T-Lipid 174.59999999999437 - - Ux-Protein - 174.79999999999436 - - - Uy-Protein - 174.89999999999435 - - - Uz-Protein - 174.99999999999434 - - - Ux-Lipid - 175.09999999999434 - - - Uy-Lipid - 175.19999999999433 - - - Uz-Lipid - 175.29999999999433 - - 97 + 91 Current ref_t for group Water: 25.7 Current ref_t for group Lipid: 25.8 @@ -4573,9 +4309,5 @@ Protein-Protein 9.14000e+01 9.15000e+01 9.17000e+01 9.18000e+01 T-Protein T-Water T-Lipid 9.59000e+01 9.61000e+01 9.63000e+01 - Group Ux Uy Uz - Protein 9.65000e+01 9.66000e+01 9.67000e+01 - Lipid 9.68000e+01 9.69000e+01 9.70000e+01 - diff --git a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_5.xml b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_5.xml index 0fcc9ee95f..43e5ca6aeb 100644 --- a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_5.xml +++ b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_5.xml @@ -3,7 +3,7 @@ - 101 + 95 LJ-14 kJ/mol @@ -384,30 +384,6 @@ Lamb-Lipid - - Ux-Protein - nm/ps - - - Uy-Protein - nm/ps - - - Uz-Protein - nm/ps - - - Ux-Lipid - nm/ps - - - Uy-Lipid - nm/ps - - - Uz-Lipid - nm/ps - 1 @@ -417,7 +393,7 @@ 0 0 - 101 + 95 LJ-14 11.499999999999995 @@ -798,35 +774,11 @@ Lamb-Lipid 18.100000000000009 - - Ux-Protein - 18.20000000000001 - - - Uy-Protein - 18.300000000000011 - - - Uz-Protein - 18.400000000000013 - - - Ux-Lipid - 18.500000000000014 - - - Uy-Lipid - 18.600000000000016 - - - Uz-Lipid - 18.700000000000017 - - 101 + 95 Current ref_t for group Water: 25.7 Current ref_t for group Lipid: 25.8 @@ -897,9 +849,5 @@ Protein-Protein 1.31000e+01 1.32000e+01 1.34000e+01 1.35000e+01 T-Protein T-Water T-Lipid 1.76000e+01 1.78000e+01 1.80000e+01 - Group Ux Uy Uz - Protein 1.82000e+01 1.83000e+01 1.84000e+01 - Lipid 1.85000e+01 1.86000e+01 1.87000e+01 - diff --git a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_6.xml b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_6.xml index 03554d894a..73ca7a122f 100644 --- a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_6.xml +++ b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_6.xml @@ -3,7 +3,7 @@ - 104 + 98 LJ-14 kJ/mol @@ -396,30 +396,6 @@ vXi-Lipid 1/ps - - Ux-Protein - nm/ps - - - Uy-Protein - nm/ps - - - Uz-Protein - nm/ps - - - Ux-Lipid - nm/ps - - - Uy-Lipid - nm/ps - - - Uz-Lipid - nm/ps - 1 @@ -429,7 +405,7 @@ 0 0 - 104 + 98 LJ-14 11.499999999999995 @@ -822,35 +798,11 @@ vXi-Lipid 26.400000000000126 - - Ux-Protein - 18.20000000000001 - - - Uy-Protein - 18.300000000000011 - - - Uz-Protein - 18.400000000000013 - - - Ux-Lipid - 18.500000000000014 - - - Uy-Lipid - 18.600000000000016 - - - Uz-Lipid - 18.700000000000017 - - 104 + 98 Current ref_t for group Water: 25.7 Current ref_t for group Lipid: 25.8 @@ -921,9 +873,5 @@ Protein-Protein 1.31000e+01 1.32000e+01 1.34000e+01 1.35000e+01 T-Protein T-Water T-Lipid 1.76000e+01 1.78000e+01 1.80000e+01 - Group Ux Uy Uz - Protein 1.82000e+01 1.83000e+01 1.84000e+01 - Lipid 1.85000e+01 1.86000e+01 1.87000e+01 - diff --git a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_7.xml b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_7.xml index d7bf6a3dd5..e7d41dbf15 100644 --- a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_7.xml +++ b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_7.xml @@ -3,7 +3,7 @@ - 108 + 102 LJ-14 kJ/mol @@ -412,30 +412,6 @@ T-Lipid K - - Ux-Protein - nm/ps - - - Uy-Protein - nm/ps - - - Uz-Protein - nm/ps - - - Ux-Lipid - nm/ps - - - Uy-Lipid - nm/ps - - - Uz-Lipid - nm/ps - 1 @@ -445,7 +421,7 @@ 0 0 - 108 + 102 LJ-14 11.499999999999995 @@ -854,35 +830,11 @@ T-Lipid 18.000000000000007 - - Ux-Protein - 18.20000000000001 - - - Uy-Protein - 18.300000000000011 - - - Uz-Protein - 18.400000000000013 - - - Ux-Lipid - 18.500000000000014 - - - Uy-Lipid - 18.600000000000016 - - - Uz-Lipid - 18.700000000000017 - - 108 + 102 Current ref_t for group Water: 25.7 Current ref_t for group Lipid: 25.8 @@ -956,9 +908,5 @@ Protein-Protein 1.31000e+01 1.32000e+01 1.34000e+01 1.35000e+01 T-Protein T-Water T-Lipid 1.76000e+01 1.78000e+01 1.80000e+01 - Group Ux Uy Uz - Protein 1.82000e+01 1.83000e+01 1.84000e+01 - Lipid 1.85000e+01 1.86000e+01 1.87000e+01 - diff --git a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_8.xml b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_8.xml index d7bf6a3dd5..e7d41dbf15 100644 --- a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_8.xml +++ b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_8.xml @@ -3,7 +3,7 @@ - 108 + 102 LJ-14 kJ/mol @@ -412,30 +412,6 @@ T-Lipid K - - Ux-Protein - nm/ps - - - Uy-Protein - nm/ps - - - Uz-Protein - nm/ps - - - Ux-Lipid - nm/ps - - - Uy-Lipid - nm/ps - - - Uz-Lipid - nm/ps - 1 @@ -445,7 +421,7 @@ 0 0 - 108 + 102 LJ-14 11.499999999999995 @@ -854,35 +830,11 @@ T-Lipid 18.000000000000007 - - Ux-Protein - 18.20000000000001 - - - Uy-Protein - 18.300000000000011 - - - Uz-Protein - 18.400000000000013 - - - Ux-Lipid - 18.500000000000014 - - - Uy-Lipid - 18.600000000000016 - - - Uz-Lipid - 18.700000000000017 - - 108 + 102 Current ref_t for group Water: 25.7 Current ref_t for group Lipid: 25.8 @@ -956,9 +908,5 @@ Protein-Protein 1.31000e+01 1.32000e+01 1.34000e+01 1.35000e+01 T-Protein T-Water T-Lipid 1.76000e+01 1.78000e+01 1.80000e+01 - Group Ux Uy Uz - Protein 1.82000e+01 1.83000e+01 1.84000e+01 - Lipid 1.85000e+01 1.86000e+01 1.87000e+01 - diff --git a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_9.xml b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_9.xml index 9704ea6063..f100a6bc7f 100644 --- a/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_9.xml +++ b/src/gromacs/mdlib/tests/refdata/WithParameters_EnergyOutputTest_CheckOutput_9.xml @@ -3,7 +3,7 @@ - 97 + 91 LJ-14 kJ/mol @@ -368,30 +368,6 @@ T-Lipid K - - Ux-Protein - nm/ps - - - Uy-Protein - nm/ps - - - Uz-Protein - nm/ps - - - Ux-Lipid - nm/ps - - - Uy-Lipid - nm/ps - - - Uz-Lipid - nm/ps - 1 @@ -401,7 +377,7 @@ 0 0 - 97 + 91 LJ-14 11.499999999999995 @@ -766,35 +742,11 @@ T-Lipid 18.000000000000007 - - Ux-Protein - 18.20000000000001 - - - Uy-Protein - 18.300000000000011 - - - Uz-Protein - 18.400000000000013 - - - Ux-Lipid - 18.500000000000014 - - - Uy-Lipid - 18.600000000000016 - - - Uz-Lipid - 18.700000000000017 - - 97 + 91 Current ref_t for group Water: 25.7 Current ref_t for group Lipid: 25.8 @@ -865,9 +817,5 @@ Protein-Protein 1.31000e+01 1.32000e+01 1.34000e+01 1.35000e+01 T-Protein T-Water T-Lipid 1.76000e+01 1.78000e+01 1.80000e+01 - Group Ux Uy Uz - Protein 1.82000e+01 1.83000e+01 1.84000e+01 - Lipid 1.85000e+01 1.86000e+01 1.87000e+01 - diff --git a/src/gromacs/mdlib/tgroup.cpp b/src/gromacs/mdlib/tgroup.cpp index 3505a1a1ea..1fccc924fe 100644 --- a/src/gromacs/mdlib/tgroup.cpp +++ b/src/gromacs/mdlib/tgroup.cpp @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team. - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -57,43 +57,10 @@ #include "gromacs/utility/futil.h" #include "gromacs/utility/smalloc.h" -static void init_grpstat(const gmx_mtop_t* mtop, int ngacc, t_grp_acc gstat[]) -{ - if (ngacc > 0) - { - const SimulationGroups& groups = mtop->groups; - for (const AtomProxy atomP : AtomRange(*mtop)) - { - const t_atom& local = atomP.atom(); - int i = atomP.globalAtomNumber(); - int grp = getGroupType(groups, SimulationAtomGroupType::Acceleration, i); - if ((grp < 0) && (grp >= ngacc)) - { - gmx_incons("Input for acceleration groups wrong"); - } - gstat[grp].nat++; - /* This will not work for integrator BD */ - gstat[grp].mA += local.m; - gstat[grp].mB += local.mB; - } - } -} - -void init_ekindata(FILE gmx_unused* log, - const gmx_mtop_t* mtop, - const t_grpopts* opts, - gmx_ekindata_t* ekind, - real cos_accel) +void init_ekindata(FILE gmx_unused* log, const t_grpopts* opts, gmx_ekindata_t* ekind, real cos_accel) { int i; - /* bNEMD tells if we should remove remove the COM velocity - * from the velocities during velocity scaling in T-coupling. - * Turn this on when we have multiple acceleration groups - * or one accelerated group. - */ - ekind->bNEMD = (opts->ngacc > 1 || norm2(opts->acc[0]) > 0); - ekind->ngtc = opts->ngtc; ekind->tcstat.resize(opts->ngtc); /* Set Berendsen tcoupl lambda's to 1, @@ -135,83 +102,9 @@ void init_ekindata(FILE gmx_unused* log, GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR } - ekind->ngacc = opts->ngacc; - ekind->grpstat.resize(opts->ngacc); - init_grpstat(mtop, opts->ngacc, ekind->grpstat.data()); - ekind->cosacc.cos_accel = cos_accel; } -void accumulate_u(const t_commrec* cr, const t_grpopts* opts, gmx_ekindata_t* ekind) -{ - /* This routine will only be called when it's necessary */ - t_bin* rb; - int g; - - rb = mk_bin(); - - for (g = 0; (g < opts->ngacc); g++) - { - add_binr(rb, DIM, ekind->grpstat[g].u); - } - sum_bin(rb, cr); - - for (g = 0; (g < opts->ngacc); g++) - { - extract_binr(rb, DIM * g, DIM, ekind->grpstat[g].u); - } - destroy_bin(rb); -} - -void update_ekindata(int start, - int homenr, - gmx_ekindata_t* ekind, - const t_grpopts* opts, - const rvec v[], - const t_mdatoms* md, - real lambda) -{ - int d, g, n; - real mv; - - /* calculate mean velocities at whole timestep */ - for (g = 0; (g < opts->ngtc); g++) - { - ekind->tcstat[g].T = 0; - } - - if (ekind->bNEMD) - { - for (g = 0; (g < opts->ngacc); g++) - { - clear_rvec(ekind->grpstat[g].u); - } - - g = 0; - for (n = start; (n < start + homenr); n++) - { - if (md->cACC) - { - g = md->cACC[n]; - } - for (d = 0; (d < DIM); d++) - { - mv = md->massT[n] * v[n][d]; - ekind->grpstat[g].u[d] += mv; - } - } - - for (g = 0; (g < opts->ngacc); g++) - { - for (d = 0; (d < DIM); d++) - { - ekind->grpstat[g].u[d] /= - (1 - lambda) * ekind->grpstat[g].mA + lambda * ekind->grpstat[g].mB; - } - } - } -} - real sum_ekin(const t_grpopts* opts, gmx_ekindata_t* ekind, real* dekindlambda, gmx_bool bEkinAveVel, gmx_bool bScaleEkin) { int i, j, m, ngtc; diff --git a/src/gromacs/mdlib/tgroup.h b/src/gromacs/mdlib/tgroup.h index 11349251dc..1f9189414a 100644 --- a/src/gromacs/mdlib/tgroup.h +++ b/src/gromacs/mdlib/tgroup.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2018,2019,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -39,42 +39,23 @@ #include -#include "gromacs/math/vectypes.h" #include "gromacs/utility/basedefinitions.h" #include "gromacs/utility/real.h" struct gmx_ekindata_t; -struct gmx_mtop_t; struct t_commrec; struct t_grpopts; struct t_mdatoms; -void init_ekindata(FILE* log, const gmx_mtop_t* mtop, const t_grpopts* opts, gmx_ekindata_t* ekind, real cos_accel); +void init_ekindata(FILE* log, const t_grpopts* opts, gmx_ekindata_t* ekind, real cos_accel); /* Allocate memory and set the grpnr array. */ void done_ekindata(gmx_ekindata_t* ekind); /* Free the memory */ -void accumulate_u(const t_commrec* cr, const t_grpopts* opts, gmx_ekindata_t* ekind); - -/* Communicate subsystem - group velocities and subsystem ekin respectively - * and sum them up. Return them in grps. - */ - real sum_ekin(const t_grpopts* opts, gmx_ekindata_t* ekind, real* dekindlambda, gmx_bool bEkinFullStep, gmx_bool bScaleEkin); /* Sum the group ekins into total ekin and calc temp per group, * return total temperature. */ -void update_ekindata(int start, - int homenr, - gmx_ekindata_t* ekind, - const t_grpopts* opts, - const rvec v[], - const t_mdatoms* md, - real lambda); -/* Do the update of group velocities (if bNEMD) and - * (partial) group ekin. - */ - #endif diff --git a/src/gromacs/mdlib/update.cpp b/src/gromacs/mdlib/update.cpp index 9617f6e1a4..9a19ec08ac 100644 --- a/src/gromacs/mdlib/update.cpp +++ b/src/gromacs/mdlib/update.cpp @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team. - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -491,7 +491,6 @@ static void updateMDLeapfrogSimpleSimd(int start, enum class AccelerationType { none, - group, cosine }; @@ -504,7 +503,6 @@ enum class AccelerationType * \param[in] dt The time step. * \param[in] dtPressureCouple Time step for pressure coupling, is 0 when no pressure * coupling should be applied at this step. - * \param[in] accel Acceleration per group. * \param[in] md Atom properties. * \param[in] ekind Kinetic energy data. * \param[in] box The box dimensions. @@ -522,7 +520,6 @@ static void updateMDLeapfrogGeneral(int start, bool doNoseHoover, real dt, real dtPressureCouple, - const rvec* accel, const t_mdatoms* md, const gmx_ekindata_t* ekind, const matrix box, @@ -540,15 +537,12 @@ static void updateMDLeapfrogGeneral(int start, * Holian et al. Phys Rev E 52(3) : 2338, 1995 */ - gmx::ArrayRef tcstat = ekind->tcstat; - gmx::ArrayRef grpstat = ekind->grpstat; - const unsigned short* cTC = md->cTC; - const unsigned short* cACC = md->cACC; + gmx::ArrayRef tcstat = ekind->tcstat; + const unsigned short* cTC = md->cTC; const rvec* gmx_restrict invMassPerDim = md->invMassPerDim; /* Initialize group values, changed later when multiple groups are used */ - int ga = 0; int gt = 0; real omega_Z = 2 * static_cast(M_PI) / box[ZZ][ZZ]; @@ -569,14 +563,6 @@ static void updateMDLeapfrogGeneral(int start, switch (accelerationType) { case AccelerationType::none: copy_rvec(v[n], vRel); break; - case AccelerationType::group: - if (cACC) - { - ga = cACC[n]; - } - /* Avoid scaling the group velocity */ - rvec_sub(v[n], grpstat[ga].u, vRel); - break; case AccelerationType::cosine: cosineZ = std::cos(x[n][ZZ] * omega_Z); vCosine = cosineZ * ekind->cosacc.vcos; @@ -605,10 +591,6 @@ static void updateMDLeapfrogGeneral(int start, switch (accelerationType) { case AccelerationType::none: break; - case AccelerationType::group: - /* Add back the mean velocity and apply acceleration */ - vNew += grpstat[ga].u[d] + accel[ga][d] * dt; - break; case AccelerationType::cosine: if (d == XX) { @@ -632,7 +614,6 @@ static void do_update_md(int start, rvec* gmx_restrict xprime, rvec* gmx_restrict v, const rvec* gmx_restrict f, - const rvec* gmx_restrict accel, const int etc, const int epc, const int nsttcouple, @@ -655,8 +636,8 @@ static void do_update_md(int start, real dtPressureCouple = (doParrinelloRahman ? nstpcouple * dt : 0); - /* NEMD (also cosine) acceleration is applied in updateMDLeapFrogGeneral */ - bool doAcceleration = (ekind->bNEMD || ekind->cosacc.cos_accel != 0); + /* NEMD cosine acceleration is applied in updateMDLeapFrogGeneral */ + bool doAcceleration = (ekind->cosacc.cos_accel != 0); if (doNoseHoover || doPROffDiagonal || doAcceleration) { @@ -674,17 +655,12 @@ static void do_update_md(int start, if (!doAcceleration) { updateMDLeapfrogGeneral( - start, nrend, doNoseHoover, dt, dtPressureCouple, accel, md, ekind, box, x, xprime, v, f, nh_vxi, nsttcouple, stepM); - } - else if (ekind->bNEMD) - { - updateMDLeapfrogGeneral( - start, nrend, doNoseHoover, dt, dtPressureCouple, accel, md, ekind, box, x, xprime, v, f, nh_vxi, nsttcouple, stepM); + start, nrend, doNoseHoover, dt, dtPressureCouple, md, ekind, box, x, xprime, v, f, nh_vxi, nsttcouple, stepM); } else { updateMDLeapfrogGeneral( - start, nrend, doNoseHoover, dt, dtPressureCouple, accel, md, ekind, box, x, xprime, v, f, nh_vxi, nsttcouple, stepM); + start, nrend, doNoseHoover, dt, dtPressureCouple, md, ekind, box, x, xprime, v, f, nh_vxi, nsttcouple, stepM); } } else @@ -802,19 +778,17 @@ static void doUpdateMDDoNotUpdateVelocities(int start, static void do_update_vv_vel(int start, int nrend, real dt, - const rvec accel[], const ivec nFreeze[], const real invmass[], const unsigned short ptype[], const unsigned short cFREEZE[], - const unsigned short cACC[], rvec v[], const rvec f[], gmx_bool bExtended, real veta, real alpha) { - int gf = 0, ga = 0; + int gf = 0; int n, d; real g, mv1, mv2; @@ -836,16 +810,12 @@ static void do_update_vv_vel(int start, { gf = cFREEZE[n]; } - if (cACC) - { - ga = cACC[n]; - } for (d = 0; d < DIM; d++) { if ((ptype[n] != eptVSite) && (ptype[n] != eptShell) && !nFreeze[gf][d]) { - v[n][d] = mv1 * (mv1 * v[n][d] + 0.5 * (w_dt * mv2 * f[n][d])) + 0.5 * accel[ga][d] * dt; + v[n][d] = mv1 * (mv1 * v[n][d] + 0.5 * (w_dt * mv2 * f[n][d])); } else { @@ -1029,12 +999,10 @@ static void doSDUpdateGeneral(const gmx_stochd_t& sd, int start, int nrend, real dt, - const rvec accel[], const ivec nFreeze[], const real invmass[], const unsigned short ptype[], const unsigned short cFREEZE[], - const unsigned short cACC[], const unsigned short cTC[], const rvec x[], rvec xprime[], @@ -1044,7 +1012,7 @@ static void doSDUpdateGeneral(const gmx_stochd_t& sd, int seed, const int* gatindex) { - // cTC, cACC and cFREEZE can be nullptr any time, but various + // cTC and cFREEZE can be nullptr any time, but various // instantiations do not make sense with particular pointer // values. if (updateType == SDUpdate::ForcesOnly) @@ -1055,7 +1023,6 @@ static void doSDUpdateGeneral(const gmx_stochd_t& sd, if (updateType == SDUpdate::FrictionAndNoiseOnly) { GMX_ASSERT(f == nullptr, "SD update with only noise cannot handle forces"); - GMX_ASSERT(cACC == nullptr, "SD update with only noise cannot handle acceleration groups"); } if (updateType == SDUpdate::Combined) { @@ -1075,9 +1042,8 @@ static void doSDUpdateGeneral(const gmx_stochd_t& sd, real inverseMass = invmass[n]; real invsqrtMass = std::sqrt(inverseMass); - int freezeGroup = cFREEZE ? cFREEZE[n] : 0; - int accelerationGroup = cACC ? cACC[n] : 0; - int temperatureGroup = cTC ? cTC[n] : 0; + int freezeGroup = cFREEZE ? cFREEZE[n] : 0; + int temperatureGroup = cTC ? cTC[n] : 0; for (int d = 0; d < DIM; d++) { @@ -1085,7 +1051,7 @@ static void doSDUpdateGeneral(const gmx_stochd_t& sd, { if (updateType == SDUpdate::ForcesOnly) { - real vn = v[n][d] + (inverseMass * f[n][d] + accel[accelerationGroup][d]) * dt; + real vn = v[n][d] + inverseMass * f[n][d] * dt; v[n][d] = vn; // Simple position update. xprime[n][d] = x[n][d] + v[n][d] * dt; @@ -1102,7 +1068,7 @@ static void doSDUpdateGeneral(const gmx_stochd_t& sd, } else { - real vn = v[n][d] + (inverseMass * f[n][d] + accel[accelerationGroup][d]) * dt; + real vn = v[n][d] + inverseMass * f[n][d] * dt; v[n][d] = (vn * sd.sdc[temperatureGroup].em + invsqrtMass * sd.sdsig[temperatureGroup].V * dist(rng)); // Here we include half of the friction+noise @@ -1134,12 +1100,10 @@ static void do_update_sd(int start, rvec* gmx_restrict xprime, rvec* gmx_restrict v, const rvec* gmx_restrict f, - const rvec accel[], const ivec nFreeze[], const real invmass[], const unsigned short ptype[], const unsigned short cFREEZE[], - const unsigned short cACC[], const unsigned short cTC[], int seed, const t_commrec* cr, @@ -1150,7 +1114,7 @@ static void do_update_sd(int start, { // With constraints, the SD update is done in 2 parts doSDUpdateGeneral( - sd, start, nrend, dt, accel, nFreeze, invmass, ptype, cFREEZE, cACC, nullptr, x, xprime, v, f, step, seed, nullptr); + sd, start, nrend, dt, nFreeze, invmass, ptype, cFREEZE, nullptr, x, xprime, v, f, step, seed, nullptr); } else { @@ -1158,12 +1122,10 @@ static void do_update_sd(int start, start, nrend, dt, - accel, nFreeze, invmass, ptype, cFREEZE, - cACC, cTC, x, xprime, @@ -1399,12 +1361,10 @@ void Update::Impl::update_sd_second_half(const t_inputrec& inputRecord, start_th, end_th, dt, - inputRecord.opts.acc, inputRecord.opts.nFreeze, md->invmass, md->ptype, md->cFREEZE, - nullptr, md->cTC, state->x.rvec_array(), xp_.rvec_array(), @@ -1553,7 +1513,6 @@ void Update::Impl::update_coords(const t_inputrec& xp_rvec, v_rvec, f_rvec, - inputRecord.opts.acc, inputRecord.etc, inputRecord.epc, inputRecord.nsttcouple, @@ -1573,12 +1532,10 @@ void Update::Impl::update_coords(const t_inputrec& xp_rvec, v_rvec, f_rvec, - inputRecord.opts.acc, inputRecord.opts.nFreeze, md->invmass, md->ptype, md->cFREEZE, - md->cACC, md->cTC, inputRecord.ld_seed, cr, @@ -1619,12 +1576,10 @@ void Update::Impl::update_coords(const t_inputrec& do_update_vv_vel(start_th, end_th, dt, - inputRecord.opts.acc, inputRecord.opts.nFreeze, md->invmass, md->ptype, md->cFREEZE, - md->cACC, v_rvec, f_rvec, bExtended, diff --git a/src/gromacs/mdrun/runner.cpp b/src/gromacs/mdrun/runner.cpp index 6ce5fd61f8..943913668c 100644 --- a/src/gromacs/mdrun/runner.cpp +++ b/src/gromacs/mdrun/runner.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2011-2019,2020, by the GROMACS development team, led by + * Copyright (c) 2011-2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -905,6 +905,11 @@ int Mdrunner::mdrunner() GMX_RELEASE_ASSERT(inputrec != nullptr, "All ranks should have a valid inputrec now"); partialDeserializedTpr.reset(nullptr); + GMX_RELEASE_ASSERT( + !inputrec->useConstantAcceleration, + "Linear acceleration has been removed in GROMACS 2022, and was broken for many years " + "before that. Use GROMACS 4.5 or earlier if you need this feature."); + // Now the number of ranks is known to all ranks, and each knows // the inputrec read by the master rank. The ranks can now all run // the task-deciding functions and will agree on the result @@ -1843,7 +1848,7 @@ int Mdrunner::mdrunner() /* Kinetic energy data */ gmx_ekindata_t ekind; - init_ekindata(fplog, &mtop, &(inputrec->opts), &ekind, inputrec->cos_accel); + init_ekindata(fplog, &(inputrec->opts), &ekind, inputrec->cos_accel); /* Set up interactive MD (IMD) */ auto imdSession = makeImdSession(inputrec.get(), diff --git a/src/gromacs/mdrun/shellfc.cpp b/src/gromacs/mdrun/shellfc.cpp index 35853df4f3..9943027574 100644 --- a/src/gromacs/mdrun/shellfc.cpp +++ b/src/gromacs/mdrun/shellfc.cpp @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2008, The GROMACS development team. * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team. - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -876,7 +876,7 @@ static void init_adir(gmx_shellfc_t* shfc, dt = ir->delta_t; - /* Does NOT work with freeze or acceleration groups (yet) */ + /* Does NOT work with freeze groups (yet) */ for (n = 0; n < end; n++) { w_dt = md->invmass[n] * dt; diff --git a/src/gromacs/mdtypes/group.h b/src/gromacs/mdtypes/group.h index d39e7c8cb5..dcdb25414e 100644 --- a/src/gromacs/mdtypes/group.h +++ b/src/gromacs/mdtypes/group.h @@ -3,7 +3,7 @@ * * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. - * Copyright (c) 2013,2014,2015,2018,2019, by the GROMACS development team, led by + * Copyright (c) 2013,2014,2015,2018,2019,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -66,20 +66,6 @@ struct t_grp_tcstat double vscale_nhc = 0; }; -struct t_grp_acc -{ - //! Number of atoms in this group - int nat = 0; - //! Mean velocities of home particles - rvec u = { 0 }; - //! Previous mean velocities of home particles - rvec uold = { 0 }; - //! Mass for topology A - double mA = 0; - //! Mass for topology B - double mB = 0; -}; - struct t_cos_acc { //! The acceleration for the cosine profile @@ -92,8 +78,6 @@ struct t_cos_acc struct gmx_ekindata_t { - //! Whether non-equilibrium MD is active (ie. constant or cosine acceleration) - gmx_bool bNEMD; //! The number of T-coupling groups int ngtc = 0; //! For size of ekin_work @@ -106,10 +90,6 @@ struct gmx_ekindata_t tensor** ekin_work = nullptr; //! Work location for dekindl per thread real** dekindl_work = nullptr; - //! The number of acceleration groups - int ngacc = 0; - //! Acceleration data - std::vector grpstat; //! overall kinetic energy tensor ekin = { { 0 } }; //! overall 1/2 step kinetic energy diff --git a/src/gromacs/mdtypes/inputrec.cpp b/src/gromacs/mdtypes/inputrec.cpp index 7e9639a23f..ef67f95d5d 100644 --- a/src/gromacs/mdtypes/inputrec.cpp +++ b/src/gromacs/mdtypes/inputrec.cpp @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2010, The GROMACS development team. * Copyright (c) 2012,2014,2015,2016,2017 by the GROMACS development team. - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -319,7 +319,6 @@ void done_inputrec(t_inputrec* ir) sfree(ir->opts.anneal_time); sfree(ir->opts.anneal_temp); sfree(ir->opts.tau_t); - sfree(ir->opts.acc); sfree(ir->opts.nFreeze); sfree(ir->opts.egp_flags); done_lambdas(ir->fepvals); @@ -398,17 +397,6 @@ static void pr_grp_opts(FILE* out, int indent, const char* title, const t_grpopt } } - pr_indent(out, indent); - fprintf(out, "acc:\t"); - for (i = 0; (i < opts->ngacc); i++) - { - for (m = 0; (m < DIM); m++) - { - fprintf(out, " %10g", opts->acc[i][m]); - } - } - fprintf(out, "\n"); - pr_indent(out, indent); fprintf(out, "nfreeze:"); for (i = 0; (i < opts->ngfrz); i++) @@ -1068,7 +1056,6 @@ static void cmp_grpopts(FILE* fp, const t_grpopts* opt1, const t_grpopts* opt2, char buf1[256], buf2[256]; cmp_int(fp, "inputrec->grpopts.ngtc", -1, opt1->ngtc, opt2->ngtc); - cmp_int(fp, "inputrec->grpopts.ngacc", -1, opt1->ngacc, opt2->ngacc); cmp_int(fp, "inputrec->grpopts.ngfrz", -1, opt1->ngfrz, opt2->ngfrz); cmp_int(fp, "inputrec->grpopts.ngener", -1, opt1->ngener, opt2->ngener); for (i = 0; (i < std::min(opt1->ngtc, opt2->ngtc)); i++) @@ -1100,10 +1087,6 @@ static void cmp_grpopts(FILE* fp, const t_grpopts* opt1, const t_grpopts* opt2, } } } - for (i = 0; (i < std::min(opt1->ngacc, opt2->ngacc)); i++) - { - cmp_rvec(fp, "inputrec->grpopts.acc", i, opt1->acc[i], opt2->acc[i], ftol, abstol); - } for (i = 0; (i < std::min(opt1->ngfrz, opt2->ngfrz)); i++) { cmp_ivec(fp, "inputrec->grpopts.nFreeze", i, opt1->nFreeze[i], opt2->nFreeze[i]); diff --git a/src/gromacs/mdtypes/inputrec.h b/src/gromacs/mdtypes/inputrec.h index 46cb924592..996e6d30cf 100644 --- a/src/gromacs/mdtypes/inputrec.h +++ b/src/gromacs/mdtypes/inputrec.h @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team. - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -71,8 +71,6 @@ struct t_grpopts int ngtc; //! Number of of Nose-Hoover chains per group int nhchainlength; - //! Number of Accelerate groups - int ngacc; //! Number of Freeze groups int ngfrz; //! Number of Energy groups @@ -91,8 +89,6 @@ struct t_grpopts real** anneal_temp; //! Tau coupling time real* tau_t; - //! Acceleration per group - rvec* acc; //! Whether the group will be frozen in each direction ivec* nFreeze; //! Exclusions/tables of energy group pairs @@ -564,6 +560,8 @@ struct t_inputrec // NOLINT (clang-analyzer-optin.performance.Padding) gmx_bool bAdress; //! Whether twin-range scheme is active - always false if a valid .tpr was read gmx_bool useTwinRange; + //! Whether we have constant acceleration - removed in GROMACS 2022 + bool useConstantAcceleration; //! KVT object that contains input parameters converted to the new style. gmx::KeyValueTreeObject* params; diff --git a/src/gromacs/mdtypes/mdatom.h b/src/gromacs/mdtypes/mdatom.h index c8a41643e6..55d457f0af 100644 --- a/src/gromacs/mdtypes/mdatom.h +++ b/src/gromacs/mdtypes/mdatom.h @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2012,2013,2014,2015,2016 by the GROMACS development team. - * Copyright (c) 2017,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2017,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -116,8 +116,6 @@ typedef struct t_mdatoms unsigned short* cTC; //! Group index for energy matrix unsigned short* cENER; - //! Group index for acceleration - unsigned short* cACC; //! Group index for freezing unsigned short* cFREEZE; //! Group index for center of mass motion removal diff --git a/src/gromacs/modularsimulator/modularsimulator.cpp b/src/gromacs/modularsimulator/modularsimulator.cpp index f0bb4100b9..3109250f9b 100644 --- a/src/gromacs/modularsimulator/modularsimulator.cpp +++ b/src/gromacs/modularsimulator/modularsimulator.cpp @@ -1,7 +1,7 @@ /* * This file is part of the GROMACS molecular simulation package. * - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -253,9 +253,7 @@ bool ModularSimulator::isInputCompatible(bool exitOn "Pulling is not supported by the modular simulator."); isInputCompatible = isInputCompatible - && conditionalAssert(inputrec->opts.ngacc == 1 && inputrec->opts.acc[0][XX] == 0.0 - && inputrec->opts.acc[0][YY] == 0.0 - && inputrec->opts.acc[0][ZZ] == 0.0 && inputrec->cos_accel == 0.0, + && conditionalAssert(inputrec->cos_accel == 0.0, "Acceleration is not supported by the modular simulator."); isInputCompatible = isInputCompatible diff --git a/src/gromacs/tools/dump.cpp b/src/gromacs/tools/dump.cpp index a945fec149..e7c04fb9ef 100644 --- a/src/gromacs/tools/dump.cpp +++ b/src/gromacs/tools/dump.cpp @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2013, The GROMACS development team. * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team. - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -168,6 +168,10 @@ void list_tpr(const char* fn, { for (auto group : keysOf(gcount)) { + if (group == SimulationAtomGroupType::AccelerationUnused) + { + continue; + } gcount[group][getGroupType(groups, group, i)]++; } } diff --git a/src/gromacs/topology/topology.cpp b/src/gromacs/topology/topology.cpp index fc20e30d0d..807eb7de23 100644 --- a/src/gromacs/topology/topology.cpp +++ b/src/gromacs/topology/topology.cpp @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2013,2014,2015,2016,2017 by the GROMACS development team. - * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by + * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -58,7 +58,7 @@ static gmx::EnumerationArray c_simulationAtomGroupTypeShortNames = { { "T-Coupling", "Energy Mon.", - "Acceleration", + "Acc. not used", "Freeze", "User1", "User2", diff --git a/src/gromacs/topology/topology.h b/src/gromacs/topology/topology.h index cda4ec7e94..ed809ab418 100644 --- a/src/gromacs/topology/topology.h +++ b/src/gromacs/topology/topology.h @@ -4,7 +4,7 @@ * Copyright (c) 1991-2000, University of Groningen, The Netherlands. * Copyright (c) 2001-2004, The GROMACS development team. * Copyright (c) 2011,2014,2015,2016,2018, The GROMACS development team. - * Copyright (c) 2019,2020, by the GROMACS development team, led by + * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, * and including many others, as listed in the AUTHORS file in the * top-level source directory and at http://www.gromacs.org. @@ -56,7 +56,7 @@ enum class SimulationAtomGroupType : int { TemperatureCoupling, EnergyOutput, - Acceleration, + AccelerationUnused, Freeze, User1, User2, -- 2.22.0