From: Joe Jordan Date: Wed, 3 Nov 2021 06:24:23 +0000 (+0000) Subject: Remove unused thole polarization rfac parameter X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?p=alexxy%2Fgromacs.git;a=commitdiff_plain;h=34d6029f0f7e1b521b148eae4164d02e28911db5 Remove unused thole polarization rfac parameter --- diff --git a/src/gromacs/fileio/tpxio.cpp b/src/gromacs/fileio/tpxio.cpp index d190d663ed..f8b0ced58d 100644 --- a/src/gromacs/fileio/tpxio.cpp +++ b/src/gromacs/fileio/tpxio.cpp @@ -140,6 +140,7 @@ enum tpxv tpxv_TransformationPullCoord, /**< Support for transformation pull coordinates */ tpxv_SoftcoreGapsys, /**< Added gapsys softcore function */ tpxv_ReaddedConstantAcceleration, /**< Re-added support for constant acceleration NEMD. */ + tpxv_RemoveTholeRfac, /**< Remove unused rfac parameter from thole listed force */ tpxv_Count /**< the total number of tpxv versions */ }; @@ -1899,7 +1900,12 @@ static void do_iparams(gmx::ISerializer* serializer, t_functype ftype, t_iparams serializer->doReal(&iparams->thole.a); serializer->doReal(&iparams->thole.alpha1); serializer->doReal(&iparams->thole.alpha2); - serializer->doReal(&iparams->thole.rfac); + if (file_version < tpxv_RemoveTholeRfac) + { + real noRfac = 0; + serializer->doReal(&noRfac); + } + break; case F_LJ: serializer->doReal(&iparams->lj.c6); diff --git a/src/gromacs/gmxpreprocess/convparm.cpp b/src/gromacs/gmxpreprocess/convparm.cpp index 37b59f1eb5..e8e5fc897f 100644 --- a/src/gromacs/gmxpreprocess/convparm.cpp +++ b/src/gromacs/gmxpreprocess/convparm.cpp @@ -258,14 +258,6 @@ static int assign_param(t_functype ftype, newparam->thole.a = old[0]; newparam->thole.alpha1 = old[1]; newparam->thole.alpha2 = old[2]; - if ((old[1] > 0) && (old[2] > 0)) - { - newparam->thole.rfac = old[0] * gmx::invsixthroot(old[1] * old[2]); - } - else - { - newparam->thole.rfac = 1; - } break; case F_BHAM: newparam->bham.a = old[0]; diff --git a/src/gromacs/listed_forces/tests/bonded.cpp b/src/gromacs/listed_forces/tests/bonded.cpp index 6abade7c01..04bf2e1eb7 100644 --- a/src/gromacs/listed_forces/tests/bonded.cpp +++ b/src/gromacs/listed_forces/tests/bonded.cpp @@ -451,17 +451,15 @@ public: * \param[in] a Thole factor * \param[in] alpha1 Polarizability 1 (nm^3) * \param[in] alpha2 Polarizability 2 (nm^3) - * \param[in] rfac Distance factor * \return The structure itself. */ - iListInput setTholePolarization(real a, real alpha1, real alpha2, real rfac) + iListInput setTholePolarization(real a, real alpha1, real alpha2) { ftype = F_THOLE_POL; fep = false; iparams.thole.a = a; iparams.thole.alpha1 = alpha1; iparams.thole.alpha2 = alpha2; - iparams.thole.rfac = rfac; return *this; } /*! \brief Set parameters for Water Polarization @@ -708,7 +706,7 @@ std::vector c_InputDihs = { std::vector c_InputPols = { { iListInput(2e-5, 1e-8).setPolarization(0.12) }, { iListInput(2e-3, 1e-8).setAnharmPolarization(0.0013, 0.02, 1235.6) }, - { iListInput(1.4e-3, 1e-8).setTholePolarization(0.26, 0.07, 0.09, 1.6) }, + { iListInput(1.4e-3, 1e-8).setTholePolarization(0.26, 0.07, 0.09) }, { iListInput(2e-3, 1e-8).setWaterPolarization(0.001, 0.0012, 0.0016, 0.095, 0.15, 0.02) }, }; diff --git a/src/gromacs/topology/idef.cpp b/src/gromacs/topology/idef.cpp index b54d73c4f5..543a0f4113 100644 --- a/src/gromacs/topology/idef.cpp +++ b/src/gromacs/topology/idef.cpp @@ -180,11 +180,10 @@ void printInteractionParameters(gmx::TextWriter* writer, t_functype ftype, const iparams.anharm_polarize.khyp); break; case F_THOLE_POL: - writer->writeLineFormatted("a=%15.8e, alpha1=%15.8e, alpha2=%15.8e, rfac=%15.8e", + writer->writeLineFormatted("a=%15.8e, alpha1=%15.8e, alpha2=%15.8e", iparams.thole.a, iparams.thole.alpha1, - iparams.thole.alpha2, - iparams.thole.rfac); + iparams.thole.alpha2); break; case F_WATER_POL: writer->writeLineFormatted( diff --git a/src/gromacs/topology/idef.h b/src/gromacs/topology/idef.h index 7c68e2c606..60cf6bee0e 100644 --- a/src/gromacs/topology/idef.h +++ b/src/gromacs/topology/idef.h @@ -112,7 +112,7 @@ typedef union t_iparams } wpol; struct { - real a, alpha1, alpha2, rfac; + real a, alpha1, alpha2; } thole; struct {