Clean up genbox and associated code
authorMark Abraham <mark.j.abraham@gmail.com>
Sat, 1 Feb 2014 19:12:17 +0000 (20:12 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Mon, 3 Feb 2014 04:46:06 +0000 (05:46 +0100)
Moved genbox utility to preprocessing module from analysis module.
Renamed its addconf implementation files. Fixed necessary #include
dependencies. Made several functions static.

Renamed gbutil.[ch] to conformation-utilities.[ch], because they are
not exclusive to anything abbreviated "gb." These are mostly used by
gmxpreprocess, but also mdlib/tpi.c, and the header file is not really
useful to install, so the only current place they should move is
gmxlib. Removed unused orient(). Renamed genconf() and gen_box() to
avoid confusion with the utilities of those names. Moved the new
make_new_conformation into genbox.cpp because it is only used there.
Made two functions static. Removed unused (maybe broken?) NTB
parameter of the new make_new_box() function. Removed some debug
code that used a print function in a different compilation unit.

Change-Id: I33d15b2df63c9422ce241782a922145f4626b0fb

src/gromacs/gmxana/gmx_ana.h
src/gromacs/gmxana/gmx_editconf.c
src/gromacs/gmxlib/conformation-utilities.c [moved from src/gromacs/gmxlib/gbutil.c with 54% similarity]
src/gromacs/gmxlib/conformation-utilities.h [moved from src/gromacs/legacyheaders/gbutil.h with 70% similarity]
src/gromacs/gmxpreprocess/genbox-addconf.c [moved from src/gromacs/gmxana/addconf.c with 98% similarity]
src/gromacs/gmxpreprocess/genbox-addconf.h [moved from src/gromacs/gmxana/addconf.h with 93% similarity]
src/gromacs/gmxpreprocess/genbox.cpp [moved from src/gromacs/gmxana/gmx_genbox.cpp with 93% similarity]
src/gromacs/gmxpreprocess/genbox.h [new file with mode: 0644]
src/gromacs/gmxpreprocess/pdb2gmx.c
src/gromacs/mdlib/tpi.c
src/programs/legacymodules.cpp

index cca738db22a193f47f5d9a0417ddfb96c5cf0099..841151f5278ecf2ec98c63f6d4c32159ca08d2fa 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * 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.
@@ -123,9 +123,6 @@ gmx_lie(int argc, char *argv[]);
 int
 gmx_filter(int argc, char *argv[]);
 
-int
-gmx_genbox(int argc, char *argv[]);
-
 int
 gmx_genconf(int argc, char *argv[]);
 
index 4f5f6111ae10f4cce40e093a554b61d8db0c7179..48f0f07a3f3c83f21d1f16140be24954b558720d 100644 (file)
@@ -52,7 +52,7 @@
 #include "index.h"
 #include "vec.h"
 #include "typedefs.h"
-#include "gbutil.h"
+#include "gromacs/gmxlib/conformation-utilities.h"
 #include "physics.h"
 #include "atomprop.h"
 #include "gromacs/fileio/tpxio.h"
similarity index 54%
rename from src/gromacs/gmxlib/gbutil.c
rename to src/gromacs/gmxlib/conformation-utilities.c
index 3d2a1046a4630ae27946175ecf40a3900cf4df68..2682de6d80ae4ec28c69f4c9cc3f569b5d040214 100644 (file)
@@ -35,6 +35,8 @@
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 /* This file is completely threadsafe - keep it that way! */
+#include "conformation-utilities.h"
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -44,7 +46,6 @@
 #include "vec.h"
 #include "gmx_fatal.h"
 #include "pbc.h"
-#include "gbutil.h"
 
 static real dist2(t_pbc *pbc, rvec x, rvec y)
 {
@@ -55,7 +56,7 @@ static real dist2(t_pbc *pbc, rvec x, rvec y)
     return norm2(dx);
 }
 
-real distance_to_z(rvec x)
+static real distance_to_z(rvec x)
 {
     return (sqr(x[XX])+sqr(x[YY]));
 } /*distance_to_z()*/
@@ -122,151 +123,9 @@ void rotate_conf(int natom, rvec *x, rvec *v, real alfa, real beta, real gamma)
     }
 }
 
