Move dispersion correction call to do_force()
[alexxy/gromacs.git] / src / gromacs / mdlib / md_support.cpp
index 8803c5a99b974abb058ae4f8b717028446d67da7..efad98cc8a98b5e53252c49e1ef77d5ffc10f748 100644 (file)
@@ -50,7 +50,6 @@
 #include "gromacs/gmxlib/nrnb.h"
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/coupling.h"
-#include "gromacs/mdlib/dispersioncorrection.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
 #include "gromacs/mdlib/simulationsignal.h"
 #include "gromacs/mdlib/stat.h"
@@ -376,7 +375,6 @@ void compute_globals(gmx_global_stat*               gstat,
                      gmx::ArrayRef<const gmx::RVec> x,
                      gmx::ArrayRef<const gmx::RVec> v,
                      const matrix                   box,
-                     real                           vdwLambda,
                      const t_mdatoms*               mdatoms,
                      t_nrnb*                        nrnb,
                      t_vcm*                         vcm,
@@ -504,32 +502,6 @@ void compute_globals(gmx_global_stat*               gstat,
 
         enerd->term[F_PRES] = calc_pres(fr->pbcType, ir->nwall, lastbox, ekind->ekin, total_vir, pres);
     }
-
-    /* ##########  Long range energy information ###### */
-    if ((bEner || bPres) && fr->dispersionCorrection)
-    {
-        /* Calculate long range corrections to pressure and energy */
-        /* this adds to enerd->term[F_PRES] and enerd->term[F_ETOT],
-           and computes enerd->term[F_DISPCORR].  Also modifies the
-           total_vir and pres tensors */
-
-        const DispersionCorrection::Correction correction =
-                fr->dispersionCorrection->calculate(lastbox, vdwLambda);
-
-        if (bEner)
-        {
-            enerd->term[F_DISPCORR] = correction.energy;
-            enerd->term[F_EPOT] += correction.energy;
-            enerd->term[F_DVDL_VDW] += correction.dvdl;
-        }
-        if (bPres)
-        {
-            correction.correctVirial(total_vir);
-            correction.correctPressure(pres);
-            enerd->term[F_PDISPCORR] = correction.pressure;
-            enerd->term[F_PRES] += correction.pressure;
-        }
-    }
 }
 
 void setCurrentLambdasRerun(int64_t           step,