Merge release-2018 into master
[alexxy/gromacs.git] / src / gromacs / mdlib / md_support.cpp
index 783d0b750b37cdb0d78871e2f9d06c3ec8c43fdf..d3decdb04b6a8a56f9bf95df3f0adf84fb96ddcf 100644 (file)
@@ -40,6 +40,7 @@
 #include "md_support.h"
 
 #include <climits>
+#include <cmath>
 
 #include <algorithm>
 
@@ -56,6 +57,7 @@
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/df_history.h"
 #include "gromacs/mdtypes/energyhistory.h"
+#include "gromacs/mdtypes/forcerec.h"
 #include "gromacs/mdtypes/group.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
@@ -153,7 +155,7 @@ void compute_globals(FILE *fplog, gmx_global_stat *gstat, t_commrec *cr, t_input
                      t_state *state, t_mdatoms *mdatoms,
                      t_nrnb *nrnb, t_vcm *vcm, gmx_wallcycle_t wcycle,
                      gmx_enerdata_t *enerd, tensor force_vir, tensor shake_vir, tensor total_vir,
-                     tensor pres, rvec mu_tot, struct gmx_constr *constr,
+                     tensor pres, rvec mu_tot, gmx::Constraints *constr,
                      gmx::SimulationSignaller *signalCoordinator,
                      matrix box, int *totalNumberOfBondedInteractions,
                      gmx_bool *bSumEkinhOld, int flags)
@@ -235,14 +237,6 @@ void compute_globals(FILE *fplog, gmx_global_stat *gstat, t_commrec *cr, t_input
         }
     }
 
-    if (!ekind->bNEMD && debug && bTemp && (vcm->nr > 0))
-    {
-        correct_ekin(debug,
-                     0, mdatoms->homenr,
-                     as_rvec_array(state->v.data()), vcm->group_p[0],
-                     mdatoms->massT, mdatoms->tmass, ekind->ekin);
-    }
-
     /* Do center of mass motion removal */
     if (bStopCM)
     {
@@ -352,7 +346,7 @@ void setCurrentLambdasRerun(gmx_int64_t step, const t_lambda *fepvals,
         {
             /* find out between which two value of lambda we should be */
             real frac      = step*fepvals->delta_lambda;
-            int  fep_state = static_cast<int>(floor(frac*fepvals->n_lambda));
+            int  fep_state = static_cast<int>(std::floor(frac*fepvals->n_lambda));
             /* interpolate between this state and the next */
             /* this assumes that the initial lambda corresponds to lambda==0, which is verified in grompp */
             frac           = frac*fepvals->n_lambda - fep_state;
@@ -384,7 +378,7 @@ void setCurrentLambdasLocal(gmx_int64_t step, const t_lambda *fepvals,
         real frac = step*fepvals->delta_lambda;
         if (fepvals->n_lambda > 0)
         {
-            int fep_state = static_cast<int>(floor(frac*fepvals->n_lambda));
+            int fep_state = static_cast<int>(std::floor(frac*fepvals->n_lambda));
             /* interpolate between this state and the next */
             /* this assumes that the initial lambda corresponds to lambda==0, which is verified in grompp */
             frac          = frac*fepvals->n_lambda - fep_state;