-void orient(int natom, rvec *x, rvec *v, rvec angle, matrix box)
-{
-    real  longest, rij, rzi;
-    int   i, j, m, max_i = 0, max_j = 0;
-    rvec  origin;
-    int   temp;
-    real  alfa = 0, beta = 0, gamma = 0;
-    t_pbc pbc;
-
-    set_pbc(&pbc, -1, box);
-
-    /*first i am going to look for the longest atom-atom distance*/
-    longest = dist2(&pbc, x[0], x[1]);
-    i       = 0;
-    j       = 1;
-    for (i = 0; (i < natom); i++)
-    {
-        for (j = 0; (j < natom); j++)
-        {
-            rij = dist2(&pbc, x[i], x[j]);
-            if (rij > longest)
-            {
-                max_i   = i;
-                max_j   = j;
-                longest = rij;
-            }
-        }
-    }
-    /* first check if x[max_i]<x[max_j] else swap*/
-    if (x[max_i][2] > x[max_j][2])
-    {
-        temp  = max_i;
-        max_i = max_j;
-        max_j = temp;
-    }
-
-    /*set the origin to x[i]*/
-    for (m = 0; (m < DIM); m++)
-    {
-        origin[m] = x[max_i][m];
-    }
-    for (i = 0; (i < natom); i++)
-    {
-        for (m = 0; (m < DIM); m++)
-        {
-            x[i][m] -= origin[m];
-        }
-    }
-
-    /* calculate the rotation angles alfa(x_axis) and beta(y_axis)
-     * the rotation angles must be calculated clockwise looking
-     * along the rotation axis to the origin*
-     * alfa (x-axis)
-     */
-    alfa = atan(x[max_j][ZZ]/x[max_j][YY])-M_PI_2;
-    beta = M_PI_2-atan(x[max_j][ZZ]/x[max_j][XX]);
-    rotate_conf(natom, x, v, alfa, beta, gamma);
-
-    /* now search the longest distance for rotation along the z_axis */
-    longest = distance_to_z(x[0]);
-    max_i   = 0;
-    for (i = 1; (i < natom); i++)
-    {
-        rzi = distance_to_z(x[i]);
-        if (rzi > longest)
-        {
-            longest = rzi;
-            max_i   = i;
-        }
-    }
-    gamma = atan(x[max_i][YY]/x[max_i][XX])-M_PI_2;
-    rotate_conf(natom, x, v, 0, 0, gamma);
-    angle[0] = alfa;
-    angle[1] = beta;
-    angle[2] = gamma;
-} /*orient()*/
-
-
-void genconf(t_atoms *atoms, rvec *x, rvec *v, real *r, matrix box, ivec n_box)
-{
-    int     i, ix, iy, iz, m, j, imol, offset;
-    rvec    delta;
-    int     nmol;
-
-    nmol = n_box[XX]*n_box[YY]*n_box[ZZ];
-
-    /*print message*/
-    fprintf(stderr, "Generating configuration\n");
-    imol = 0;
-    for (ix = 0; (ix < n_box[XX]); ix++)
-    {
-        delta[XX] = ix*box[XX][XX];
-        for (iy = 0; (iy < n_box[YY]); iy++)
-        {
-            delta[YY] = iy*box[YY][YY];
-            for (iz = 0; (iz < n_box[ZZ]); iz++)
-            {
-                delta[ZZ] = iz*box[ZZ][ZZ];
-                offset    = imol*atoms->nr;
-                for (i = 0; (i < atoms->nr); i++)
-                {
-                    for (m = 0; (m < DIM); m++)
-                    {
-                        x[offset+i][m] = delta[m]+x[i][m];
-                    }
-                    if (v)
-                    {
-                        for (m = 0; (m < DIM); m++)
-                        {
-                            v[offset+i][m] = v[i][m];
-                        }
-                    }
-                    r[offset+i] = r[i];
-                }
-                imol++;
-            }
-        }
-    }
-    for (i = 1; (i < nmol); i++)
-    {
-        int offs    = i*atoms->nr;
-        int offsres = i*atoms->nres;
-        for (j = 0; (j < atoms->nr); j++)
-        {
-            atoms->atomname[offs+j]                    = atoms->atomname[j];
-            atoms->atom[offs+j].resind                 = atoms->atom[j].resind + offsres;
-            atoms->resinfo[atoms->atom[offs+j].resind] =
-                atoms->resinfo[atoms->atom[j].resind];
-            atoms->resinfo[atoms->atom[offs+j].resind].nr += offsres;
-        }
-    }
-    atoms->nr   *= nmol;
-    atoms->nres *= nmol;
-    for (i = 0; i < DIM; i++)
-    {
-        for (j = 0; j < DIM; j++)
-        {
-            box[j][i] *= n_box[j];
-        }
-    }
-} /*genconf()*/
-
-/*gen_box() generates a box around a configuration*/
-void gen_box(int NTB, int natoms, rvec *x, matrix box, rvec box_space,
-             gmx_bool bCenter)
+/* Make a new box around a configuration*/
+void make_new_box(int natoms, rvec *x, matrix box, rvec box_space,
+                  gmx_bool bCenter)
 {
     int  i, m;
     rvec xmin, xmax;
@@ -292,20 +151,6 @@ void gen_box(int NTB, int natoms, rvec *x, matrix box, rvec box_space,
         box[m][m] = xmax[m]-xmin[m]+2*box_space[m];
     }
 
-    /*calculate the box size if NTB=1 (truncated octahedron)*/
-    if (NTB == 1)
-    {
-        max_box = box[0][0];
-        for (m = 0; (m < DIM); m++)
-        {
-            max_box = max(max_box, box[m][m]);
-        }
-        for (m = 0; (m < DIM); m++)
-        {
-            box[m][m] = max_box;
-        }
-    }
-
     /*move the molecule to the center of the box*/
     if (bCenter)
     {
@@ -317,10 +162,4 @@ void gen_box(int NTB, int natoms, rvec *x, matrix box, rvec box_space,
             }
         }
     }
