Remove unnecessary config.h includes
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / addconf.c
index cc0bf57893280fb33b50ca465e7c3728b8f05eda..b2d1f3a751324474be505a5c681500f35102505b 100644 (file)
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#include "addconf.h"
+#include "gmxpre.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "addconf.h"
 
 #include <stdlib.h>
 #include <string.h>
 
 #include "gromacs/math/vec.h"
-#include "macros.h"
-#include "types/commrec.h"
-#include "force.h"
-#include "names.h"
-#include "nsgrid.h"
-#include "mdatoms.h"
-#include "nrnb.h"
-#include "ns.h"
-#include "mtop_util.h"
-#include "chargegroup.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/force.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/nsgrid.h"
+#include "gromacs/legacyheaders/mdatoms.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/legacyheaders/ns.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/legacyheaders/chargegroup.h"
 
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/topology/block.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/smalloc.h"
 
 static real box_margin;
@@ -264,7 +263,6 @@ static void do_nsgrid(FILE *fp, gmx_bool bVerbose,
     ir->vdw_modifier     = eintmodNONE;
     ir->coulombtype      = eelCUT;
     ir->vdwtype          = evdwCUT;
-    ir->ndelta           = 2;
     ir->ns_type          = ensGRID;
     snew(ir->opts.egp_flags, 1);
 
@@ -438,6 +436,11 @@ void add_conf(t_atoms *atoms, rvec **x, rvec **v, real **r, gmx_bool bSrenew,
             for (j = j0; (j < j1 && nremove < natoms_solvt); j++)
             {
                 jnr = nlist->jjnr[j];
+                if (jnr < 0)
+                {
+                    /* skip padding */
+                    continue;
+                }
                 copy_rvec(x_all[jnr], xj);
 
                 /* Check solvent-protein and solvent-solvent */