Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / genhydro.c
index 23134b1ac686ab19d584f25fa19ada89b4e42815..3a85fa12094f8a8201a5647d3174d605c1619db1 100644 (file)
@@ -1,70 +1,66 @@
 /*
+ * This file is part of the GROMACS molecular simulation package.
  *
- *                This source code is part of
- *
- *                 G   R   O   M   A   C   S
- *
- *          GROningen MAchine for Chemical Simulations
- *
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 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
+ * as published by the Free Software Foundation; either version 2.1
  * of the License, or (at your option) any later version.
  *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
  *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
  *
- * For more info, check our website at http://www.gromacs.org
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
  *
- * And Hey:
- * Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
+ * 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 "genhydro.h"
 
+#include <string.h>
 #include <time.h>
-#include <ctype.h>
-#include "sysstuff.h"
-#include "typedefs.h"
-#include "smalloc.h"
-#include "copyrite.h"
-#include "string2.h"
-#include "confio.h"
-#include "symtab.h"
-#include "vec.h"
-#include "statutil.h"
-#include "futil.h"
-#include "gmx_fatal.h"
-#include "physics.h"
-#include "calch.h"
-#include "genhydro.h"
-#include "h_db.h"
-#include "ter_db.h"
-#include "resall.h"
-#include "pgutil.h"
-#include "network.h"
-#include "macros.h"
+
+#include "gromacs/fileio/confio.h"
+#include "gromacs/gmxpreprocess/calch.h"
+#include "gromacs/gmxpreprocess/h_db.h"
+#include "gromacs/gmxpreprocess/pgutil.h"
+#include "gromacs/gmxpreprocess/resall.h"
+#include "gromacs/gmxpreprocess/ter_db.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
+#include "gromacs/utility/smalloc.h"
 
 static void copy_atom(t_atoms *atoms1, int a1, t_atoms *atoms2, int a2)
 {
     atoms2->atom[a2] = atoms1->atom[a1];
     snew(atoms2->atomname[a2], 1);
-    *atoms2->atomname[a2] = strdup(*atoms1->atomname[a1]);
+    *atoms2->atomname[a2] = gmx_strdup(*atoms1->atomname[a1]);
 }
 
 static atom_id pdbasearch_atom(const char *name, int resind, t_atoms *pdba,
@@ -170,7 +166,7 @@ static t_hackblock *get_hackblocks(t_atoms *pdba, int nah, t_hackblock ah[],
         {
             if (hb[rnr].name == NULL)
             {
-                hb[rnr].name = strdup(ahptr->name);
+                hb[rnr].name = gmx_strdup(ahptr->name);
             }
             merge_hacks(ahptr, &hb[rnr]);
         }
@@ -235,7 +231,7 @@ static void expand_hackblocks_one(t_hackblock *hbr, char *atomname,
                 {
                     if ( (*abi)[*nabi + k].oname == NULL)
                     {
-                        (*abi)[*nabi + k].nname    = strdup(atomname);
+                        (*abi)[*nabi + k].nname    = gmx_strdup(atomname);
                         (*abi)[*nabi + k].nname[0] = 'H';
                     }
                 }
@@ -249,7 +245,7 @@ static void expand_hackblocks_one(t_hackblock *hbr, char *atomname,
                                 (*abi)[*nabi + k].oname ? (*abi)[*nabi + k].oname : "");
                     }
                     sfree((*abi)[*nabi + k].nname);
-                    (*abi)[*nabi + k].nname = strdup(hbr->hack[j].nname);
+                    (*abi)[*nabi + k].nname = gmx_strdup(hbr->hack[j].nname);
                 }
 
                 if (hbr->hack[j].tp == 10 && k == 2)
@@ -670,7 +666,7 @@ static int add_h_low(t_atoms **pdbaptr, rvec *xptr[],
                                         ab[i][j].nname);
                             }
                             snew(newpdba->atomname[newi], 1);
-                            *newpdba->atomname[newi] = strdup(ab[i][j].nname);
+                            *newpdba->atomname[newi] = gmx_strdup(ab[i][j].nname);
                             if (ab[i][j].oname != NULL && ab[i][j].atom) /* replace */
                             {                                            /*          newpdba->atom[newi].m    = ab[i][j].atom->m; */
 /*        newpdba->atom[newi].q    = ab[i][j].atom->q; */
@@ -813,7 +809,7 @@ int protonate(t_atoms **atomsptr, rvec **xptr, t_protonate *protdata)
         }
 
         /* set forcefield to use: */
-        strcpy(protdata->FF, "gmx2.ff");
+        strcpy(protdata->FF, "oplsaa.ff");
 
         /* get the databases: */
         protdata->nah = read_h_db(protdata->FF, &protdata->ah);