<TR>
<TD COLSPAN=2 ALIGN=LEFT>Solvate protein</TD>
<TD></TD>
-<TD COLSPAN=3 ALIGN=CENTER BGCOLOR=#777777> <A HREF=genbox.html onMouseOver="window.status='Fill box with water (solvate molecule)'; return true"><B>genbox</B></A> </TD>
+<TD COLSPAN=3 ALIGN=CENTER BGCOLOR=#777777> <A HREF=../programs/gmx-solvate.html onMouseOver="window.status='Fill box with water (solvate molecule)'; return true"><B>solvate</B></A> </TD>
<TD><IMG SRC=../images/flow_vrule.gif></TD>
</TR>
velocities, you can also use a <a href="pdb.html">pdb</a> file in all programs.
To generate a box of solvent molecules
around the peptide, the program
-<a href="genbox.html">genbox</a> is used. First the program
+<a href="solvate.html">gmx solvate</a> is used. First the program
<a href="editconf.html">editconf</a> should be used to
define a box of appropriate size around the molecule.
-<a href="genbox.html">genbox</a>
-dissolves a solute molecule (the peptide) into any solvent (in this
-case water). The output of <TT><a href="genbox.html">genbox</a></TT> is a gromos structure file of
-the peptide dissolved in water. The <a href="genbox.html">genbox</a> program also changes the
+<a href="solvate.html">gmx solvate</a>
+solvates a solute molecule (the peptide) into any solvent (in this
+case water). The output of <TT><a href="solvate.html">gmx solvate</a></TT> is a gromos structure file of
+the peptide solvated in water. The <a href="solvate.html">gmx solvate</a> program also changes the
molecular topology file (generated by <a href="pdb2gmx.html">pdb2gmx</a>) to add solvent
to the topology.
<P></P>
"either by hand or with [TT]-p[tt]. Do not use an atom name instead!",
"[PAR]Ions which can have multiple charge states get the multiplicity",
"added, without sign, for the uncommon states only.[PAR]",
- "For larger ions, e.g. sulfate we recommended using [gmx-genbox]."
+ "For larger ions, e.g. sulfate we recommended using [gmx-insert-molecules]."
};
const char *bugs[] = {
"If you specify a salt concentration existing ions are not taken into "
* 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"
+#include "addconf.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
fprintf(stderr, "Removed %d atoms that were outside the box\n", nremove);
}
- /* Define grid stuff for genbox */
+ /* Define grid stuff */
/* Largest VDW radius */
snew(r_all, natoms_prot+natoms_solvt);
for (i = j = 0; i < natoms_prot; i++, j++)
* 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
+#ifndef GMX_GMXPREPROCESS_ADDCONF_H
+#define GMX_GMXPREPROCESS_ADDCONF_H
#include "typedefs.h"
--- /dev/null
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
+ * 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.
+ *
+ * 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.
+ */
+#include "insert-molecules.h"
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "sysstuff.h"
+#include "typedefs.h"
+#include "smalloc.h"
+#include "string2.h"
+#include "gromacs/math/utilities.h"
+#include "gromacs/fileio/confio.h"
+#include "macros.h"
+#include "gromacs/random/random.h"
+#include "gromacs/fileio/futil.h"
+#include "atomprop.h"
+#include "names.h"
+#include "vec.h"
+#include "gmx_fatal.h"
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/gmxlib/conformation-utilities.h"
+#include "addconf.h"
+#include "read-conformation.h"
+#include "pbc.h"
+#include "xvgr.h"
+
+static gmx_bool in_box(t_pbc *pbc, rvec x)
+{
+ rvec box_center, dx;
+ int shift;
+
+ /* pbc_dx_aiuc only works correctly with the rectangular box center */
+ calc_box_center(ecenterRECT, pbc->box, box_center);
+
+ shift = pbc_dx_aiuc(pbc, x, box_center, dx);
+
+ return (shift == CENTRAL);
+}
+
+/* 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 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 the other code.
+ */
+static gmx_bool
+allPairsDistOk(t_atoms *atoms, rvec *x, real *r,
+ int ePBC, matrix box,
+ t_atoms *atoms_insrt, rvec *x_n, real *r_insrt)
+{
+ int i, j;
+ rvec dx;
+ real n2, r2;
+ t_pbc pbc;
+
+ set_pbc(&pbc, ePBC, box);
+ for (i = 0; i < atoms->nr; i++)
+ {
+ for (j = 0; j < atoms_insrt->nr; j++)
+ {
+ pbc_dx(&pbc, x[i], x_n[j], dx);
+ n2 = norm2(dx);
+ r2 = sqr(r[i]+r_insrt[j]);
+ if (n2 < r2)
+ {
+ return FALSE;
+ }
+ }
+ }
+ return TRUE;
+}
+
+/* enum for random rotations of inserted solutes */
+enum {
+ en_rot, en_rotXYZ, en_rotZ, en_rotNone, en_NR
+};
+
+static char *insert_mols(const char *mol_insrt, int nmol_insrt, int ntry, int seed,
+ t_atoms *atoms, rvec **x, real **r, int ePBC, matrix box,
+ gmx_atomprop_t aps,
+ real r_distance, real r_scale, real rshell,
+ const output_env_t oenv,
+ const char* posfn, const rvec deltaR, int enum_rot,
+ gmx_bool bCheckAllPairDist)
+{
+ t_pbc pbc;
+ static char *title_insrt;
+ t_atoms atoms_insrt;
+ rvec *x_insrt, *x_n;
+ real *r_insrt;
+ int ePBC_insrt;
+ matrix box_insrt;
+ int i, mol, onr, ncol;
+ real alfa = 0., beta = 0., gamma = 0.;
+ rvec offset_x;
+ int trial;
+ double **rpos;
+ gmx_rng_t rng;
+
+ rng = gmx_rng_init(seed);
+ set_pbc(&pbc, ePBC, box);
+
+ /* read number of atoms of insert molecules */
+ get_stx_coordnum(mol_insrt, &atoms_insrt.nr);
+ if (atoms_insrt.nr == 0)
+ {
+ gmx_fatal(FARGS, "No molecule in %s, please check your input\n", mol_insrt);
+ }
+ /* allocate memory for atom coordinates of insert molecules */
+ snew(x_insrt, atoms_insrt.nr);
+ snew(r_insrt, atoms_insrt.nr);
+ snew(atoms_insrt.resinfo, atoms_insrt.nr);
+ snew(atoms_insrt.atomname, atoms_insrt.nr);
+ snew(atoms_insrt.atom, atoms_insrt.nr);
+ atoms_insrt.pdbinfo = NULL;
+ snew(x_n, atoms_insrt.nr);
+ snew(title_insrt, STRLEN);
+
+ /* read residue number, residue names, atomnames, coordinates etc. */
+ fprintf(stderr, "Reading molecule configuration \n");
+ read_stx_conf(mol_insrt, title_insrt, &atoms_insrt, x_insrt, NULL,
+ &ePBC_insrt, box_insrt);
+ fprintf(stderr, "%s\nContaining %d atoms in %d residue\n",
+ title_insrt, atoms_insrt.nr, atoms_insrt.nres);
+ srenew(atoms_insrt.resinfo, atoms_insrt.nres);
+
+ /* initialise van der waals arrays for inserted molecules */
+ mk_vdw(&atoms_insrt, r_insrt, aps, r_distance, r_scale);
+
+ /* With -ip, take nmol_insrt from file posfn */
+ if (posfn != NULL)
+ {
+ nmol_insrt = read_xvg(posfn, &rpos, &ncol);
+ if (ncol != 3)
+ {
+ gmx_fatal(FARGS, "Expected 3 columns (x/y/z coordinates) in file %s\n", ncol, posfn);
+ }
+ fprintf(stderr, "Read %d positions from file %s\n\n", nmol_insrt, posfn);
+ }
+
+ srenew(atoms->resinfo, (atoms->nres+nmol_insrt*atoms_insrt.nres));
+ srenew(atoms->atomname, (atoms->nr+atoms_insrt.nr*nmol_insrt));
+ srenew(atoms->atom, (atoms->nr+atoms_insrt.nr*nmol_insrt));
+ srenew(*x, (atoms->nr+atoms_insrt.nr*nmol_insrt));
+ srenew(*r, (atoms->nr+atoms_insrt.nr*nmol_insrt));
+
+ trial = mol = 0;
+ while ((mol < nmol_insrt) && (trial < ntry*nmol_insrt))
+ {
+ fprintf(stderr, "\rTry %d", trial++);
+ for (i = 0; (i < atoms_insrt.nr); i++)
+ {
+ copy_rvec(x_insrt[i], x_n[i]);
+ }
+ switch (enum_rot)
+ {
+ case en_rotXYZ:
+ alfa = 2*M_PI * gmx_rng_uniform_real(rng);
+ beta = 2*M_PI * gmx_rng_uniform_real(rng);
+ gamma = 2*M_PI * gmx_rng_uniform_real(rng);
+ break;
+ case en_rotZ:
+ alfa = beta = 0.;
+ gamma = 2*M_PI * gmx_rng_uniform_real(rng);
+ break;
+ case en_rotNone:
+ alfa = beta = gamma = 0.;
+ break;
+ }
+ if (enum_rot == en_rotXYZ || (enum_rot == en_rotZ))
+ {
+ rotate_conf(atoms_insrt.nr, x_n, NULL, alfa, beta, gamma);
+ }
+ if (posfn == NULL)
+ {
+ /* insert at random positions */
+ 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);
+ 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;
+ }
+ }
+ else
+ {
+ /* Insert at positions taken from option -ip file */
+ offset_x[XX] = rpos[XX][mol] + deltaR[XX]*(2 * gmx_rng_uniform_real(rng)-1);
+ offset_x[YY] = rpos[YY][mol] + deltaR[YY]*(2 * gmx_rng_uniform_real(rng)-1);
+ offset_x[ZZ] = rpos[ZZ][mol] + deltaR[ZZ]*(2 * gmx_rng_uniform_real(rng)-1);
+ for (i = 0; i < atoms_insrt.nr; i++)
+ {
+ rvec_inc(x_n[i], offset_x);
+ }
+ }
+
+ onr = atoms->nr;
+
+ /* This is a (maybe) slow workaround to avoid too many calls of add_conf, which
+ * leaks memory (status May 2012). If the momory leaks in add_conf() are fixed,
+ * this check could be removed. Note, however, that allPairsDistOk is probably
+ * even faster than add_conf() when inserting a small molecule into a moderately
+ * small system.
+ */
+ if (bCheckAllPairDist && !allPairsDistOk(atoms, *x, *r, ePBC, box, &atoms_insrt, x_n, r_insrt))
+ {
+ continue;
+ }
+
+ add_conf(atoms, x, NULL, r, FALSE, ePBC, box, TRUE,
+ &atoms_insrt, x_n, NULL, r_insrt, FALSE, rshell, 0, oenv);
+
+ if (atoms->nr == (atoms_insrt.nr+onr))
+ {
+ mol++;
+ fprintf(stderr, " success (now %d atoms)!\n", atoms->nr);
+ }
+ }
+ gmx_rng_destroy(rng);
+ srenew(atoms->resinfo, atoms->nres);
+ srenew(atoms->atomname, atoms->nr);
+ srenew(atoms->atom, atoms->nr);
+ srenew(*x, atoms->nr);
+ srenew(*r, atoms->nr);
+
+ fprintf(stderr, "\n");
+ /* print number of molecules added */
+ fprintf(stderr, "Added %d molecules (out of %d requested) of %s\n",
+ mol, nmol_insrt, *atoms_insrt.resinfo[0].name);
+
+ return title_insrt;
+}
+
+int gmx_insert_molecules(int argc, char *argv[])
+{
+ const char *desc[] = {
+ "[THISMODULE] inserts [TT]-nmol[tt] copies of the system specified in",
+ "the [TT]-ci[tt] input file. The insertions take place either into",
+ "vacant space in the solute conformation given with [TT]-f[tt], or",
+ "into an empty box given by [TT]-box[tt]. Specifying both [TT]-f[tt]",
+ "and [TT]-box[tt] behaves like [TT]-f[tt], but places a new box",
+ "around the solute before insertions. Any velocities present are",
+ "discarded.[PAR]",
+
+ "By default, the insertion positions are random (with initial seed",
+ "specified by [TT]-seed[tt]). The program iterates until [TT]-nmol[tt]",
+ "molecules have been inserted in the box. Molecules are not inserted",
+ "where the distance between any existing atom and any atom of ",
+ "the inserted molecule is less than the sum of the van der Waals radii of ",
+ "both atoms. A database ([TT]vdwradii.dat[tt]) of van der Waals radii is ",
+ "read by the program, and atoms not in the database are ",
+ "assigned a default distance [TT]-vdwd[tt].[PAR]",
+
+ "A total of [TT]-nmol[tt] * [TT]-try[tt] insertion attempts are made",
+ "before giving up. Increase [TT]-try[tt] if you have several small",
+ "holes to fill. Option [TT]-rot[tt] specifies whether the insertion",
+ "molecules are randomly oriented before insertion attempts.[PAR]",
+
+ "Alternatively, the molecules can be inserted only at positions defined in",
+ "positions.dat ([TT]-ip[tt]). That file should have 3 columns (x,y,z),",
+ "that give the displacements compared to the input molecule position",
+ "([TT]-ci[tt]). Hence, if that file should contain the absolute",
+ "positions, the molecule must be centered on (0,0,0) before using",
+ "[THISMODULE] (e.g. from [gmx-editconf] [TT]-center[tt]).",
+ "Comments in that file starting with # are ignored. Option [TT]-dr[tt]",
+ "defines the maximally allowed displacements during insertial trials.",
+ "[TT]-try[tt] and [TT]-rot[tt] work as in the default mode (see above).",
+ "[PAR]",
+ };
+
+ const char *bugs[] = {
+ "Molecules must be whole in the initial configurations.",
+ "Many repeated neighbor searchings with -ci blows up the allocated memory. "
+ "Option -allpair avoids this using all-to-all distance checks (slow for large systems)"
+ };
+
+ /* parameter data */
+ gmx_bool bProt, bBox;
+ const char *conf_prot, *confout;
+ real *r;
+ char *title_ins = NULL;
+ gmx_atomprop_t aps;
+
+ /* protein configuration data */
+ char *title = NULL;
+ t_atoms atoms;
+ rvec *x = NULL;
+ int ePBC = -1;
+ matrix box;
+
+ t_filenm fnm[] = {
+ { efSTX, "-f", "protein", ffOPTRD },
+ { efSTX, "-ci", "insert", ffREAD},
+ { efDAT, "-ip", "positions", ffOPTRD},
+ { efSTO, NULL, NULL, ffWRITE},
+ };
+#define NFILE asize(fnm)
+
+ static int nmol_ins = 0, nmol_try = 10, seed = 1997, enum_rot;
+ static real r_distance = 0.105, r_scale = 0.57;
+ static rvec new_box = {0.0, 0.0, 0.0}, deltaR = {0.0, 0.0, 0.0};
+ static gmx_bool bCheckAllPairDist = FALSE;
+ output_env_t oenv;
+ const char *enum_rot_string[] = {NULL, "xyz", "z", "none", NULL};
+ t_pargs pa[] = {
+ { "-box", FALSE, etRVEC, {new_box},
+ "Box size (in nm)" },
+ { "-nmol", FALSE, etINT, {&nmol_ins},
+ "Number of extra molecules to insert" },
+ { "-try", FALSE, etINT, {&nmol_try},
+ "Try inserting [TT]-nmol[tt] times [TT]-try[tt] times" },
+ { "-seed", FALSE, etINT, {&seed},
+ "Random generator seed"},
+ { "-vdwd", FALSE, etREAL, {&r_distance},
+ "Default van der Waals distance"},
+ { "-vdwscale", FALSE, etREAL, {&r_scale},
+ "HIDDENScale factor to multiply Van der Waals radii from the database in share/gromacs/top/vdwradii.dat. The default value of 0.57 yields density close to 1000 g/l for proteins in water." },
+ { "-dr", FALSE, etRVEC, {deltaR},
+ "Allowed displacement in x/y/z from positions in [TT]-ip[tt] file" },
+ { "-rot", FALSE, etENUM, {enum_rot_string},
+ "rotate inserted molecules randomly" },
+ { "-allpair", FALSE, etBOOL, {&bCheckAllPairDist},
+ "Avoid momory leaks during neighbor searching with option -ci. May be slow for large systems." },
+ };
+
+ if (!parse_common_args(&argc, argv, PCA_BE_NICE, NFILE, fnm, asize(pa), pa,
+ asize(desc), desc, asize(bugs), bugs, &oenv))
+ {
+ return 0;
+ }
+
+ bProt = opt2bSet("-f", NFILE, fnm);
+ bBox = opt2parg_bSet("-box", asize(pa), pa);
+ enum_rot = nenum(enum_rot_string);
+
+ /* check input */
+ const char *insertionMoleculeFileName = opt2fn("-ci", NFILE, fnm);
+ if (!gmx_fexist(insertionMoleculeFileName))
+ {
+ gmx_fatal(FARGS,
+ "A molecule conformation to insert is required in -ci. %s was not found!",
+ insertionMoleculeFileName);
+ }
+ if (nmol_ins <= 0 && !opt2bSet("-ip", NFILE, fnm))
+ {
+ gmx_fatal(FARGS, "Either -nmol must be larger than 0, "
+ "or positions must be given with -ip");
+ }
+ if (!bProt && !bBox)
+ {
+ gmx_fatal(FARGS, "When no solute (-f) is specified, "
+ "a box size (-box) must be specified");
+ }
+
+ aps = gmx_atomprop_init();
+
+ if (bProt)
+ {
+ /*generate a solute configuration */
+ conf_prot = opt2fn("-f", NFILE, fnm);
+ title = read_conformation(conf_prot, &atoms, &x, NULL, &r, &ePBC, box,
+ aps, r_distance, r_scale);
+ if (atoms.nr == 0)
+ {
+ fprintf(stderr, "Note: no atoms in %s\n", conf_prot);
+ bProt = FALSE;
+ }
+ }
+ else
+ {
+ atoms.nr = 0;
+ atoms.nres = 0;
+ atoms.resinfo = NULL;
+ atoms.atomname = NULL;
+ atoms.atom = NULL;
+ atoms.pdbinfo = NULL;
+ x = NULL;
+ r = NULL;
+ }
+ if (bBox)
+ {
+ ePBC = epbcXYZ;
+ clear_mat(box);
+ box[XX][XX] = new_box[XX];
+ box[YY][YY] = new_box[YY];
+ box[ZZ][ZZ] = new_box[ZZ];
+ }
+ if (det(box) == 0)
+ {
+ gmx_fatal(FARGS, "Undefined solute box.\nCreate one with gmx editconf "
+ "or give explicit -box command line option");
+ }
+
+ /* add nmol_ins molecules of atoms_ins
+ in random orientation at random place */
+ title_ins = insert_mols(insertionMoleculeFileName, nmol_ins, nmol_try, seed,
+ &atoms, &x, &r, ePBC, box, aps,
+ r_distance, r_scale, 0,
+ oenv, opt2fn_null("-ip", NFILE, fnm), deltaR, enum_rot,
+ bCheckAllPairDist);
+
+ /* write new configuration to file confout */
+ confout = ftp2fn(efSTO, NFILE, fnm);
+ fprintf(stderr, "Writing generated configuration to %s\n", confout);
+ if (bProt)
+ {
+ write_sto_conf(confout, title, &atoms, x, NULL, ePBC, box);
+ /* print box sizes and box type to stderr */
+ fprintf(stderr, "%s\n", title);
+ }
+ else
+ {
+ write_sto_conf(confout, title_ins, &atoms, x, NULL, ePBC, box);
+ }
+
+ /* print size of generated configuration */
+ fprintf(stderr, "\nOutput configuration contains %d atoms in %d residues\n",
+ atoms.nr, atoms.nres);
+
+ gmx_atomprop_destroy(aps);
+
+ return 0;
+}
--- /dev/null
+/*
+ * 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_INSERT_MOLECULES_H
+#define GMX_GMXPREPROCESS_INSERT_MOLECULES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#if 0
+}
+#endif
+
+int gmx_insert_molecules(int argc, char *argv[]);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+/*
+ * 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.
+ */
+#include "read-conformation.h"
+
+#include "gromacs/fileio/confio.h"
+#include "atomprop.h"
+#include "types/simple.h"
+#include "types/atoms.h"
+#include "smalloc.h"
+
+void mk_vdw(t_atoms *a, real rvdw[], gmx_atomprop_t aps,
+ real r_distance, real r_scale)
+{
+ int i;
+
+ /* initialise van der waals arrays of configuration */
+ fprintf(stderr, "Initialising van der waals distances...\n");
+ for (i = 0; (i < a->nr); i++)
+ {
+ if (!gmx_atomprop_query(aps, epropVDW,
+ *(a->resinfo[a->atom[i].resind].name),
+ *(a->atomname[i]), &(rvdw[i])))
+ {
+ rvdw[i] = r_distance;
+ }
+ else
+ {
+ rvdw[i] *= r_scale;
+ }
+ }
+}
+
+char *read_conformation(const char *confin, t_atoms *atoms, rvec **x, rvec **v,
+ real **r, int *ePBC, matrix box, gmx_atomprop_t aps,
+ real r_distance, real r_scale)
+{
+ char *title;
+ int natoms;
+
+ snew(title, STRLEN);
+ get_stx_coordnum(confin, &natoms);
+
+ /* allocate memory for atom coordinates of configuration */
+ snew(*x, natoms);
+ if (v)
+ {
+ snew(*v, natoms);
+ }
+ snew(*r, natoms);
+ init_t_atoms(atoms, natoms, FALSE);
+
+ /* read residue number, residue names, atomnames, coordinates etc. */
+ fprintf(stderr, "Reading solute configuration%s\n", v ? " and velocities" : "");
+ read_stx_conf(confin, title, atoms, *x, v ? *v : NULL, ePBC, box);
+ fprintf(stderr, "%s\nContaining %d atoms in %d residues\n",
+ title, atoms->nr, atoms->nres);
+
+ mk_vdw(atoms, *r, aps, r_distance, r_scale);
+
+ return title;
+}
--- /dev/null
+/*
+ * 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_READ_CONFORMATION_H
+#define GMX_GMXPREPROCESS_READ_CONFORMATION_H
+
+#include "types/simple.h"
+#include "types/atoms.h"
+#include "atomprop.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*! Helper function reading VDW radii
+ *
+ * Used directly and indirectly by generate-velocities and
+ * insert-molecules. */
+void mk_vdw(t_atoms *a, real rvdw[], gmx_atomprop_t aps,
+ real r_distance, real r_scale);
+
+/*! Helper function to read a conformation from a file.
+ *
+ * Used by generate-velocities and insert-molecules. */
+char *read_conformation(const char *confin, t_atoms *atoms, rvec **x, rvec **v,
+ real **r, int *ePBC, matrix box, gmx_atomprop_t aps,
+ real r_distance, real r_scale);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
* 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"
+#include "solvate.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#include "typedefs.h"
#include "smalloc.h"
#include "string2.h"
-#include "physics.h"
#include "gromacs/fileio/confio.h"
-#include "txtdump.h"
-#include <math.h>
#include "macros.h"
-#include "gromacs/random/random.h"
#include "gromacs/fileio/futil.h"
#include "atomprop.h"
#include "names.h"
#include "vec.h"
#include "gmx_fatal.h"
#include "gromacs/commandline/pargs.h"
-#include "vec.h"
#include "gromacs/gmxlib/conformation-utilities.h"
-#include "genbox-addconf.h"
+#include "addconf.h"
+#include "read-conformation.h"
#include "gromacs/fileio/pdbio.h"
#include "pbc.h"
-#include "xvgr.h"
#ifdef DEBUG
static void print_stat(rvec *x, int natoms, matrix box)
}
#endif
-static gmx_bool in_box(t_pbc *pbc, rvec x)
-{
- rvec box_center, dx;
- int shift;
-
- /* pbc_dx_aiuc only works correctly with the rectangular box center */
- calc_box_center(ecenterRECT, pbc->box, box_center);
-
- shift = pbc_dx_aiuc(pbc, x, box_center, dx);
-
- return (shift == CENTRAL);
-}
-
-static void mk_vdw(t_atoms *a, real rvdw[], gmx_atomprop_t aps,
- real r_distance, real r_scale)
-{
- int i;
-
- /* initialise van der waals arrays of configuration */
- fprintf(stderr, "Initialising van der waals distances...\n");
- for (i = 0; (i < a->nr); i++)
- {
- if (!gmx_atomprop_query(aps, epropVDW,
- *(a->resinfo[a->atom[i].resind].name),
- *(a->atomname[i]), &(rvdw[i])))
- {
- rvdw[i] = r_distance;
- }
- else
- {
- rvdw[i] *= r_scale;
- }
- }
-}
-
typedef struct {
char *name;
int natoms;
}
}
-/* 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 the other code.
- */
-static gmx_bool
-allPairsDistOk(t_atoms *atoms, rvec *x, real *r,
- int ePBC, matrix box,
- t_atoms *atoms_insrt, rvec *x_n, real *r_insrt)
-{
- int i, j;
- rvec dx;
- real n2, r2;
- t_pbc pbc;
-
- set_pbc(&pbc, ePBC, box);
- for (i = 0; i < atoms->nr; i++)
- {
- for (j = 0; j < atoms_insrt->nr; j++)
- {
- pbc_dx(&pbc, x[i], x_n[j], dx);
- n2 = norm2(dx);
- r2 = sqr(r[i]+r_insrt[j]);
- if (n2 < r2)
- {
- return FALSE;
- }
- }
- }
- return TRUE;
-}
-
-/* enum for random rotations of inserted solutes */
-enum {
- en_rot, en_rotXYZ, en_rotZ, en_rotNone, en_NR
-};
-
-static char *insert_mols(const char *mol_insrt, int nmol_insrt, int ntry, int seed,
- t_atoms *atoms, rvec **x, real **r, int ePBC, matrix box,
- gmx_atomprop_t aps,
- real r_distance, real r_scale, real rshell,
- const output_env_t oenv,
- const char* posfn, const rvec deltaR, int enum_rot,
- gmx_bool bCheckAllPairDist)
-{
- t_pbc pbc;
- static char *title_insrt;
- t_atoms atoms_insrt;
- rvec *x_insrt, *x_n;
- real *r_insrt;
- int ePBC_insrt;
- matrix box_insrt;
- int i, mol, onr, ncol;
- real alfa = 0., beta = 0., gamma = 0.;
- rvec offset_x;
- int trial;
- double **rpos;
- gmx_rng_t rng;
-
- rng = gmx_rng_init(seed);
- set_pbc(&pbc, ePBC, box);
-
- /* read number of atoms of insert molecules */
- get_stx_coordnum(mol_insrt, &atoms_insrt.nr);
- if (atoms_insrt.nr == 0)
- {
- gmx_fatal(FARGS, "No molecule in %s, please check your input\n", mol_insrt);
- }
- /* allocate memory for atom coordinates of insert molecules */
- snew(x_insrt, atoms_insrt.nr);
- snew(r_insrt, atoms_insrt.nr);
- snew(atoms_insrt.resinfo, atoms_insrt.nr);
- snew(atoms_insrt.atomname, atoms_insrt.nr);
- snew(atoms_insrt.atom, atoms_insrt.nr);
- atoms_insrt.pdbinfo = NULL;
- snew(x_n, atoms_insrt.nr);
- snew(title_insrt, STRLEN);
-
- /* read residue number, residue names, atomnames, coordinates etc. */
- fprintf(stderr, "Reading molecule configuration \n");
- read_stx_conf(mol_insrt, title_insrt, &atoms_insrt, x_insrt, NULL,
- &ePBC_insrt, box_insrt);
- fprintf(stderr, "%s\nContaining %d atoms in %d residue\n",
- title_insrt, atoms_insrt.nr, atoms_insrt.nres);
- srenew(atoms_insrt.resinfo, atoms_insrt.nres);
-
- /* initialise van der waals arrays of insert molecules */
- mk_vdw(&atoms_insrt, r_insrt, aps, r_distance, r_scale);
-
- /* With -ip, take nmol_insrt from file posfn */
- if (posfn != NULL)
- {
- nmol_insrt = read_xvg(posfn, &rpos, &ncol);
- if (ncol != 3)
- {
- gmx_fatal(FARGS, "Expected 3 columns (x/y/z coordinates) in file %s\n", ncol, posfn);
- }
- fprintf(stderr, "Read %d positions from file %s\n\n", nmol_insrt, posfn);
- }
-
- srenew(atoms->resinfo, (atoms->nres+nmol_insrt*atoms_insrt.nres));
- srenew(atoms->atomname, (atoms->nr+atoms_insrt.nr*nmol_insrt));
- srenew(atoms->atom, (atoms->nr+atoms_insrt.nr*nmol_insrt));
- srenew(*x, (atoms->nr+atoms_insrt.nr*nmol_insrt));
- srenew(*r, (atoms->nr+atoms_insrt.nr*nmol_insrt));
-
- trial = mol = 0;
- while ((mol < nmol_insrt) && (trial < ntry*nmol_insrt))
- {
- fprintf(stderr, "\rTry %d", trial++);
- for (i = 0; (i < atoms_insrt.nr); i++)
- {
- copy_rvec(x_insrt[i], x_n[i]);
- }
- switch (enum_rot)
- {
- case en_rotXYZ:
- alfa = 2*M_PI * gmx_rng_uniform_real(rng);
- beta = 2*M_PI * gmx_rng_uniform_real(rng);
- gamma = 2*M_PI * gmx_rng_uniform_real(rng);
- break;
- case en_rotZ:
- alfa = beta = 0.;
- gamma = 2*M_PI * gmx_rng_uniform_real(rng);
- break;
- case en_rotNone:
- alfa = beta = gamma = 0.;
- break;
- }
- if (enum_rot == en_rotXYZ || (enum_rot == en_rotZ))
- {
- rotate_conf(atoms_insrt.nr, x_n, NULL, alfa, beta, gamma);
- }
- if (posfn == NULL)
- {
- /* insert at random positions */
- 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);
- 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;
- }
- }
- else
- {
- /* Insert at positions taken from option -ip file */
- offset_x[XX] = rpos[XX][mol] + deltaR[XX]*(2 * gmx_rng_uniform_real(rng)-1);
- offset_x[YY] = rpos[YY][mol] + deltaR[YY]*(2 * gmx_rng_uniform_real(rng)-1);
- offset_x[ZZ] = rpos[ZZ][mol] + deltaR[ZZ]*(2 * gmx_rng_uniform_real(rng)-1);
- for (i = 0; i < atoms_insrt.nr; i++)
- {
- rvec_inc(x_n[i], offset_x);
- }
- }
-
- onr = atoms->nr;
-
- /* This is a (maybe) slow workaround to avoid too many calls of add_conf, which
- * leaks memory (status May 2012). If the momory leaks in add_conf() are fixed,
- * this check could be removed. Note, however, that allPairsDistOk is probably
- * even faster than add_conf() when inserting a small molecule into a moderately
- * small system.
- */
- if (bCheckAllPairDist && !allPairsDistOk(atoms, *x, *r, ePBC, box, &atoms_insrt, x_n, r_insrt))
- {
- continue;
- }
-
- add_conf(atoms, x, NULL, r, FALSE, ePBC, box, TRUE,
- &atoms_insrt, x_n, NULL, r_insrt, FALSE, rshell, 0, oenv);
-
- if (atoms->nr == (atoms_insrt.nr+onr))
- {
- mol++;
- fprintf(stderr, " success (now %d atoms)!\n", atoms->nr);
- }
- }
- gmx_rng_destroy(rng);
- srenew(atoms->resinfo, atoms->nres);
- srenew(atoms->atomname, atoms->nr);
- srenew(atoms->atom, atoms->nr);
- srenew(*x, atoms->nr);
- srenew(*r, atoms->nr);
-
- fprintf(stderr, "\n");
- /* print number of molecules added */
- fprintf(stderr, "Added %d molecules (out of %d requested) of %s\n",
- mol, nmol_insrt, *atoms_insrt.resinfo[0].name);
-
- 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)
{
/* apply pbc for solvent configuration for whole molecules */
rm_res_pbc(atoms_solvt, x_solvt, box_solvt);
- /* initialise van der waals arrays of solvent configuration */
+ /* initialise van der waals arrays for solvent configuration */
mk_vdw(atoms_solvt, r_solvt, aps, r_distance, r_scale);
/* calculate the box multiplication factors n_box[0...DIM] */
*atoms_added, *residues_added);
}
-static char *read_prot(const char *confin, t_atoms *atoms, rvec **x, rvec **v,
- real **r, int *ePBC, matrix box, gmx_atomprop_t aps,
- real r_distance, real r_scale)
-{
- char *title;
- int natoms;
-
- snew(title, STRLEN);
- get_stx_coordnum(confin, &natoms);
-
- /* allocate memory for atom coordinates of configuration 1 */
- snew(*x, natoms);
- if (v)
- {
- snew(*v, natoms);
- }
- snew(*r, natoms);
- init_t_atoms(atoms, natoms, FALSE);
-
- /* read residue number, residue names, atomnames, coordinates etc. */
- fprintf(stderr, "Reading solute configuration%s\n", v ? " and velocities" : "");
- read_stx_conf(confin, title, atoms, *x, v ? *v : NULL, ePBC, box);
- fprintf(stderr, "%s\nContaining %d atoms in %d residues\n",
- title, atoms->nr, atoms->nres);
-
- /* initialise van der waals arrays of configuration 1 */
- mk_vdw(atoms, *r, aps, r_distance, r_scale);
-
- return title;
-}
-
static void update_top(t_atoms *atoms, matrix box, int NFILE, t_filenm fnm[],
gmx_atomprop_t aps)
{
#undef TEMP_FILENM
}
-int gmx_genbox(int argc, char *argv[])
+int gmx_solvate(int argc, char *argv[])
{
const char *desc[] = {
- "[THISMODULE] can do one of 4 things:[PAR]",
+ "[THISMODULE] can do one of 2 things:[PAR]",
- "1) Generate a box of solvent. Specify [TT]-cs[tt] and [TT]-box[tt]. Or specify [TT]-cs[tt] and",
- "[TT]-cp[tt] with a structure file with a box, but without atoms.[PAR]",
+ "1) Generate a box of solvent. Specify [TT]-cs[tt] and [TT]-box[tt].",
+ "Or specify [TT]-cs[tt] and [TT]-cp[tt] with a structure file with",
+ "a box, but without atoms.[PAR]",
"2) Solvate a solute configuration, e.g. a protein, in a bath of solvent ",
"molecules. Specify [TT]-cp[tt] (solute) and [TT]-cs[tt] (solvent). ",
"The box specified in the solute coordinate file ([TT]-cp[tt]) is used,",
"unless [TT]-box[tt] is set.",
"If you want the solute to be centered in the box,",
- "the program [TT]editconf[tt] has sophisticated options",
+ "the program [gmx-editconf] has sophisticated options",
"to change the box dimensions and center the solute.",
"Solvent molecules are removed from the box where the ",
"distance between any atom of the solute molecule(s) and any atom of ",
"solvent molecules if they contain atoms that are not in the database.",
"[PAR]",
- "3) Insert a number ([TT]-nmol[tt]) of extra molecules ([TT]-ci[tt]) ",
- "at random positions.",
- "The program iterates until [TT]nmol[tt] molecules",
- "have been inserted in the box. To test whether an insertion is ",
- "successful the same van der Waals criterium is used as for removal of ",
- "solvent molecules. When no appropriately-sized ",
- "holes (holes that can hold an extra molecule) are available, the ",
- "program tries for [TT]-nmol[tt] * [TT]-try[tt] times before giving up. ",
- "Increase [TT]-try[tt] if you have several small holes to fill.",
- "Option [TT]-rot[tt] defines if the molecules are randomly oriented.",
- "[PAR]",
-
- "4) Insert a number of molecules ([TT]-ci[tt]) at positions defined in",
- "positions.dat ([TT]-ip[tt]). positions.dat should have 3 columns (x/y/z),",
- "that give the displacements compared to the input molecule position ([TT]-ci[tt]).",
- "Hence, if positions.dat should contain the absolut positions, the molecule ",
- "must be centered to 0/0/0 before using genbox (use, e.g., editconf -center).",
- "Comments in positions.dat starting with # are ignored. Option [TT]-dr[tt]",
- "defines the maximally allowed displacements during insertial trials.",
- "[TT]-try[tt] and [TT]-rot[tt] work as in mode (3) (see above)",
- "[PAR]",
-
- "If you need to do more than one of the above operations, it can be",
- "best to call [THISMODULE] separately for each operation, so that",
- "you are sure of the order in which the operations occur.[PAR]",
-
"The default solvent is Simple Point Charge water (SPC), with coordinates ",
"from [TT]$GMXLIB/spc216.gro[tt]. These coordinates can also be used",
"for other 3-site water models, since a short equibilibration will remove",
const char *bugs[] = {
"Molecules must be whole in the initial configurations.",
- "Many repeated neighbor searchings with -ci blows up the allocated memory. "
- "Option -allpair avoids this using all-to-all distance checks (slow for large systems)"
};
/* parameter data */
- gmx_bool bSol, bProt, bBox;
+ gmx_bool bProt, bBox;
const char *conf_prot, *confout;
- int bInsert;
real *r;
- char *title_ins;
gmx_atomprop_t aps;
/* protein configuration data */
t_filenm fnm[] = {
{ efSTX, "-cp", "protein", ffOPTRD },
- { efSTX, "-cs", "spc216", ffLIBOPTRD},
- { efSTX, "-ci", "insert", ffOPTRD},
- { efDAT, "-ip", "positions", ffOPTRD},
+ { efSTX, "-cs", "spc216", ffLIBRD},
{ efSTO, NULL, NULL, ffWRITE},
{ efTOP, NULL, NULL, ffOPTRW},
};
#define NFILE asize(fnm)
- static int nmol_ins = 0, nmol_try = 10, seed = 1997, enum_rot;
static real r_distance = 0.105, r_shell = 0, r_scale = 0.57;
- static rvec new_box = {0.0, 0.0, 0.0}, deltaR = {0.0, 0.0, 0.0};
- static gmx_bool bReadV = FALSE, bCheckAllPairDist = FALSE;
+ static rvec new_box = {0.0, 0.0, 0.0};
+ static gmx_bool bReadV = FALSE;
static int max_sol = 0;
output_env_t oenv;
- const char *enum_rot_string[] = {NULL, "xyz", "z", "none", NULL};
t_pargs pa[] = {
{ "-box", FALSE, etRVEC, {new_box},
"Box size (in nm)" },
- { "-nmol", FALSE, etINT, {&nmol_ins},
- "Number of extra molecules to insert" },
- { "-try", FALSE, etINT, {&nmol_try},
- "Try inserting [TT]-nmol[tt] times [TT]-try[tt] times" },
- { "-seed", FALSE, etINT, {&seed},
- "Random generator seed"},
{ "-vdwd", FALSE, etREAL, {&r_distance},
"Default van der Waals distance"},
{ "-vdwscale", FALSE, etREAL, {&r_scale},
"Maximum number of solvent molecules to add if they fit in the box. If zero (default) this is ignored" },
{ "-vel", FALSE, etBOOL, {&bReadV},
"Keep velocities from input solute and solvent" },
- { "-dr", FALSE, etRVEC, {deltaR},
- "Allowed displacement in x/y/z from positions in [TT]-ip[tt] file" },
- { "-rot", FALSE, etENUM, {enum_rot_string},
- "rotate inserted molecules randomly" },
- { "-allpair", FALSE, etBOOL, {&bCheckAllPairDist},
- "Avoid momory leaks during neighbor searching with option -ci. May be slow for large systems." },
};
if (!parse_common_args(&argc, argv, PCA_BE_NICE, NFILE, fnm, asize(pa), pa,
return 0;
}
- bInsert = opt2bSet("-ci", NFILE, fnm) && ((nmol_ins > 0) || opt2bSet("-ip", NFILE, fnm));
- bSol = opt2bSet("-cs", NFILE, fnm);
+ const char *solventFileName = opt2fn("-cs", NFILE, fnm);
bProt = opt2bSet("-cp", NFILE, fnm);
bBox = opt2parg_bSet("-box", asize(pa), pa);
- enum_rot = nenum(enum_rot_string);
/* check input */
- if (bInsert && (nmol_ins <= 0 && !opt2bSet("-ip", NFILE, fnm)))
- {
- gmx_fatal(FARGS, "When specifying inserted molecules (-ci), "
- "-nmol must be larger than 0 or positions must be given with -ip");
- }
if (!bProt && !bBox)
{
gmx_fatal(FARGS, "When no solute (-cp) is specified, "
if (bProt)
{
- /*generate a solute configuration */
+ /* Generate a solute configuration */
conf_prot = opt2fn("-cp", NFILE, fnm);
- title = read_prot(conf_prot, &atoms, &x, bReadV ? &v : NULL, &r, &ePBC, box,
- aps, r_distance, r_scale);
+ title = read_conformation(conf_prot, &atoms, &x, bReadV ? &v : NULL, &r, &ePBC, box,
+ aps, r_distance, r_scale);
if (bReadV && !v)
{
fprintf(stderr, "Note: no velocities found\n");
bProt = FALSE;
}
}
- if (!bProt)
+ else
{
atoms.nr = 0;
atoms.nres = 0;
}
if (det(box) == 0)
{
- gmx_fatal(FARGS, "Undefined solute box.\nCreate one with editconf "
+ gmx_fatal(FARGS, "Undefined solute box.\nCreate one with gmx editconf "
"or give explicit -box command line option");
}
- /* add nmol_ins molecules of atoms_ins
- in random orientation at random place */
- if (bInsert)
- {
- title_ins = insert_mols(opt2fn("-ci", NFILE, fnm), nmol_ins, nmol_try, seed,
- &atoms, &x, &r, ePBC, box, aps,
- r_distance, r_scale, r_shell,
- oenv, opt2fn_null("-ip", NFILE, fnm), deltaR, enum_rot,
- bCheckAllPairDist);
- }
- else
- {
- title_ins = strdup("Generated by genbox");
- }
-
- /* add solvent */
- if (bSol)
- {
- add_solv(opt2fn("-cs", NFILE, fnm), &atoms, &x, v ? &v : NULL, &r, ePBC, box,
- aps, r_distance, r_scale, &atoms_added, &residues_added, r_shell, max_sol,
- oenv);
- }
+ add_solv(solventFileName, &atoms, &x, v ? &v : NULL, &r, ePBC, box,
+ aps, r_distance, r_scale, &atoms_added, &residues_added, r_shell, max_sol,
+ oenv);
/* write new configuration 1 to file confout */
confout = ftp2fn(efSTO, NFILE, fnm);
}
else
{
- write_sto_conf(confout, title_ins, &atoms, x, v, ePBC, box);
+ write_sto_conf(confout, "Generated by gmx solvate", &atoms, x, v, ePBC, box);
}
- sfree(title_ins);
-
/* print size of generated configuration */
fprintf(stderr, "\nOutput configuration contains %d atoms in %d residues\n",
atoms.nr, atoms.nres);
* 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
+#ifndef GMX_GMXPREPROCESS_SOLVATE_H
+#define GMX_GMXPREPROCESS_SOLVATE_H
#ifdef __cplusplus
extern "C" {
}
#endif
-int gmx_genbox(int argc, char *argv[]);
+int gmx_solvate(int argc, char *argv[]);
#ifdef __cplusplus
}
${testname}
${exename}
# files with code for test fixtures
- genbox.cpp
+ solvate.cpp
+ insert-molecules.cpp
)
gmx_register_integration_test(
${testname}
--- /dev/null
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * 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.
+ *
+ * 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.
+ */
+/*! \internal \file
+ * \brief
+ * Tests for insertion of molecules.
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ */
+
+#include "../insert-molecules.h"
+#include "testutils/integrationtests.h"
+#include "testutils/cmdlinetest.h"
+#include "gromacs/fileio/futil.h"
+
+namespace
+{
+
+//! Helper typedef
+typedef int (*CMainFunction)(int argc, char *argv[]);
+
+//! Test fixture for insert-molecules
+class InsertMoleculesTest : public gmx::test::IntegrationTestFixture
+{
+ public:
+ //! Constructor
+ InsertMoleculesTest()
+ : ciFileName(fileManager_.getInputFilePath("x.gro")),
+ outputFileName(fileManager_.getTemporaryFilePath("out.gro")),
+ theFunction(gmx_insert_molecules)
+ {
+ caller.append("insert-molecules");
+ caller.addOption("-o", outputFileName);
+ }
+
+ public:
+ //! Name of file to use for -ci
+ std::string ciFileName;
+ //! Name of output file to use for -o
+ std::string outputFileName;
+ //! Helper object for managing the call to gmx_insert_molecules
+ gmx::test::CommandLine caller;
+ //! Points to the function to be tested
+ CMainFunction theFunction;
+};
+
+TEST_F(InsertMoleculesTest, f_ci_Works)
+{
+ caller.addOption("-f", fileManager_.getInputFilePath("spc-and-methanol.gro"));
+ caller.addOption("-nmol", "1");
+ caller.addOption("-ci", ciFileName);
+
+ ASSERT_EQ(0, theFunction(caller.argc(), caller.argv()));
+}
+
+TEST_F(InsertMoleculesTest, box_ci_Works)
+{
+ caller.addOption("-box", "4");
+ caller.addOption("-nmol", "5");
+ caller.addOption("-ci", ciFileName);
+
+ ASSERT_EQ(0, theFunction(caller.argc(), caller.argv()));
+}
+
+TEST_F(InsertMoleculesTest, f_box_ci_Works)
+{
+ caller.addOption("-f", fileManager_.getInputFilePath("spc-and-methanol.gro"));
+ caller.addOption("-box", "4");
+ caller.addOption("-nmol", "2");
+ caller.addOption("-ci", ciFileName);
+
+ ASSERT_EQ(0, theFunction(caller.argc(), caller.argv()));
+}
+
+// TODO Someone who knows what -ip is good for should write something
+// to test it
+
+} // namespace
*/
/*! \internal \file
* \brief
- * Tests for gmx traj
+ * Tests for solvation.
*
* \author Mark Abraham <mark.j.abraham@gmail.com>
*/
-#include "../genbox.h"
+#include "../solvate.h"
#include "testutils/integrationtests.h"
#include "testutils/cmdlinetest.h"
#include "gromacs/fileio/futil.h"
namespace
{
-//! Test fixture for genbox
-class Genbox : public gmx::test::IntegrationTestFixture
+//! Helper typedef
+typedef int (*CMainFunction)(int argc, char *argv[]);
+
+//! Test fixture for gmx solvate
+class SolvateTest : public gmx::test::IntegrationTestFixture
{
public:
//! Constructor
- Genbox()
+ SolvateTest()
: cpFileName(fileManager_.getInputFilePath("spc-and-methanol.gro")),
- ciFileName(fileManager_.getInputFilePath("x.gro")),
topFileName(fileManager_.getInputFilePath("spc-and-methanol.top")),
- outputFileName(fileManager_.getTemporaryFilePath("out.gro"))
+ outputFileName(fileManager_.getTemporaryFilePath("out.gro")),
+ theFunction(gmx_solvate)
{
- caller.append("genbox");
+ caller.append("solvate");
caller.addOption("-o", outputFileName);
}
public:
//! Name of file to use for -cp
std::string cpFileName;
- //! Name of file to use for -ci
- std::string ciFileName;
//! Name of input file to use for -p (if used)
std::string topFileName;
//! Name of output file to use for -o
std::string outputFileName;
- //! Helper object for managing the call to gmx_genbox
+ //! Helper object for managing the call to gmx_solvate
gmx::test::CommandLine caller;
+ //! Points to the function to be tested
+ CMainFunction theFunction;
};
-TEST_F(Genbox, cs_box_Works)
+TEST_F(SolvateTest, cs_box_Works)
{
caller.append("-cs"); // use default solvent box
caller.addOption("-box", "1.1");
- ASSERT_EQ(0, gmx_genbox(caller.argc(), caller.argv()));
+ ASSERT_EQ(0, theFunction(caller.argc(), caller.argv()));
}
-TEST_F(Genbox, cs_cp_Works)
+TEST_F(SolvateTest, cs_cp_Works)
{
caller.append("-cs"); // use default solvent box
caller.addOption("-cp", cpFileName);
- ASSERT_EQ(0, gmx_genbox(caller.argc(), caller.argv()));
+ ASSERT_EQ(0, theFunction(caller.argc(), caller.argv()));
}
-TEST_F(Genbox, cs_cp_p_Works)
+TEST_F(SolvateTest, cs_cp_p_Works)
{
caller.append("-cs"); // use default solvent box
caller.addOption("-cp", cpFileName);
gmx_file_copy(topFileName.c_str(), modifiableTopFileName.c_str(), true);
caller.addOption("-p", modifiableTopFileName);
- ASSERT_EQ(0, gmx_genbox(caller.argc(), caller.argv()));
-}
-
-TEST_F(Genbox, ci_Works)
-{
- caller.addOption("-cp", fileManager_.getInputFilePath("spc216.gro"));
- caller.addOption("-nmol", "2");
- caller.addOption("-ci", ciFileName);
- caller.addOption("-vdwd", "0.01"); // Make sure insertions happen
-
- ASSERT_EQ(0, gmx_genbox(caller.argc(), caller.argv()));
+ ASSERT_EQ(0, theFunction(caller.argc(), caller.argv()));
}
-// TODO Someone who knows what -ip is good for should write something
-// to test it
-
} // namespace
+++ /dev/null
-216H2O,WATJP01,SPC216,SPC-MODEL,300K,BOX(M)=1.86206NM,WFVG,MAR. 1984
- 648
- 1SOL OW 1 .230 .628 .113
- 1SOL HW1 2 .137 .626 .150
- 1SOL HW2 3 .231 .589 .021
- 2SOL OW 4 .225 .275 -.866
- 2SOL HW1 5 .260 .258 -.774
- 2SOL HW2 6 .137 .230 -.878
- 3SOL OW 7 .019 .368 .647
- 3SOL HW1 8 -.063 .411 .686
- 3SOL HW2 9 -.009 .295 .584
- 4SOL OW 10 .569 -.587 -.697
- 4SOL HW1 11 .476 -.594 -.734
- 4SOL HW2 12 .580 -.498 -.653
- 5SOL OW 13 -.307 -.351 .703
- 5SOL HW1 14 -.364 -.367 .784
- 5SOL HW2 15 -.366 -.341 .623
- 6SOL OW 16 -.119 .618 .856
- 6SOL HW1 17 -.086 .712 .856
- 6SOL HW2 18 -.068 .564 .922
- 7SOL OW 19 -.727 .703 .717
- 7SOL HW1 20 -.670 .781 .692
- 7SOL HW2 21 -.787 .729 .793
- 8SOL OW 22 -.107 .607 .231
- 8SOL HW1 23 -.119 .594 .132
- 8SOL HW2 24 -.137 .526 .280
- 9SOL OW 25 .768 -.718 -.839
- 9SOL HW1 26 .690 -.701 -.779
- 9SOL HW2 27 .802 -.631 -.875
- 10SOL OW 28 .850 .798 -.039
- 10SOL HW1 29 .846 .874 .026
- 10SOL HW2 30 .872 .834 -.130
- 11SOL OW 31 .685 -.850 .665
- 11SOL HW1 32 .754 -.866 .735
- 11SOL HW2 33 .612 -.793 .703
- 12SOL OW 34 .686 -.701 -.059
- 12SOL HW1 35 .746 -.622 -.045
- 12SOL HW2 36 .600 -.670 -.100
- 13SOL OW 37 .335 -.427 -.801
- 13SOL HW1 38 .257 -.458 -.854
- 13SOL HW2 39 .393 -.369 -.858
- 14SOL OW 40 -.402 -.357 -.523
- 14SOL HW1 41 -.378 -.263 -.497
- 14SOL HW2 42 -.418 -.411 -.441
- 15SOL OW 43 .438 .392 -.363
- 15SOL HW1 44 .520 .336 -.354
- 15SOL HW2 45 .357 .334 -.359
- 16SOL OW 46 -.259 .447 .737
- 16SOL HW1 47 -.333 .493 .687
- 16SOL HW2 48 -.208 .515 .790
- 17SOL OW 49 .231 -.149 .483
- 17SOL HW1 50 .265 -.072 .537
- 17SOL HW2 51 .275 -.149 .393
- 18SOL OW 52 -.735 -.521 -.172
- 18SOL HW1 53 -.688 -.521 -.084
- 18SOL HW2 54 -.783 -.608 -.183
- 19SOL OW 55 .230 -.428 .538
- 19SOL HW1 56 .204 -.332 .538
- 19SOL HW2 57 .159 -.482 .583
- 20SOL OW 58 .240 -.771 .886
- 20SOL HW1 59 .254 -.855 .938
- 20SOL HW2 60 .185 -.707 .941
- 21SOL OW 61 .620 -.076 -.423
- 21SOL HW1 62 .528 -.093 -.388
- 21SOL HW2 63 .648 .016 -.397
- 22SOL OW 64 .606 -.898 .123
- 22SOL HW1 65 .613 -.814 .069
- 22SOL HW2 66 .652 -.885 .211
- 23SOL OW 67 -.268 .114 -.382
- 23SOL HW1 68 -.286 .181 -.454
- 23SOL HW2 69 -.271 .160 -.293
- 24SOL OW 70 .122 .643 .563
- 24SOL HW1 71 .077 .555 .580
- 24SOL HW2 72 .121 .697 .647
- 25SOL OW 73 -.020 -.095 .359
- 25SOL HW1 74 .034 -.124 .439
- 25SOL HW2 75 .010 -.005 .330
- 26SOL OW 76 .027 -.266 .117
- 26SOL HW1 77 .008 -.362 .138
- 26SOL HW2 78 -.006 -.208 .192
- 27SOL OW 79 -.173 .922 .612
- 27SOL HW1 80 -.078 .893 .620
- 27SOL HW2 81 -.181 .987 .537
- 28SOL OW 82 -.221 -.754 .432
- 28SOL HW1 83 -.135 -.752 .380
- 28SOL HW2 84 -.207 -.707 .520
- 29SOL OW 85 .113 .737 -.265
- 29SOL HW1 86 .201 .724 -.220
- 29SOL HW2 87 .100 .834 -.287
- 30SOL OW 88 .613 -.497 .726
- 30SOL HW1 89 .564 -.584 .735
- 30SOL HW2 90 .590 -.454 .639
- 31SOL OW 91 -.569 -.634 -.439
- 31SOL HW1 92 -.532 -.707 -.497
- 31SOL HW2 93 -.517 -.629 -.354
- 32SOL OW 94 .809 .004 .502
- 32SOL HW1 95 .849 .095 .493
- 32SOL HW2 96 .709 .012 .508
- 33SOL OW 97 .197 -.886 -.598
- 33SOL HW1 98 .286 -.931 -.612
- 33SOL HW2 99 .124 -.951 -.617
- 34SOL OW 100 -.337 -.863 .190
- 34SOL HW1 101 -.400 -.939 .203
- 34SOL HW2 102 -.289 -.845 .276
- 35SOL OW 103 -.675 -.070 -.246
- 35SOL HW1 104 -.651 -.010 -.322
- 35SOL HW2 105 -.668 -.165 -.276
- 36SOL OW 106 .317 .251 -.061
- 36SOL HW1 107 .388 .322 -.055
- 36SOL HW2 108 .229 .290 -.033
- 37SOL OW 109 -.396 -.445 -.909
- 37SOL HW1 110 -.455 -.439 -.829
- 37SOL HW2 111 -.411 -.533 -.955
- 38SOL OW 112 -.195 -.148 .572
- 38SOL HW1 113 -.236 -.171 .484
- 38SOL HW2 114 -.213 -.222 .637
- 39SOL OW 115 .598 .729 .270
- 39SOL HW1 116 .622 .798 .202
- 39SOL HW2 117 .520 .762 .324
- 40SOL OW 118 -.581 .345 -.918
- 40SOL HW1 119 -.667 .295 -.931
- 40SOL HW2 120 -.519 .291 -.862
- 41SOL OW 121 -.286 -.200 .307
- 41SOL HW1 122 -.197 -.154 .310
- 41SOL HW2 123 -.307 -.224 .212
- 42SOL OW 124 .807 .605 -.397
- 42SOL HW1 125 .760 .602 -.308
- 42SOL HW2 126 .756 .550 -.463
- 43SOL OW 127 -.468 .469 -.188
- 43SOL HW1 128 -.488 .512 -.100
- 43SOL HW2 129 -.390 .407 -.179
- 44SOL OW 130 -.889 .890 -.290
- 44SOL HW1 131 -.843 .806 -.319
- 44SOL HW2 132 -.945 .924 -.365
- 45SOL OW 133 -.871 .410 -.620
- 45SOL HW1 134 -.948 .444 -.566
- 45SOL HW2 135 -.905 .359 -.699
- 46SOL OW 136 -.821 .701 .429
- 46SOL HW1 137 -.795 .697 .525
- 46SOL HW2 138 -.906 .650 .415
- 47SOL OW 139 .076 .811 .789
- 47SOL HW1 140 .175 .799 .798
- 47SOL HW2 141 .052 .906 .810
- 48SOL OW 142 .130 -.041 -.291
- 48SOL HW1 143 .120 -.056 -.192
- 48SOL HW2 144 .044 -.005 -.327
- 49SOL OW 145 .865 .348 .195
- 49SOL HW1 146 .924 .411 .146
- 49SOL HW2 147 .884 .254 .166
- 50SOL OW 148 -.143 .585 -.031
- 50SOL HW1 149 -.169 .674 -.067
- 50SOL HW2 150 -.145 .517 -.104
- 51SOL OW 151 -.500 -.718 .545
- 51SOL HW1 152 -.417 -.747 .497
- 51SOL HW2 153 -.549 -.651 .489
- 52SOL OW 154 .550 .196 .885
- 52SOL HW1 155 .545 .191 .985
- 52SOL HW2 156 .552 .292 .856
- 53SOL OW 157 -.854 -.406 .477
- 53SOL HW1 158 -.900 -.334 .425
- 53SOL HW2 159 -.858 -.386 .575
- 54SOL OW 160 .351 -.061 .853
- 54SOL HW1 161 .401 -.147 .859
- 54SOL HW2 162 .416 .016 .850
- 55SOL OW 163 -.067 -.796 .873
- 55SOL HW1 164 -.129 -.811 .797
- 55SOL HW2 165 -.119 -.785 .958
- 56SOL OW 166 -.635 -.312 -.356
- 56SOL HW1 167 -.629 -.389 -.292
- 56SOL HW2 168 -.687 -.338 -.436
- 57SOL OW 169 .321 -.919 .242
- 57SOL HW1 170 .403 -.880 .200
- 57SOL HW2 171 .294 -1.001 .193
- 58SOL OW 172 -.404 .735 .728
- 58SOL HW1 173 -.409 .670 .803
- 58SOL HW2 174 -.324 .794 .741
- 59SOL OW 175 .461 -.596 -.135
- 59SOL HW1 176 .411 -.595 -.221
- 59SOL HW2 177 .398 -.614 -.059
- 60SOL OW 178 -.751 -.086 .237
- 60SOL HW1 179 -.811 -.148 .287
- 60SOL HW2 180 -.720 -.130 .152
- 61SOL OW 181 .202 .285 -.364
- 61SOL HW1 182 .122 .345 -.377
- 61SOL HW2 183 .192 .236 -.278
- 62SOL OW 184 -.230 -.485 .081
- 62SOL HW1 185 -.262 -.391 .071
- 62SOL HW2 186 -.306 -.548 .069
- 63SOL OW 187 .464 -.119 .323
- 63SOL HW1 188 .497 -.080 .409
- 63SOL HW2 189 .540 -.126 .258
- 64SOL OW 190 -.462 .107 .426
- 64SOL HW1 191 -.486 .070 .336
- 64SOL HW2 192 -.363 .123 .430
- 65SOL OW 193 .249 -.077 -.621
- 65SOL HW1 194 .306 -.142 -.571
- 65SOL HW2 195 .233 -.110 -.714
- 66SOL OW 196 -.922 -.164 .904
- 66SOL HW1 197 -.842 -.221 .925
- 66SOL HW2 198 -.971 -.204 .827
- 67SOL OW 199 .382 .700 .480
- 67SOL HW1 200 .427 .610 .477
- 67SOL HW2 201 .288 .689 .513
- 68SOL OW 202 -.315 .222 -.133
- 68SOL HW1 203 -.320 .259 -.041
- 68SOL HW2 204 -.387 .153 -.145
- 69SOL OW 205 .614 .122 .117
- 69SOL HW1 206 .712 .100 .124
- 69SOL HW2 207 .583 .105 .024
- 70SOL OW 208 .781 .264 -.113
- 70SOL HW1 209 .848 .203 -.070
- 70SOL HW2 210 .708 .283 -.048
- 71SOL OW 211 .888 -.348 -.667
- 71SOL HW1 212 .865 -.373 -.761
- 71SOL HW2 213 .949 -.417 -.628
- 72SOL OW 214 -.511 .590 -.429
- 72SOL HW1 215 -.483 .547 -.344
- 72SOL HW2 216 -.486 .686 -.428
- 73SOL OW 217 .803 -.460 .924
- 73SOL HW1 218 .893 -.446 .882
- 73SOL HW2 219 .732 -.458 .853
- 74SOL OW 220 .922 .503 .899
- 74SOL HW1 221 .897 .494 .803
- 74SOL HW2 222 .970 .421 .930
- 75SOL OW 223 .539 .064 .512
- 75SOL HW1 224 .458 .065 .570
- 75SOL HW2 225 .542 .147 .457
- 76SOL OW 226 -.428 -.674 .041
- 76SOL HW1 227 -.396 -.750 .098
- 76SOL HW2 228 -.520 -.647 .071
- 77SOL OW 229 .297 .035 .171
- 77SOL HW1 230 .346 .119 .150
- 77SOL HW2 231 .359 -.030 .216
- 78SOL OW 232 -.927 .236 .480
- 78SOL HW1 233 -.975 .277 .402
- 78SOL HW2 234 -.828 .234 .461
- 79SOL OW 235 -.786 .683 -.398
- 79SOL HW1 236 -.866 .622 -.395
- 79SOL HW2 237 -.705 .630 -.422
- 80SOL OW 238 -.635 -.292 .793
- 80SOL HW1 239 -.614 -.218 .728
- 80SOL HW2 240 -.567 -.292 .866
- 81SOL OW 241 .459 -.710 .741
- 81SOL HW1 242 .388 -.737 .806
- 81SOL HW2 243 .433 -.738 .648
- 82SOL OW 244 -.591 -.065 .591
- 82SOL HW1 245 -.547 -.001 .527
- 82SOL HW2 246 -.641 -.013 .661
- 83SOL OW 247 -.830 .549 .016
- 83SOL HW1 248 -.871 .631 -.023
- 83SOL HW2 249 -.766 .575 .089
- 84SOL OW 250 .078 .556 -.476
- 84SOL HW1 251 .170 .555 -.517
- 84SOL HW2 252 .072 .630 -.409
- 85SOL OW 253 .561 .222 -.715
- 85SOL HW1 254 .599 .138 -.678
- 85SOL HW2 255 .473 .241 -.671
- 86SOL OW 256 .866 .454 .642
- 86SOL HW1 257 .834 .526 .580
- 86SOL HW2 258 .890 .373 .589
- 87SOL OW 259 -.845 .039 .753
- 87SOL HW1 260 -.917 .044 .684
- 87SOL HW2 261 -.869 -.030 .822
- 88SOL OW 262 -.433 -.689 .867
- 88SOL HW1 263 -.488 -.773 .860
- 88SOL HW2 264 -.407 -.660 .775
- 89SOL OW 265 -.396 .590 -.870
- 89SOL HW1 266 -.426 .495 -.863
- 89SOL HW2 267 -.323 .606 -.804
- 90SOL OW 268 -.005 .833 .377
- 90SOL HW1 269 .037 .769 .441
- 90SOL HW2 270 -.043 .782 .299
- 91SOL OW 271 .488 -.477 .174
- 91SOL HW1 272 .401 -.492 .221
- 91SOL HW2 273 .471 -.451 .079
- 92SOL OW 274 -.198 -.582 .657
- 92SOL HW1 275 -.099 -.574 .671
- 92SOL HW2 276 -.243 -.498 .688
- 93SOL OW 277 -.472 .575 .078
- 93SOL HW1 278 -.526 .554 .159
- 93SOL HW2 279 -.381 .534 .087
- 94SOL OW 280 .527 .256 .328
- 94SOL HW1 281 .554 .197 .253
- 94SOL HW2 282 .527 .351 .297
- 95SOL OW 283 -.108 -.639 -.274
- 95SOL HW1 284 -.017 -.678 -.287
- 95SOL HW2 285 -.100 -.543 -.250
- 96SOL OW 286 -.798 -.515 -.522
- 96SOL HW1 287 -.878 -.538 -.467
- 96SOL HW2 288 -.715 -.541 -.473
- 97SOL OW 289 -.270 -.233 -.237
- 97SOL HW1 290 -.243 -.199 -.327
- 97SOL HW2 291 -.191 -.271 -.191
- 98SOL OW 292 -.751 -.667 -.762
- 98SOL HW1 293 -.791 -.623 -.681
- 98SOL HW2 294 -.792 -.630 -.845
- 99SOL OW 295 -.224 -.763 -.783
- 99SOL HW1 296 -.219 -.682 -.724
- 99SOL HW2 297 -.310 -.761 -.834
- 100SOL OW 298 .915 .089 -.460
- 100SOL HW1 299 .940 .069 -.555
- 100SOL HW2 300 .987 .145 -.418
- 101SOL OW 301 -.882 -.746 -.143
- 101SOL HW1 302 -.981 -.740 -.133
- 101SOL HW2 303 -.859 -.826 -.199
- 102SOL OW 304 .705 -.812 .368
- 102SOL HW1 305 .691 -.805 .467
- 102SOL HW2 306 .789 -.863 .350
- 103SOL OW 307 .410 .813 -.611
- 103SOL HW1 308 .496 .825 -.561
- 103SOL HW2 309 .368 .726 -.584
- 104SOL OW 310 -.588 .386 -.600
- 104SOL HW1 311 -.567 .460 -.536
- 104SOL HW2 312 -.677 .403 -.643
- 105SOL OW 313 .064 -.298 -.531
- 105SOL HW1 314 .018 -.216 -.565
- 105SOL HW2 315 .162 -.279 -.522
- 106SOL OW 316 .367 -.762 .501
- 106SOL HW1 317 .360 -.679 .445
- 106SOL HW2 318 .371 -.842 .441
- 107SOL OW 319 .566 .537 .865
- 107SOL HW1 320 .578 .603 .791
- 107SOL HW2 321 .612 .571 .948
- 108SOL OW 322 -.610 -.514 .388
- 108SOL HW1 323 -.560 -.437 .428
- 108SOL HW2 324 -.705 -.512 .420
- 109SOL OW 325 -.590 -.417 -.720
- 109SOL HW1 326 -.543 -.404 -.633
- 109SOL HW2 327 -.656 -.491 -.711
- 110SOL OW 328 -.280 .639 .472
- 110SOL HW1 329 -.311 .700 .545
- 110SOL HW2 330 -.230 .691 .403
- 111SOL OW 331 .354 -.352 -.533
- 111SOL HW1 332 .333 -.396 -.620
- 111SOL HW2 333 .451 -.326 -.530
- 112SOL OW 334 .402 .751 -.264
- 112SOL HW1 335 .470 .806 -.311
- 112SOL HW2 336 .442 .663 -.237
- 113SOL OW 337 -.275 .779 -.192
- 113SOL HW1 338 -.367 .817 -.197
- 113SOL HW2 339 -.215 .826 -.257
- 114SOL OW 340 -.849 .105 -.092
- 114SOL HW1 341 -.843 .190 -.144
- 114SOL HW2 342 -.817 .029 -.149
- 115SOL OW 343 .504 .050 -.122
- 115SOL HW1 344 .462 -.007 -.192
- 115SOL HW2 345 .438 .119 -.090
- 116SOL OW 346 .573 .870 -.833
- 116SOL HW1 347 .617 .959 -.842
- 116SOL HW2 348 .510 .870 -.756
- 117SOL OW 349 -.502 .862 -.817
- 117SOL HW1 350 -.577 .862 -.883
- 117SOL HW2 351 -.465 .770 -.808
- 118SOL OW 352 -.653 .525 .275
- 118SOL HW1 353 -.640 .441 .329
- 118SOL HW2 354 -.682 .599 .335
- 119SOL OW 355 .307 .213 -.631
- 119SOL HW1 356 .284 .250 -.541
- 119SOL HW2 357 .277 .118 -.637
- 120SOL OW 358 .037 -.552 -.580
- 120SOL HW1 359 .090 -.601 -.512
- 120SOL HW2 360 .059 -.454 -.575
- 121SOL OW 361 .732 .634 -.798
- 121SOL HW1 362 .791 .608 -.874
- 121SOL HW2 363 .704 .730 -.809
- 122SOL OW 364 -.134 -.927 -.008
- 122SOL HW1 365 -.180 -.934 -.097
- 122SOL HW2 366 -.196 -.883 .058
- 123SOL OW 367 .307 .063 .618
- 123SOL HW1 368 .296 .157 .651
- 123SOL HW2 369 .302 -.000 .695
- 124SOL OW 370 -.240 .367 .374
- 124SOL HW1 371 -.238 .291 .438
- 124SOL HW2 372 -.288 .444 .414
- 125SOL OW 373 -.839 .766 -.896
- 125SOL HW1 374 -.824 .787 -.800
- 125SOL HW2 375 -.869 .671 -.905
- 126SOL OW 376 -.882 -.289 -.162
- 126SOL HW1 377 -.902 -.245 -.250
- 126SOL HW2 378 -.843 -.380 -.178
- 127SOL OW 379 -.003 -.344 -.257
- 127SOL HW1 380 .011 -.317 -.352
- 127SOL HW2 381 .080 -.322 -.204
- 128SOL OW 382 .350 .898 -.058
- 128SOL HW1 383 .426 .942 -.010
- 128SOL HW2 384 .385 .851 -.140
- 129SOL OW 385 -.322 .274 .125
- 129SOL HW1 386 -.383 .199 .148
- 129SOL HW2 387 -.300 .326 .208
- 130SOL OW 388 -.559 .838 .042
- 130SOL HW1 389 -.525 .745 .057
- 130SOL HW2 390 -.541 .865 -.053
- 131SOL OW 391 -.794 -.529 .849
- 131SOL HW1 392 -.787 -.613 .794
- 131SOL HW2 393 -.732 -.460 .813
- 132SOL OW 394 .319 .810 -.913
- 132SOL HW1 395 .412 .846 -.908
- 132SOL HW2 396 .313 .725 -.861
- 133SOL OW 397 .339 .509 -.856
- 133SOL HW1 398 .287 .426 -.873
- 133SOL HW2 399 .416 .514 -.920
- 134SOL OW 400 .511 .415 -.054
- 134SOL HW1 401 .493 .460 .034
- 134SOL HW2 402 .553 .480 -.117
- 135SOL OW 403 -.724 .380 -.184
- 135SOL HW1 404 -.769 .443 -.120
- 135SOL HW2 405 -.631 .411 -.201
- 136SOL OW 406 -.702 .207 -.385
- 136SOL HW1 407 -.702 .271 -.308
- 136SOL HW2 408 -.674 .255 -.468
- 137SOL OW 409 .008 -.536 .200
- 137SOL HW1 410 -.085 -.515 .169
- 137SOL HW2 411 .018 -.635 .213
- 138SOL OW 412 .088 -.061 .927
- 138SOL HW1 413 .046 -.147 .900
- 138SOL HW2 414 .182 -.058 .893
- 139SOL OW 415 .504 -.294 .910
- 139SOL HW1 416 .570 -.220 .919
- 139SOL HW2 417 .548 -.373 .868
- 140SOL OW 418 -.860 .796 -.624
- 140SOL HW1 419 -.819 .764 -.538
- 140SOL HW2 420 -.956 .769 -.627
- 141SOL OW 421 .040 .544 -.748
- 141SOL HW1 422 .125 .511 -.789
- 141SOL HW2 423 .053 .559 -.650
- 142SOL OW 424 .189 .520 -.140
- 142SOL HW1 425 .248 .480 -.210
- 142SOL HW2 426 .131 .591 -.181
- 143SOL OW 427 -.493 -.912 -.202
- 143SOL HW1 428 -.454 -.823 -.182
- 143SOL HW2 429 -.483 -.932 -.299
- 144SOL OW 430 .815 .572 .325
- 144SOL HW1 431 .822 .483 .279
- 144SOL HW2 432 .721 .606 .317
- 145SOL OW 433 -.205 .604 -.656
- 145SOL HW1 434 -.243 .535 -.594
- 145SOL HW2 435 -.123 .568 -.700
- 146SOL OW 436 .252 -.298 -.118
- 146SOL HW1 437 .222 -.241 -.042
- 146SOL HW2 438 .245 -.395 -.092
- 147SOL OW 439 .671 .464 -.593
- 147SOL HW1 440 .637 .375 -.623
- 147SOL HW2 441 .697 .518 -.673
- 148SOL OW 442 .930 -.184 -.397
- 148SOL HW1 443 .906 -.202 -.492
- 148SOL HW2 444 .960 -.090 -.387
- 149SOL OW 445 .473 .500 .191
- 149SOL HW1 446 .534 .580 .195
- 149SOL HW2 447 .378 .531 .198
- 150SOL OW 448 .159 -.725 -.396
- 150SOL HW1 449 .181 -.786 -.320
- 150SOL HW2 450 .169 -.774 -.482
- 151SOL OW 451 -.515 -.803 -.628
- 151SOL HW1 452 -.491 -.866 -.702
- 151SOL HW2 453 -.605 -.763 -.646
- 152SOL OW 454 -.560 .855 .309
- 152SOL HW1 455 -.646 .824 .351
- 152SOL HW2 456 -.564 .841 .210
- 153SOL OW 457 -.103 -.115 -.708
- 153SOL HW1 458 -.042 -.085 -.781
- 153SOL HW2 459 -.141 -.204 -.730
- 154SOL OW 460 -.610 -.131 -.734
- 154SOL HW1 461 -.526 -.126 -.788
- 154SOL HW2 462 -.633 -.227 -.716
- 155SOL OW 463 .083 -.604 -.840
- 155SOL HW1 464 .078 -.605 -.740
- 155SOL HW2 465 .000 -.645 -.878
- 156SOL OW 466 .688 -.200 -.146
- 156SOL HW1 467 .632 -.119 -.137
- 156SOL HW2 468 .740 -.196 -.232
- 157SOL OW 469 .903 .086 .133
- 157SOL HW1 470 .954 .087 .047
- 157SOL HW2 471 .959 .044 .204
- 158SOL OW 472 -.136 .135 .523
- 158SOL HW1 473 -.063 .118 .456
- 158SOL HW2 474 -.167 .048 .561
- 159SOL OW 475 -.474 -.289 .477
- 159SOL HW1 476 -.407 -.277 .403
- 159SOL HW2 477 -.514 -.200 .500
- 160SOL OW 478 .130 -.068 -.011
- 160SOL HW1 479 .089 -.142 .042
- 160SOL HW2 480 .194 -.017 .047
- 161SOL OW 481 -.582 .927 .672
- 161SOL HW1 482 -.522 .846 .674
- 161SOL HW2 483 -.542 .996 .612
- 162SOL OW 484 .830 -.589 -.440
- 162SOL HW1 485 .825 -.556 -.345
- 162SOL HW2 486 .744 -.570 -.486
- 163SOL OW 487 .672 -.246 .154
- 163SOL HW1 488 .681 -.236 .055
- 163SOL HW2 489 .632 -.335 .175
- 164SOL OW 490 -.212 -.142 -.468
- 164SOL HW1 491 -.159 -.132 -.552
- 164SOL HW2 492 -.239 -.052 -.434
- 165SOL OW 493 -.021 .175 -.899
- 165SOL HW1 494 .018 .090 -.935
- 165SOL HW2 495 -.119 .177 -.918
- 166SOL OW 496 .263 .326 .720
- 166SOL HW1 497 .184 .377 .686
- 166SOL HW2 498 .254 .311 .818
- 167SOL OW 499 -.668 -.250 .031
- 167SOL HW1 500 -.662 -.343 .068
- 167SOL HW2 501 -.727 -.250 -.049
- 168SOL OW 502 .822 -.860 -.490
- 168SOL HW1 503 .862 -.861 -.582
- 168SOL HW2 504 .832 -.768 -.450
- 169SOL OW 505 .916 .910 .291
- 169SOL HW1 506 .979 .948 .223
- 169SOL HW2 507 .956 .827 .330
- 170SOL OW 508 -.358 -.255 .044
- 170SOL HW1 509 -.450 -.218 .051
- 170SOL HW2 510 -.320 -.235 -.046
- 171SOL OW 511 .372 -.574 -.372
- 171SOL HW1 512 .359 -.481 -.406
- 171SOL HW2 513 .288 -.626 -.385
- 172SOL OW 514 -.248 -.570 -.573
- 172SOL HW1 515 -.188 -.567 -.493
- 172SOL HW2 516 -.323 -.506 -.560
- 173SOL OW 517 -.823 -.764 .696
- 173SOL HW1 518 -.893 -.811 .750
- 173SOL HW2 519 -.764 -.832 .653
- 174SOL OW 520 -.848 .236 -.891
- 174SOL HW1 521 -.856 .200 -.984
- 174SOL HW2 522 -.850 .160 -.826
- 175SOL OW 523 .590 -.375 .491
- 175SOL HW1 524 .632 -.433 .421
- 175SOL HW2 525 .546 -.296 .447
- 176SOL OW 526 -.153 .385 -.481
- 176SOL HW1 527 -.080 .454 -.477
- 176SOL HW2 528 -.125 .310 -.540
- 177SOL OW 529 .255 -.514 .290
- 177SOL HW1 530 .159 -.513 .263
- 177SOL HW2 531 .267 -.461 .374
- 178SOL OW 532 .105 -.849 -.136
- 178SOL HW1 533 .028 -.882 -.082
- 178SOL HW2 534 .190 -.879 -.094
- 179SOL OW 535 .672 .203 -.373
- 179SOL HW1 536 .762 .187 -.413
- 179SOL HW2 537 .680 .208 -.274
- 180SOL OW 538 .075 .345 .033
- 180SOL HW1 539 -.017 .317 .004
- 180SOL HW2 540 .106 .422 -.023
- 181SOL OW 541 -.422 .856 -.464
- 181SOL HW1 542 -.479 .908 -.527
- 181SOL HW2 543 -.326 .868 -.488
- 182SOL OW 544 .072 .166 .318
- 182SOL HW1 545 .055 .249 .264
- 182SOL HW2 546 .162 .129 .296
- 183SOL OW 547 -.679 -.527 .119
- 183SOL HW1 548 -.778 -.538 .121
- 183SOL HW2 549 -.645 -.512 .212
- 184SOL OW 550 .613 .842 -.431
- 184SOL HW1 551 .669 .923 -.448
- 184SOL HW2 552 .672 .762 -.428
- 185SOL OW 553 -.369 -.095 -.903
- 185SOL HW1 554 -.336 -.031 -.972
- 185SOL HW2 555 -.303 -.101 -.828
- 186SOL OW 556 .716 .565 -.154
- 186SOL HW1 557 .735 .630 -.080
- 186SOL HW2 558 .776 .485 -.145
- 187SOL OW 559 -.412 -.642 -.229
- 187SOL HW1 560 -.421 -.652 -.130
- 187SOL HW2 561 -.316 -.649 -.255
- 188SOL OW 562 .390 -.121 -.302
- 188SOL HW1 563 .299 -.080 -.304
- 188SOL HW2 564 .383 -.215 -.270
- 189SOL OW 565 -.188 .883 -.608
- 189SOL HW1 566 -.215 .794 -.645
- 189SOL HW2 567 -.187 .951 -.681
- 190SOL OW 568 -.637 .325 .449
- 190SOL HW1 569 -.572 .251 .438
- 190SOL HW2 570 -.617 .375 .533
- 191SOL OW 571 .594 .745 .652
- 191SOL HW1 572 .644 .830 .633
- 191SOL HW2 573 .506 .747 .604
- 192SOL OW 574 -.085 .342 -.220
- 192SOL HW1 575 -.102 .373 -.314
- 192SOL HW2 576 -.169 .305 -.182
- 193SOL OW 577 -.132 -.928 -.345
- 193SOL HW1 578 -.094 -.837 -.330
- 193SOL HW2 579 -.140 -.945 -.444
- 194SOL OW 580 .859 -.488 .016
- 194SOL HW1 581 .813 -.473 .104
- 194SOL HW2 582 .903 -.403 -.014
- 195SOL OW 583 .661 -.072 -.909
- 195SOL HW1 584 .615 .016 -.922
- 195SOL HW2 585 .760 -.060 -.916
- 196SOL OW 586 -.454 -.011 -.142
- 196SOL HW1 587 -.550 -.022 -.169
- 196SOL HW2 588 -.398 -.078 -.190
- 197SOL OW 589 .859 -.906 .861
- 197SOL HW1 590 .913 -.975 .909
- 197SOL HW2 591 .827 -.837 .927
- 198SOL OW 592 -.779 -.878 .087
- 198SOL HW1 593 -.802 -.825 .005
- 198SOL HW2 594 -.698 -.934 .068
- 199SOL OW 595 -.001 -.293 .851
- 199SOL HW1 596 -.072 -.305 .781
- 199SOL HW2 597 .000 -.372 .911
- 200SOL OW 598 .221 -.548 -.018
- 200SOL HW1 599 .156 -.621 -.039
- 200SOL HW2 600 .225 -.534 .080
- 201SOL OW 601 .079 -.622 .653
- 201SOL HW1 602 .078 -.669 .741
- 201SOL HW2 603 .161 -.650 .602
- 202SOL OW 604 .672 -.471 -.238
- 202SOL HW1 605 .594 -.521 -.200
- 202SOL HW2 606 .669 -.376 -.207
- 203SOL OW 607 -.038 .192 -.635
- 203SOL HW1 608 -.042 .102 -.591
- 203SOL HW2 609 -.035 .181 -.734
- 204SOL OW 610 .428 .424 .520
- 204SOL HW1 611 .458 .352 .458
- 204SOL HW2 612 .389 .384 .603
- 205SOL OW 613 -.157 -.375 -.758
- 205SOL HW1 614 -.250 -.400 -.785
- 205SOL HW2 615 -.131 -.425 -.676
- 206SOL OW 616 .317 .547 -.582
- 206SOL HW1 617 .355 .488 -.510
- 206SOL HW2 618 .357 .521 -.670
- 207SOL OW 619 .812 -.276 .687
- 207SOL HW1 620 .844 -.266 .593
- 207SOL HW2 621 .733 -.338 .689
- 208SOL OW 622 -.438 .214 -.750
- 208SOL HW1 623 -.386 .149 -.695
- 208SOL HW2 624 -.487 .277 -.689
- 209SOL OW 625 -.861 .034 -.708
- 209SOL HW1 626 -.924 -.038 -.739
- 209SOL HW2 627 -.768 -.002 -.708
- 210SOL OW 628 .770 -.532 .301
- 210SOL HW1 629 .724 -.619 .318
- 210SOL HW2 630 .861 -.535 .342
- 211SOL OW 631 .618 -.295 -.578
- 211SOL HW1 632 .613 -.213 -.521
- 211SOL HW2 633 .707 -.298 -.623
- 212SOL OW 634 -.510 .052 .168
- 212SOL HW1 635 -.475 .011 .084
- 212SOL HW2 636 -.600 .014 .188
- 213SOL OW 637 -.562 .453 .691
- 213SOL HW1 638 -.621 .533 .695
- 213SOL HW2 639 -.547 .418 .784
- 214SOL OW 640 -.269 .221 .882
- 214SOL HW1 641 -.353 .220 .936
- 214SOL HW2 642 -.267 .304 .826
- 215SOL OW 643 .039 -.785 .300
- 215SOL HW1 644 .138 -.796 .291
- 215SOL HW2 645 -.001 -.871 .332
- 216SOL OW 646 .875 -.216 .337
- 216SOL HW1 647 .798 -.251 .283
- 216SOL HW2 648 .843 -.145 .399
- 1.86206 1.86206 1.86206
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/gmxpreprocess/grompp.h"
-#include "gromacs/gmxpreprocess/genbox.h"
+#include "gromacs/gmxpreprocess/solvate.h"
+#include "gromacs/gmxpreprocess/insert-molecules.h"
#include "gromacs/gmxpreprocess/pdb2gmx.h"
#include "gromacs/gmxpreprocess/protonate.h"
#include "gromacs/gmxpreprocess/x2top.h"
"Convert and manipulates structure files");
registerModule(manager, &gmx_eneconv, "eneconv",
"Convert energy files");
- registerModule(manager, &gmx_genbox, "genbox",
+ registerModule(manager, &gmx_solvate, "solvate",
"Solvate a system");
+ registerModule(manager, &gmx_insert_molecules, "insert-molecules",
+ "Insert molecules into existing vacancies");
+ registerObsoleteTool(manager, "genbox");
registerModule(manager, &gmx_genconf, "genconf",
"Multiply a conformation in 'random' orientations");
registerModule(manager, &gmx_genion, "genion",
group.addModuleWithDescription("editconf", "Edit the box and write subgroups");
group.addModule("protonate");
group.addModule("x2top");
- group.addModule("genbox");
+ group.addModule("solvate");
+ group.addModule("insert-molecules");
group.addModule("genconf");
group.addModule("genion");
group.addModule("genrestr");