Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / gmxlib / nonbonded / nb_generic_adress.c
index 81bb26ed695a5621e4462121c5180f5dc6466155..4334a04c7a9355da1555ac1ba95a17177026aaad 100644 (file)
@@ -2,11 +2,11 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 2009 Christoph Junghans, Brad Lambeth.
- * Copyright (c) 2011 Christoph Junghans, Sebastian Fritsch
- * Copyright (c) 2012, by the GROMACS development team, led by
- * David van der Spoel, Berk Hess, Erik Lindahl, and including many
- * others, as listed in the AUTHORS file in the top-level source
- * directory and at http://www.gromacs.org.
+ * Copyright (c) 2011 Christoph Junghans, Sebastian Fritsch.
+ * Copyright (c) 2011,2012,2013,2014, 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.
  *
  * GROMACS is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
-#include <math.h>
-
-#include "types/simple.h"
-#include "vec.h"
-#include "typedefs.h"
 #include "nb_generic_adress.h"
-#include "nrnb.h"
 
-#include "nonbonded.h"
-#include "nb_kernel.h"
+#include <math.h>
+
+#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
+#include "gromacs/legacyheaders/nonbonded.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/simple.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/utility/fatalerror.h"
 
 #define ALMOST_ZERO 1e-30
 #define ALMOST_ONE 1-(1e-30)
@@ -93,7 +92,7 @@ gmx_nb_generic_adress_kernel(t_nblist *                nlist,
     int           ewitab;
     real          ewtabscale, eweps, sh_ewald, ewrt, ewtabhalfspace;
     real *        ewtab;
-    real          rcoulomb2, rvdw, rvdw2, sh_invrc6;
+    real          rcoulomb2, rvdw, rvdw2, sh_dispersion, sh_repulsion;
     real          rcutoff, rcutoff2;
     real          rswitch_elec, rswitch_vdw, d, d2, sw, dsw, rinvcorr;
     real          elec_swV3, elec_swV4, elec_swV5, elec_swF2, elec_swF3, elec_swF4;
@@ -132,7 +131,8 @@ gmx_nb_generic_adress_kernel(t_nblist *                nlist,
     rcoulomb2           = fr->rcoulomb*fr->rcoulomb;
     rvdw                = fr->rvdw;
     rvdw2               = rvdw*rvdw;
-    sh_invrc6           = fr->ic->sh_invrc6;
+    sh_dispersion       = fr->ic->dispersion_shift.cpot;
+    sh_repulsion        = fr->ic->repulsion_shift.cpot;
 
     if (fr->coulomb_modifier == eintmodPOTSWITCH)
     {
@@ -400,7 +400,7 @@ gmx_nb_generic_adress_kernel(t_nblist *                nlist,
                         fvdw             = (vvdw_rep-vvdw_disp)*rinvsq;
                         if (fr->vdw_modifier == eintmodPOTSHIFT)
                         {
-                            vvdw             = (vvdw_rep-c12*sh_invrc6*sh_invrc6)*(1.0/12.0)-(vvdw_disp-c6*sh_invrc6)*(1.0/6.0);
+                            vvdw             = (vvdw_rep + c12*sh_repulsion)/12.0 - (vvdw_disp + c6*sh_dispersion)/6.0;
                         }
                         else
                         {
@@ -421,7 +421,7 @@ gmx_nb_generic_adress_kernel(t_nblist *                nlist,
                         fvdw             = (br*vvdw_rep-vvdw_disp)*rinvsq;
                         if (fr->vdw_modifier == eintmodPOTSHIFT)
                         {
-                            vvdw             = (vvdw_rep-cexp1*exp(-cexp2*rvdw))-(vvdw_disp-c6*sh_invrc6)/6.0;
+                            vvdw             = (vvdw_rep-cexp1*exp(-cexp2*rvdw)) - (vvdw_disp + c6*sh_dispersion)/6.0;
                         }
                         else
                         {