-
-
-#ifdef DEBUG
-    /* print data to check this */
-    print_stat(x, natoms, box);
-#endif
-} /*gen_box()*/
+}
similarity index 70%
rename from src/gromacs/legacyheaders/gbutil.h
rename to src/gromacs/gmxlib/conformation-utilities.h
index 676df1a4fd40beb09728d23e210a635b63e74ddd..38024be62af72d851961d3c3534fc4d29fd2a58c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2010,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.
@@ -34,6 +34,9 @@
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+#ifndef GMX_CONFORMATION_UTILITIES_H
+#define GMX_CONFORMATION_UTILITIES_H
+
 #include "typedefs.h"
 
 #ifdef __cplusplus
@@ -43,22 +46,15 @@ extern "C" {
 void rotate_conf(int natom, rvec *x, rvec *v, real alfa, real beta, real gamma);
 /*rotate() rotates a configuration alfa degrees around the x_axis and beta degrees around the y_axis, *v can be NULL */
 
-void orient(int natom, rvec *x, rvec *v, rvec angle, matrix box);
-/*orient() rotates a configuration until the largest atom-atom distance is
- * placed along the z-axis and the second largest distance is placed along
- * the y-axis. Finally the third longest distance is placed along the x-axis
- */
-
-void genconf(t_atoms *atoms, rvec *x, rvec *v, real *r, matrix box, ivec n_box);
-/*genconf() generates a new configuration by adding boxes*/
-void gen_box(int NTB, int natoms, rvec *x, matrix box, rvec box_space,
-             gmx_bool bCenter);
-/* gen_box() generates a box around a configuration, box_space is optional
- * extra space around it. If NTB = 1 then a truncated octahedon will be
- * generated (don't!) if bCenter then coordinates will be centered in the
- * genereated box
+void make_new_box(int natoms, rvec *x, matrix box, rvec box_space,
+                  gmx_bool bCenter);
+/* Generates a box around a configuration, box_space is optional extra
+ * space around it. If bCenter then coordinates will be centered in
+ * the generated box
  */
 
 #ifdef __cplusplus
 }
 #endif
