Changed some variables from SCReal to real in FE kernel.
authorMagnus Lundborg <lundborg.magnus@gmail.com>
Thu, 29 Aug 2019 16:08:41 +0000 (18:08 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Fri, 30 Aug 2019 11:14:29 +0000 (13:14 +0200)
This means that there is a reduced precision in some of the calculations
when using sc-r-power 48 if GROMACS is compiled with single precision.

This is to achieve the behaviour intended by
commit a7c8e19121.

Change-Id: Iff754dfad51d1e468d96c368859db0a48ba51ebb

src/gromacs/gmxlib/nonbonded/nb_free_energy.cpp

index a9c5b2433db8bbd3c6f8e9a8b17899a2576518fb..8303ae6007348e5ae6e22735054521d68f366716 100644 (file)
@@ -92,7 +92,7 @@ static inline void pthRoot(const real  r,
 //! Computes r^(1/p) and 1/r^(1/p) for the standard p=6
 template <SoftCoreTreatment softCoreTreatment>
 static inline void pthRoot(const double  r,
-                           double       *pthRoot,
+                           real         *pthRoot,
                            double       *invPthRoot)
 {
     *invPthRoot = gmx::invsqrt(std::cbrt(r));
@@ -103,7 +103,7 @@ static inline void pthRoot(const double  r,
 //! Computes r^(1/p) and 1/r^(1/p) for p=48
 template <>
 inline void pthRoot<SoftCoreTreatment::RPower48>(const double  r,
-                                                 double       *pthRoot,
+                                                 real         *pthRoot,
                                                  double       *invPthRoot)
 {
     *pthRoot    = std::pow(r, 1.0/48.0);
@@ -132,7 +132,7 @@ nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
     real          shX, shY, shZ;
     real          tx, ty, tz, Fscal;
     SCReal        FscalC[NSTATES], FscalV[NSTATES];  /* Needs double for sc_power==48 */
-    SCReal        Vcoul[NSTATES], Vvdw[NSTATES];     /* Needs double for sc_power==48 */
+    real          Vcoul[NSTATES], Vvdw[NSTATES];
     real          rinv6, r;
     real          iqA, iqB;
     real          qq[NSTATES], vctot;
@@ -145,7 +145,8 @@ nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
     SCReal        dvdl_coul, dvdl_vdw;
     real          lfac_coul[NSTATES], dlfac_coul[NSTATES], lfac_vdw[NSTATES], dlfac_vdw[NSTATES];
     real          sigma6[NSTATES], alpha_vdw_eff, alpha_coul_eff;
-    SCReal        rp, rpm2, rC, rV, rinvC, rpinvC, rinvV, rpinvV; /* Needs double for sc_power==48 */
+    real          rinvC, rinvV;
+    SCReal        rp, rpm2, rC, rV, rpinvC, rpinvV; /* Needs double for sc_power==48 */
     real          sigma_pow[NSTATES];
     real          VV, FF;
     int           icoul, ivdw;