+
+#endif
similarity index 98%
rename from src/gromacs/gmxana/addconf.c
rename to src/gromacs/gmxpreprocess/genbox-addconf.c
index 83d8f9801156d55c7112f32bdbca49cff28197a9..9eb2f1ca448583351c0a11f17a2a084baf659444 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * 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.
@@ -34,6 +34,8 @@
  * 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 "genbox-addconf.h"
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -43,9 +45,7 @@
 #include "vec.h"
 #include "macros.h"
 #include "smalloc.h"
-#include "addconf.h"
 #include "force.h"
-#include "gstat.h"
 #include "names.h"
 #include "nsgrid.h"
 #include "mdatoms.h"
@@ -191,9 +191,9 @@ static void combine_atoms(t_atoms *ap, t_atoms *as,
 
 static t_forcerec *fr = NULL;
 
-void do_nsgrid(FILE *fp, gmx_bool bVerbose,
-               matrix box, rvec x[], t_atoms *atoms, real rlong,
-               const output_env_t oenv)
+static void do_nsgrid(FILE *fp, gmx_bool bVerbose,
+                      matrix box, rvec x[], t_atoms *atoms, real rlong,
+                      const output_env_t oenv)
 {
     gmx_mtop_t     *mtop;
     gmx_localtop_t *top;
@@ -329,7 +329,7 @@ void do_nsgrid(FILE *fp, gmx_bool bVerbose,
     }
 }
 
-gmx_bool bXor(gmx_bool b1, gmx_bool b2)
+static gmx_bool bXor(gmx_bool b1, gmx_bool b2)
 {
     return (b1 && !b2) || (b2 && !b1);
 }
similarity index 93%
rename from src/gromacs/gmxana/addconf.h
rename to src/gromacs/gmxpreprocess/genbox-addconf.h
index fd9187f3afd226bd0af29b5cbe124d93b6aafaff..3b2262fa023973927b75374390f711bb02103e6f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013, by the GROMACS development team, led by
+ * 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.
@@ -34,6 +34,9 @@
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+#ifndef GMX_GMXPREPROCESS_GENBOX_ADDCONF_H
+#define GMX_GMXPREPROCESS_GENBOX_ADDCONF_H
+
 #include "typedefs.h"
 
 #ifdef __cplusplus
@@ -55,3 +58,5 @@ void add_conf(t_atoms *atoms, rvec **x, rvec **v, real **r, gmx_bool bSrenew,
 #ifdef __cplusplus
 }
 #endif
+
+#endif
similarity index 93%
rename from src/gromacs/gmxana/gmx_genbox.cpp
rename to src/gromacs/gmxpreprocess/genbox.cpp
index ccc258883c8ff0da3a7424c6fb73b78870aa5195..4c5264115080983ce0c7b19da1ec6d6af5c136a1 100644 (file)
@@ -34,6 +34,8 @@
  * 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 "genbox.h"
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "gmx_fatal.h"
 #include "gromacs/commandline/pargs.h"
 #include "vec.h"
-#include "gbutil.h"
-#include "addconf.h"
+#include "gromacs/gmxlib/conformation-utilities.h"
+#include "genbox-addconf.h"
 #include "gromacs/fileio/pdbio.h"
 #include "pbc.h"
-#include "gmx_ana.h"
 #include "xvgr.h"
 
 #ifdef DEBUG
-void print_stat(rvec *x, int natoms, matrix box)
+static void print_stat(rvec *x, int natoms, matrix box)
 {
     int  i, m;
     rvec xmin, xmax;
@@ -132,7 +133,7 @@ typedef struct {
     int   res0;
 } t_moltypes;
 
-void sort_molecule(t_atoms **atoms_solvt, rvec *x, rvec *v, real *r)
+static void sort_molecule(t_atoms **atoms_solvt, rvec *x, rvec *v, real *r)
 {
     int         atnr, i, j, moltp = 0, nrmoltypes, resi_o, resi_n, resnr;
     t_moltypes *moltypes;
@@ -291,7 +292,7 @@ void sort_molecule(t_atoms **atoms_solvt, rvec *x, rvec *v, real *r)
     sfree(moltypes);
 }
 
-void rm_res_pbc(t_atoms *atoms, rvec *x, matrix box)
+static void rm_res_pbc(t_atoms *atoms, rvec *x, matrix box)
 {
     int  i, start, n, d, nat;
     rvec xcg;
@@ -343,11 +344,11 @@ void rm_res_pbc(t_atoms *atoms, rvec *x, matrix box)
     }
 }
 
-/* This is a (maybe) slow workaround to avoid the neighbor searching in addconf.c, which
- * leaks memory (May 2012). The function could be deleted as soon as the momory leaks
- * in addconf.c are fixed.
+/* This is a (maybe) slow workaround to avoid the neighbor searching in genbox_addconf.c, which
+ * leaks memory (May 2012). The function could be deleted as soon as the memory leaks
+ * there are fixed.
  * However, when inserting a small molecule in a system containing not too many atoms,
- * allPairsDistOk is probably even faster than addconf.c
+ * allPairsDistOk is probably even faster than the other code.
  */
 static gmx_bool
 allPairsDistOk(t_atoms *atoms, rvec *x, real *r,
@@ -483,7 +484,7 @@ static char *insert_mols(const char *mol_insrt, int nmol_insrt, int ntry, int se
             offset_x[XX] = box[XX][XX] * gmx_rng_uniform_real(rng);
             offset_x[YY] = box[YY][YY] * gmx_rng_uniform_real(rng);
             offset_x[ZZ] = box[ZZ][ZZ] * gmx_rng_uniform_real(rng);
-            gen_box(0, atoms_insrt.nr, x_n, box_insrt, offset_x, TRUE);
+            make_new_box(atoms_insrt.nr, x_n, box_insrt, offset_x, TRUE);
             if (!in_box(&pbc, x_n[0]) || !in_box(&pbc, x_n[atoms_insrt.nr-1]))
             {
                 continue;
@@ -538,6 +539,71 @@ static char *insert_mols(const char *mol_insrt, int nmol_insrt, int ntry, int se
     return title_insrt;
 }
 
+/* Make a new configuration by adding boxes*/
+static void make_new_conformation(t_atoms *atoms, rvec *x, rvec *v, real *r, matrix box, ivec n_box)
+{
+    int     i, ix, iy, iz, m, j, imol, offset;
+    rvec    delta;
+    int     nmol;
+
+    nmol = n_box[XX]*n_box[YY]*n_box[ZZ];
+
+    /*print message*/
+    fprintf(stderr, "Generating configuration\n");
+    imol = 0;
+    for (ix = 0; (ix < n_box[XX]); ix++)
+    {
+        delta[XX] = ix*box[XX][XX];
+        for (iy = 0; (iy < n_box[YY]); iy++)
+        {
+            delta[YY] = iy*box[YY][YY];
+            for (iz = 0; (iz < n_box[ZZ]); iz++)
+            {
+                delta[ZZ] = iz*box[ZZ][ZZ];
+                offset    = imol*atoms->nr;
+                for (i = 0; (i < atoms->nr); i++)
+                {
+                    for (m = 0; (m < DIM); m++)
+                    {
+                        x[offset+i][m] = delta[m]+x[i][m];
+                    }
+                    if (v)
+                    {
+                        for (m = 0; (m < DIM); m++)
+                        {
+                            v[offset+i][m] = v[i][m];
+                        }
+                    }
+                    r[offset+i] = r[i];
+                }
+                imol++;
+            }
+        }
+    }
+    for (i = 1; (i < nmol); i++)
+    {
+        int offs    = i*atoms->nr;
+        int offsres = i*atoms->nres;
+        for (j = 0; (j < atoms->nr); j++)
+        {
+            atoms->atomname[offs+j]                    = atoms->atomname[j];
+            atoms->atom[offs+j].resind                 = atoms->atom[j].resind + offsres;
+            atoms->resinfo[atoms->atom[offs+j].resind] =
+                atoms->resinfo[atoms->atom[j].resind];
+            atoms->resinfo[atoms->atom[offs+j].resind].nr += offsres;
+        }
+    }
+    atoms->nr   *= nmol;
+    atoms->nres *= nmol;
+    for (i = 0; i < DIM; i++)
+    {
+        for (j = 0; j < DIM; j++)
+        {
+            box[j][i] *= n_box[j];
+        }
+    }
+}
+
 static void add_solv(const char *fn, t_atoms *atoms, rvec **x, rvec **v, real **r,
                      int ePBC, matrix box,
                      gmx_atomprop_t aps,
@@ -617,7 +683,7 @@ static void add_solv(const char *fn, t_atoms *atoms, rvec **x, rvec **v, real **
     srenew(r_solvt, atoms_solvt->nr*nmol);
 
     /* generate a new solvent configuration */
-    genconf(atoms_solvt, x_solvt, v_solvt, r_solvt, box_solvt, n_box);
+    make_new_conformation(atoms_solvt, x_solvt, v_solvt, r_solvt, box_solvt, n_box);
 
 #ifdef DEBUG
     print_stat(x_solvt, atoms_solvt->nr, box_solvt);
diff --git a/src/gromacs/gmxpreprocess/genbox.h b/src/gromacs/gmxpreprocess/genbox.h
new file mode 100644 (file)
index 0000000..e8f21bd
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+#ifndef GMX_GMXPREPROCESS_GENBOX_H
+#define GMX_GMXPREPROCESS_GENBOX_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if 0
+}
+#endif
+
+int gmx_genbox(int argc, char *argv[]);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
index 153a5375eca0ed6961fa1848aff040fced560cda..f64c93f4ddabd1709d84e3a0f87794ef3001d75c 100644 (file)
@@ -63,7 +63,7 @@
 #include "resall.h"
 #include "pdb2top.h"
 #include "ter_db.h"
-#include "gbutil.h"
+#include "gromacs/gmxlib/conformation-utilities.h"
 #include "genhydro.h"
 #include "readinp.h"
 #include "atomprop.h"
@@ -2215,7 +2215,7 @@ int gmx_pdb2gmx(int argc, char *argv[])
     clear_rvec(box_space);
     if (box[0][0] == 0)
     {
-        gen_box(0, atoms->nr, x, box, box_space, FALSE);
+        make_new_box(atoms->nr, x, box, box_space, FALSE);
     }
     write_sto_conf(ftp2fn(efSTO, NFILE, fnm), title, atoms, x, NULL, ePBC, box);
 
index 489a2c958c739937bd15e9230cef472ac062a84f..2726173dd6f1c2e4e02a1c02f83f045c7d708cea 100644 (file)
@@ -71,7 +71,7 @@
 #include "ns.h"
 #include "mtop_util.h"
 #include "pme.h"
-#include "gbutil.h"
+#include "gromacs/gmxlib/conformation-utilities.h"
 
 #include "gromacs/fileio/confio.h"
 #include "gromacs/fileio/gmxfio.h"
index 490651c35be136f120d9a0a8235220e943b38760..0f6282a388fc87408f8e4ab8f10b37585593ae30 100644 (file)
@@ -46,6 +46,7 @@
 
 #include "gromacs/gmxana/gmx_ana.h"
 #include "gromacs/gmxpreprocess/grompp.h"
+#include "gromacs/gmxpreprocess/genbox.h"
 #include "gromacs/gmxpreprocess/pdb2gmx.h"
 #include "gromacs/gmxpreprocess/protonate.h"
 #include "gromacs/gmxpreprocess/x2top.h"