*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
#ifndef GMX_GMXPREPROCESS_ADD_PAR_H
#define GMX_GMXPREPROCESS_ADD_PAR_H
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-#include "gromacs/gmxpreprocess/pdb2top.h"
#include "gromacs/utility/real.h"
+struct t_params;
+struct t_restp;
+
void add_param(t_params *ps, int ai, int aj, const real *c, char *s);
void add_imp_param(t_params *ps, int ai, int aj, int ak, int al,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
#include "gromacs/compat/make_unique.h"
#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
#include "gromacs/gmxpreprocess/topio.h"
#include "gromacs/gmxpreprocess/toputil.h"
#include "gromacs/math/functions.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2019, 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.
#ifndef GMX_GMXPREPROCESS_CONVPARM_H
#define GMX_GMXPREPROCESS_CONVPARM_H
-#include "gromacs/gmxpreprocess/grompp-impl.h"
#include "gromacs/utility/real.h"
struct gmx_mtop_t;
+struct t_molinfo;
+struct t_params;
void convert_params(int atnr, t_params nbtypes[],
t_molinfo *mi,
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2018,2019, 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.
#ifndef GMX_GMXPREPROCESS_FFLIBUTIL_H
#define GMX_GMXPREPROCESS_FFLIBUTIL_H
-#include <stdio.h>
+#include <cstdio>
#include <string>
#include <vector>
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
#include "gromacs/fileio/confio.h"
#include "gromacs/gmxpreprocess/gpp_nextnb.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/gmxpreprocess/pgutil.h"
#include "gromacs/gmxpreprocess/resall.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2018,2019, 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.
#ifndef GMX_GMXPREPROCESS_GEN_AD_H
#define GMX_GMXPREPROCESS_GEN_AD_H
-#include "gromacs/gmxpreprocess/gpp_nextnb.h"
-#include "gromacs/gmxpreprocess/resall.h"
-#include "gromacs/gmxpreprocess/toputil.h"
+struct t_atoms;
+struct t_excls;
+struct t_hackblock;
+struct t_nextnb;
+struct t_params;
+struct t_restp;
void generate_excls(t_nextnb *nnb, int nrexcl, t_excls excls[]);
void clean_excls(t_nextnb *nnb, int nrexcl, t_excls excls[]);
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
#include "gromacs/gmxpreprocess/add_par.h"
#include "gromacs/gmxpreprocess/fflibutil.h"
#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/gmxpreprocess/resall.h"
#include "gromacs/gmxpreprocess/toputil.h"
#define OPENDIR '[' /* starting sign for directive */
#define CLOSEDIR ']' /* ending sign for directive */
-typedef struct {
+struct t_vsiteconf
+{
char atomtype[MAXNAME]; /* Type for the XH3/XH2 atom */
bool isplanar; /* If true, the atomtype above and the three connected
* ones are in a planar geometry. The two next entries
int nhydrogens; /* number of connected hydrogens */
char nextheavytype[MAXNAME]; /* Type for the heavy atom bonded to XH2/XH3 */
char dummymass[MAXNAME]; /* The type of MNH* or MCH3* dummy mass to use */
-} t_vsiteconf;
+};
/* Structure to represent average bond and angles values in vsite aromatic
* forcefield; many forcefields (like Amber, OPLS) have some inherent strain in
* 5-rings (i.e. the sum of angles is !=540, but impropers keep it planar)
*/
-typedef struct {
+struct t_vsitetop
+{
char resname[MAXNAME];
int nbonds;
int nangles;
- struct vsitetop_bond {
+ struct vsitetop_bond
+ {
char atom1[MAXNAME];
char atom2[MAXNAME];
float value;
} *bond; /* list of bonds */
- struct vsitetop_angle {
+ struct vsitetop_angle
+ {
char atom1[MAXNAME];
char atom2[MAXNAME];
char atom3[MAXNAME];
float value;
} *angle; /* list of angles */
-} t_vsitetop;
+};
enum {
return type;
}
-static int vsite_nm2type(const char *name, gpp_atomtype_t atype)
+static int vsite_nm2type(const char *name, gpp_atomtype *atype)
{
int tp;
}
-static int gen_vsites_trp(gpp_atomtype_t atype, rvec *newx[],
+static int gen_vsites_trp(gpp_atomtype *atype, rvec *newx[],
t_atom *newatom[], char ***newatomname[],
int *o2n[], int *newvsite_type[], int *newcgnr[],
t_symtab *symtab, int *nadd, rvec x[], int *cgnr[],
}
-static int gen_vsites_tyr(gpp_atomtype_t atype, rvec *newx[],
+static int gen_vsites_tyr(gpp_atomtype *atype, rvec *newx[],
t_atom *newatom[], char ***newatomname[],
int *o2n[], int *newvsite_type[], int *newcgnr[],
t_symtab *symtab, int *nadd, rvec x[], int *cgnr[],
static char atomnamesuffix[] = "1234";
-void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
+void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype *atype,
t_atoms *at, t_symtab *symtab, rvec *x[],
t_params plist[], int *vsite_type[], int *cgnr[],
real mHmult, bool bVsiteAromatics,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
#ifndef GMX_GMXPREPROCESS_GEN_VSITE_H
#define GMX_GMXPREPROCESS_GEN_VSITE_H
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-#include "gromacs/gmxpreprocess/hackblock.h"
+#include "gromacs/math/vectypes.h"
#include "gromacs/utility/real.h"
+struct gpp_atomtype;
+struct t_atoms;
+struct t_params;
+struct t_restp;
+struct t_symtab;
+
/* stuff for pdb2gmx */
-void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype_t atype,
- t_atoms *at, struct t_symtab *symtab, rvec *x[],
+void do_vsites(int nrtp, t_restp rtp[], gpp_atomtype *atype,
+ t_atoms *at, t_symtab *symtab, rvec *x[],
t_params plist[], int *dummy_type[], int *cgnr[],
real mHmult, bool bVSiteAromatics,
const char *ffdir);
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018,2019, 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.
#include "gromacs/gmxlib/network.h"
#include "gromacs/gmxpreprocess/calch.h"
#include "gromacs/gmxpreprocess/h_db.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/gmxpreprocess/pgutil.h"
#include "gromacs/gmxpreprocess/resall.h"
#include "gromacs/gmxpreprocess/ter_db.h"
#include "gromacs/math/vec.h"
+#include "gromacs/topology/atoms.h"
#include "gromacs/topology/symtab.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
#ifndef GMX_GMXPREPROCESS_GENHYDRO_H
#define GMX_GMXPREPROCESS_GENHYDRO_H
-#include "gromacs/fileio/pdbio.h"
-#include "gromacs/gmxpreprocess/hackblock.h"
+#include "gromacs/math/vectypes.h"
+
+struct t_atoms;
+struct t_hack;
+struct t_hackblock;
int add_h(t_atoms **pdbaptr, rvec *xptr[],
int nah, t_hackblock ah[],
#include <cmath>
#include <cstring>
+#include "gromacs/gmxpreprocess/grompp-impl.h"
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/gmxpreprocess/topdirs.h"
#include "gromacs/gmxpreprocess/toputil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
-typedef struct gpp_atomtype {
+struct gpp_atomtype
+{
int nr; /* The number of atomtypes */
t_atom *atom; /* Array of atoms */
char ***atomname; /* Names of the atomtypes */
t_param *nb; /* Nonbonded force default params */
int *bondatomtype; /* The bond_atomtype for each atomtype */
int *atomnumber; /* Atomic number, used for QM/MM */
-} t_gpp_atomtype;
+};
-int get_atomtype_type(const char *str, gpp_atomtype_t ga)
+int get_atomtype_type(const char *str, gpp_atomtype *ga)
{
int i;
return NOTSET;
}
-int get_atomtype_ntypes(gpp_atomtype_t ga)
+int get_atomtype_ntypes(gpp_atomtype *ga)
{
return ga->nr;
}
-char *get_atomtype_name(int nt, gpp_atomtype_t ga)
+char *get_atomtype_name(int nt, gpp_atomtype *ga)
{
if ((nt < 0) || (nt >= ga->nr))
{
return *(ga->atomname[nt]);
}
-real get_atomtype_massA(int nt, gpp_atomtype_t ga)
+real get_atomtype_massA(int nt, gpp_atomtype *ga)
{
if ((nt < 0) || (nt >= ga->nr))
{
return ga->atom[nt].m;
}
-real get_atomtype_massB(int nt, gpp_atomtype_t ga)
+real get_atomtype_massB(int nt, gpp_atomtype *ga)
{
if ((nt < 0) || (nt >= ga->nr))
{
return ga->atom[nt].mB;
}
-real get_atomtype_qA(int nt, gpp_atomtype_t ga)
+real get_atomtype_qA(int nt, gpp_atomtype *ga)
{
if ((nt < 0) || (nt >= ga->nr))
{
return ga->atom[nt].q;
}
-real get_atomtype_qB(int nt, gpp_atomtype_t ga)
+real get_atomtype_qB(int nt, gpp_atomtype *ga)
{
if ((nt < 0) || (nt >= ga->nr))
{
return ga->atom[nt].qB;
}
-int get_atomtype_ptype(int nt, gpp_atomtype_t ga)
+int get_atomtype_ptype(int nt, gpp_atomtype *ga)
{
if ((nt < 0) || (nt >= ga->nr))
{
return ga->bondatomtype[nt];
}
-int get_atomtype_atomnumber(int nt, gpp_atomtype_t ga)
+int get_atomtype_atomnumber(int nt, gpp_atomtype *ga)
{
if ((nt < 0) || (nt >= ga->nr))
{
return ga->atomnumber[nt];
}
-real get_atomtype_nbparam(int nt, int param, gpp_atomtype_t ga)
+real get_atomtype_nbparam(int nt, int param, gpp_atomtype *ga)
{
if ((nt < 0) || (nt >= ga->nr))
{
return ga->nb[nt].c[param];
}
-gpp_atomtype_t init_atomtype()
+gpp_atomtype *init_atomtype()
{
- gpp_atomtype_t ga;
+ gpp_atomtype *ga;
snew(ga, 1);
return ga;
}
-int set_atomtype(int nt, gpp_atomtype_t ga, t_symtab *tab,
+int set_atomtype(int nt, gpp_atomtype *ga, t_symtab *tab,
t_atom *a, const char *name, t_param *nb,
int bondatomtype, int atomnumber)
{
return nt;
}
-int add_atomtype(gpp_atomtype_t ga, t_symtab *tab,
+int add_atomtype(gpp_atomtype *ga, t_symtab *tab,
t_atom *a, const char *name, t_param *nb,
int bondatomtype, int atomnumber)
{
}
}
-void print_at (FILE * out, gpp_atomtype_t ga)
+void print_at (FILE * out, gpp_atomtype *ga)
{
int i;
t_atom *atom = ga->atom;
fprintf (out, "\n");
}
-void done_atomtype(gpp_atomtype_t ga)
+void done_atomtype(gpp_atomtype *ga)
{
sfree(ga->atom);
sfree(ga->atomname);
sfree(ga);
}
-static int search_atomtypes(gpp_atomtype_t ga, int *n, int typelist[],
+static int search_atomtypes(gpp_atomtype *ga, int *n, int typelist[],
int thistype,
t_param param[], int ftype)
{
void renum_atype(t_params plist[], gmx_mtop_t *mtop,
int *wall_atomtype,
- gpp_atomtype_t ga, bool bVerbose)
+ gpp_atomtype *ga, bool bVerbose)
{
int i, j, k, l, mi, mj, nat, nrfp, ftype, ntype;
t_atoms *atoms;
sfree(typelist);
}
-void copy_atomtype_atomtypes(gpp_atomtype_t ga, t_atomtypes *atomtypes)
+void copy_atomtype_atomtypes(gpp_atomtype *ga, t_atomtypes *atomtypes)
{
int i, ntype;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2018,2019, 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.
#ifndef GMX_GMXPREPROCESS_GPP_ATOMTYPE_H
#define GMX_GMXPREPROCESS_GPP_ATOMTYPE_H
-#include <stdio.h>
+#include <cstdio>
-#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/utility/real.h"
struct gmx_mtop_t;
-
-typedef struct gpp_atomtype *gpp_atomtype_t;
-
-int get_atomtype_type(const char *str, gpp_atomtype_t at);
+struct gpp_atomtype;
+struct t_atom;
+struct t_atomtypes;
+struct t_param;
+struct t_params;
+struct t_symtab;
+
+int get_atomtype_type(const char *str, gpp_atomtype *at);
/* Return atomtype corresponding to case-insensitive str
or NOTSET if not found */
-int get_atomtype_ntypes(gpp_atomtype_t at);
+int get_atomtype_ntypes(gpp_atomtype *at);
/* Return number of atomtypes */
-char *get_atomtype_name(int nt, gpp_atomtype_t at);
+char *get_atomtype_name(int nt, gpp_atomtype *at);
/* Return name corresponding to atomtype nt, or NULL if not found */
-real get_atomtype_massA(int nt, gpp_atomtype_t at);
-real get_atomtype_massB(int nt, gpp_atomtype_t at);
-real get_atomtype_qA(int nt, gpp_atomtype_t at);
-real get_atomtype_qB(int nt, gpp_atomtype_t at);
-int get_atomtype_ptype(int nt, gpp_atomtype_t at);
+real get_atomtype_massA(int nt, gpp_atomtype *at);
+real get_atomtype_massB(int nt, gpp_atomtype *at);
+real get_atomtype_qA(int nt, gpp_atomtype *at);
+real get_atomtype_qB(int nt, gpp_atomtype *at);
+int get_atomtype_ptype(int nt, gpp_atomtype *at);
int get_atomtype_batype(int nt, const gpp_atomtype* at);
-int get_atomtype_atomnumber(int nt, gpp_atomtype_t at);
+int get_atomtype_atomnumber(int nt, gpp_atomtype *at);
/* Return the above variable for atomtype nt, or NOTSET if not found */
-real get_atomtype_nbparam(int nt, int param, gpp_atomtype_t at);
+real get_atomtype_nbparam(int nt, int param, gpp_atomtype *at);
/* Similar to the previous but returns the paramth parameter or NOTSET */
-gpp_atomtype_t init_atomtype();
+gpp_atomtype *init_atomtype();
/* Return a new atomtype structure */
-void done_atomtype(gpp_atomtype_t at);
+void done_atomtype(gpp_atomtype *at);
/* Free the memory in the structure */
-int set_atomtype(int nt, gpp_atomtype_t at, struct t_symtab *tab,
+int set_atomtype(int nt, gpp_atomtype *at, t_symtab *tab,
t_atom *a, const char *name, t_param *nb,
int bondatomtype, int atomnumber);
/* Set the values of an existing atom type nt. Returns nt on success or
NOTSET on error. */
-int add_atomtype(gpp_atomtype_t at, struct t_symtab *tab,
+int add_atomtype(gpp_atomtype *at, t_symtab *tab,
t_atom *a, const char *name, t_param *nb,
int bondatomtype, int atomnumber);
/* Add a complete new atom type to an existing atomtype structure. Returns
the number of the atom type. */
-void print_at (FILE * out, gpp_atomtype_t at);
+void print_at (FILE * out, gpp_atomtype *at);
/* Print an atomtype record to a text file */
void renum_atype(t_params plist[], gmx_mtop_t *mtop,
int *wall_atomtype,
- gpp_atomtype_t at, bool bVerbose);
+ gpp_atomtype *at, bool bVerbose);
-void copy_atomtype_atomtypes(gpp_atomtype_t atype, t_atomtypes *atypes);
+void copy_atomtype_atomtypes(gpp_atomtype *atype, t_atomtypes *atypes);
/* Copy from one structure to another */
#endif
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2017,2018,2019, 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.
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/smalloc.h"
-typedef struct {
+struct gpp_bond_atomtype
+{
int nr; /* The number of atomtypes */
char ***atomname; /* Names of the atomtypes */
-} gpp_bond_atomtype;
+};
-int get_bond_atomtype_type(char *str, t_bond_atomtype at)
+int get_bond_atomtype_type(const char *str, gpp_bond_atomtype *at)
{
- gpp_bond_atomtype *ga = reinterpret_cast<gpp_bond_atomtype *>(at);
-
- int i;
-
- for (i = 0; (i < ga->nr); i++)
+ for (int i = 0; (i < at->nr); i++)
{
/* Atom types are always case sensitive */
- if (strcmp(str, *(ga->atomname[i])) == 0)
+ if (strcmp(str, *(at->atomname[i])) == 0)
{
return i;
}
return NOTSET;
}
-char *get_bond_atomtype_name(int nt, t_bond_atomtype at)
+char *get_bond_atomtype_name(int nt, gpp_bond_atomtype *at)
{
- gpp_bond_atomtype *ga = reinterpret_cast<gpp_bond_atomtype *>(at);
-
- if ((nt < 0) || (nt >= ga->nr))
+ if ((nt < 0) || (nt >= at->nr))
{
return nullptr;
}
- return *(ga->atomname[nt]);
+ return *(at->atomname[nt]);
}
-t_bond_atomtype init_bond_atomtype()
+gpp_bond_atomtype *init_bond_atomtype()
{
gpp_bond_atomtype *ga;
snew(ga, 1);
- return reinterpret_cast<t_bond_atomtype>(ga);
+ return ga;
}
-void add_bond_atomtype(t_bond_atomtype at, t_symtab *tab,
+void add_bond_atomtype(gpp_bond_atomtype *at, t_symtab *tab,
char *name)
{
- gpp_bond_atomtype *ga = reinterpret_cast<gpp_bond_atomtype *>(at);
-
- ga->nr++;
- srenew(ga->atomname, ga->nr);
- ga->atomname[ga->nr-1] = put_symtab(tab, name);
+ at->nr++;
+ srenew(at->atomname, at->nr);
+ at->atomname[at->nr-1] = put_symtab(tab, name);
}
-void done_bond_atomtype(t_bond_atomtype *at)
+void done_bond_atomtype(gpp_bond_atomtype **at)
{
- gpp_bond_atomtype *ga = reinterpret_cast<gpp_bond_atomtype *>(*at);
-
- sfree(ga->atomname);
- ga->nr = 0;
- sfree(ga);
+ sfree((*at)->atomname);
+ (*at)->nr = 0;
+ sfree(*at);
*at = nullptr;
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2018,2019, 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.
* the research papers on the package. Check out http://www.gromacs.org.
*/
-#ifndef GMX_GMXPREPROCESS_GPP_BONDATOMTYPE_H
-#define GMX_GMXPREPROCESS_GPP_BONDATOMTYPE_H
+#ifndef GMX_GMXPREPROCESS_GPP_BOND_ATOMTYPE_H
+#define GMX_GMXPREPROCESS_GPP_BOND_ATOMTYPE_H
-#include <stdio.h>
+#include <cstdio>
-typedef struct gpp_bondatomtype *t_bond_atomtype;
+struct gpp_bond_atomtype;
+struct t_symtab;
-int get_bond_atomtype_type(char *str, t_bond_atomtype at);
+int get_bond_atomtype_type(const char *str, gpp_bond_atomtype *at);
/* Return atomtype corresponding to case-insensitive str
or NOTSET if not found */
-char *get_bond_atomtype_name(int nt, t_bond_atomtype at);
+char *get_bond_atomtype_name(int nt, gpp_bond_atomtype *at);
/* Return name corresponding to atomtype nt, or NULL if not found */
-t_bond_atomtype init_bond_atomtype();
+gpp_bond_atomtype *init_bond_atomtype();
/* Return a new atomtype structure */
-void done_bond_atomtype(t_bond_atomtype *at);
+void done_bond_atomtype(gpp_bond_atomtype **at);
/* Free the memory in the structure */
-void add_bond_atomtype(t_bond_atomtype at, struct t_symtab *tab,
+void add_bond_atomtype(gpp_bond_atomtype *at, t_symtab *tab,
char *name);
/* Add a complete new atom type to an existing atomtype structure */
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2018,2019, 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.
#include <cstdlib>
+#include "gromacs/gmxpreprocess/grompp-impl.h"
#include "gromacs/gmxpreprocess/toputil.h"
#include "gromacs/topology/ifunc.h"
#include "gromacs/utility/fatalerror.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2019, 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.
#ifndef GMX_GMXPREPROCESS_GPP_NEXTNB_H
#define GMX_GMXPREPROCESS_GPP_NEXTNB_H
-#include "gromacs/gmxpreprocess/grompp-impl.h"
+struct t_blocka;
+struct t_params;
-typedef struct {
+struct t_nextnb
+{
int nr; /* nr atoms (0 <= i < nr) (atoms->nr) */
int nrex; /* with nrex lists of neighbours */
/* respectively containing zeroth, first */
int **nrexcl; /* with (0 <= nrx < nrexcl[i][nre]) neigbours */
/* per list stored in one 2d array of lists */
int ***a; /* like this: a[i][nre][nrx] */
-} t_nextnb;
+};
void init_nnb(t_nextnb *nnb, int nr, int nrex);
/* Initiate the arrays for nnb (see above) */
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/real.h"
-struct t_block;
-struct t_blocka;
-
#define MAXSLEN 32
-typedef struct {
- bool bSet; /* Has this combination been set */
- real c[4]; /* The non-bonded parameters */
-} t_nbparam;
-/* The t_nbparam struct is used to temporary store the explicit
- * non-bonded parameter combinations, which will be copied to t_params.
- */
-
-typedef struct {
+struct t_param
+{
int a[MAXATOMLIST]; /* The atom list (eg. bonds: particle */
/* i = a[0] (ai), j = a[1] (aj)) */
real c[MAXFORCEPARAM]; /* Force parameters (eg. b0 = c[0]) */
char s[MAXSLEN]; /* A string (instead of parameters), *
* read from the .rtp file in pdb2gmx */
const int &ai() const { return a[0]; }
- int &ai() { return a[0]; }
+ int &ai() { return a[0]; }
const int &aj() const { return a[1]; }
- int &aj() { return a[1]; }
+ int &aj() { return a[1]; }
const int &ak() const { return a[2]; }
- int &ak() { return a[2]; }
+ int &ak() { return a[2]; }
const int &al() const { return a[3]; }
- int &al() { return a[3]; }
+ int &al() { return a[3]; }
const int &am() const { return a[4]; }
- int &am() { return a[4]; }
+ int &am() { return a[4]; }
real &c0() { return c[0]; }
real &c1() { return c[1]; }
real &c2() { return c[2]; }
-} t_param;
+};
-typedef struct { // NOLINT (clang-analyzer-optin.performance.Padding)
+struct t_params
+{ // NOLINT (clang-analyzer-optin.performance.Padding)
int nr; /* The number of bonds in this record */
int maxnr; /* The amount of elements in the array */
t_param *param; /* Array of parameters (dim: nr or nr*nr) */
int *cmap_types; /* Store the five atomtypes followed by a number that identifies the type */
int nct; /* Number of allocated elements in cmap_types */
+};
-} t_params;
-
-typedef struct {
+struct t_excls
+{
int nr; /* The number of exclusions */
int *e; /* The excluded atoms */
-} t_excls;
+};
-typedef struct {
+struct t_molinfo
+{
char **name;
int nrexcl; /* Number of exclusions per atom */
bool excl_set; /* Have exclusions been generated? */
t_block mols; /* Molecules */
t_blocka excls; /* Exclusions */
t_params plist[F_NRE]; /* Parameters in old style */
-} t_molinfo;
+};
-typedef struct {
+struct t_mols
+{
char *name;
int nr;
-} t_mols;
+};
bool is_int(double x);
/* Returns TRUE when x is integer */
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
}
}
-static void check_cg_sizes(const char *topfn, const t_block *cgs, warninp_t wi)
+static void check_cg_sizes(const char *topfn, const t_block *cgs, warninp *wi)
{
int maxsize, cg;
char warn_buf[STRLEN];
}
}
-static void check_bonds_timestep(const gmx_mtop_t *mtop, double dt, warninp_t wi)
+static void check_bonds_timestep(const gmx_mtop_t *mtop, double dt, warninp *wi)
{
/* This check is not intended to ensure accurate integration,
* rather it is to signal mistakes in the mdp settings.
static void check_shells_inputrec(gmx_mtop_t *mtop,
t_inputrec *ir,
- warninp_t wi)
+ warninp *wi)
{
gmx_mtop_atomloop_all_t aloop;
const t_atom *atom;
new_status(const char *topfile, const char *topppfile, const char *confin,
t_gromppopts *opts, t_inputrec *ir, gmx_bool bZero,
bool bGenVel, bool bVerbose, t_state *state,
- gpp_atomtype_t atype, gmx_mtop_t *sys,
+ gpp_atomtype *atype, gmx_mtop_t *sys,
int *nmi, t_molinfo **mi, t_molinfo **intermolecular_interactions,
t_params plist[],
int *comb, double *reppow, real *fudgeQQ,
gmx_bool bMorse,
- warninp_t wi)
+ warninp *wi)
{
t_molinfo *molinfo = nullptr;
std::vector<gmx_molblock_t> molblock;
const char *fn,
int rc_scaling, int ePBC,
rvec com,
- warninp_t wi)
+ warninp *wi)
{
gmx_bool *hadAtom;
rvec *x, *v;
const char *fnA, const char *fnB,
int rc_scaling, int ePBC,
rvec com, rvec comB,
- warninp_t wi)
+ warninp *wi)
{
read_posres (mtop, mi, FALSE, fnA, rc_scaling, ePBC, com, wi);
/* It is safer to simply read the b-state posres rather than trying
read_posres(mtop, mi, TRUE, fnB, rc_scaling, ePBC, comB, wi);
}
-static void set_wall_atomtype(gpp_atomtype_t at, t_gromppopts *opts,
- t_inputrec *ir, warninp_t wi)
+static void set_wall_atomtype(gpp_atomtype *at, t_gromppopts *opts,
+ t_inputrec *ir, warninp *wi)
{
int i;
char warn_buf[STRLEN];
}
-static int count_constraints(const gmx_mtop_t *mtop, t_molinfo *mi, warninp_t wi)
+static int count_constraints(const gmx_mtop_t *mtop, t_molinfo *mi, warninp *wi)
{
int count, count_mol, i;
t_params *plist;
}
static real get_max_reference_temp(const t_inputrec *ir,
- warninp_t wi)
+ warninp *wi)
{
real ref_t;
int i;
*/
static void checkForUnboundAtoms(const gmx_moltype_t *molt,
gmx_bool bVerbose,
- warninp_t wi)
+ warninp *wi)
{
const t_atoms *atoms = &molt->atoms;
/* Checks all moleculetypes for unbound atoms */
static void checkForUnboundAtoms(const gmx_mtop_t *mtop,
gmx_bool bVerbose,
- warninp_t wi)
+ warninp *wi)
{
for (const gmx_moltype_t &molt : mtop->moltype)
{
*/
static void checkDecoupledModeAccuracy(const gmx_mtop_t *mtop,
const t_inputrec *ir,
- warninp_t wi)
+ warninp *wi)
{
/* We only have issues with decoupled modes with normal MD.
* With stochastic dynamics equipartitioning is enforced strongly.
t_inputrec *ir,
real buffer_temp,
matrix box,
- warninp_t wi)
+ warninp *wi)
{
real rlist_1x1;
int n_nonlin_vsite;
t_gromppopts *opts;
int nmi;
t_molinfo *mi, *intermolecular_interactions;
- gpp_atomtype_t atype;
+ gpp_atomtype *atype;
int nvsite, comb;
t_params *plist;
real fudgeQQ;
gmx_bool have_atomnumber;
gmx_output_env_t *oenv;
gmx_bool bVerbose = FALSE;
- warninp_t wi;
+ warninp *wi;
char warn_buf[STRLEN];
t_filenm fnm[] = {
}
}
- struct pull_t *pull = nullptr;
+ pull_t *pull = nullptr;
if (ir->bPull)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
#include <vector>
#include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/utility/arraysize.h"
#include "gromacs/utility/cstringutil.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2019, 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.
#ifndef GMX_GMXPREPROCESS_H_DB_H
#define GMX_GMXPREPROCESS_H_DB_H
-#include <stdio.h>
+#include <cstdio>
-#include "gromacs/gmxpreprocess/hackblock.h"
+struct t_hack;
+struct t_hackblock;
/* functions for the h-database */
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2017,2018,2019, 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.
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/math/vec.h"
#include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/topology/atoms.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
#ifndef GMX_GMXPREPROCESS_HACKBLOCK_H
#define GMX_GMXPREPROCESS_HACKBLOCK_H
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-#include "gromacs/topology/symtab.h"
+#include <cstdio>
+
+#include "gromacs/topology/ifunc.h"
+
+struct t_atom;
/* Used for reading .rtp/.tdb */
/* ebtsBONDS must be the first, new types can be added to the end */
free/clear/copy/merge_t_* functions stay updated */
/* BONDEDS */
-typedef struct {
+struct t_rbonded
+{
char *a[MAXATOMLIST]; /* atom names */
char *s; /* optional define string which gets copied from
.rtp/.tdb to .top and will be parsed by cpp
during grompp */
- bool match; /* boolean to mark that the entry has been found */
+ bool match; /* boolean to mark that the entry has been found */
char* &ai() { return a[0]; }
char* &aj() { return a[1]; }
char* &ak() { return a[2]; }
char* &al() { return a[3]; }
char* &am() { return a[4]; }
-} t_rbonded;
+};
-typedef struct {
+struct t_rbondeds
+{
int type; /* The type of bonded interaction */
int nb; /* number of bondeds */
t_rbonded *b; /* bondeds */
-} t_rbondeds;
+};
/* RESIDUES (rtp) */
-typedef struct {
+struct t_restp
+{
char *resname;
/* The base file name this rtp entry was read from */
char *filebase;
bool bRemoveDihedralIfWithImproper;
/* list of bonded interactions to add */
t_rbondeds rb[ebtsNR];
-} t_restp;
+};
/* Block to hack residues */
-typedef struct {
+struct t_hack
+{
int nr; /* Number of atoms to hack */
char *oname; /* Old name */
char *nname; /* New name */
char* &aj() { return a[1]; }
char* &ak() { return a[2]; }
char* &al() { return a[3]; }
-} t_hack;
+};
-typedef struct {
+struct t_hackblock
+{
char *name; /* Name of hack block (residue or terminus) */
char *filebase; /* The base file name this entry was read from */
int nhack; /* Number of atoms to hack */
t_hack *hack; /* Hack list */
/* list of bonded interactions to add */
t_rbondeds rb[ebtsNR];
-} t_hackblock;
-
-typedef struct {
- char *res1, *res2;
- char *atom1, *atom2;
- char *newres1, *newres2;
- int nbond1, nbond2;
- real length;
-} t_specbond;
-
-t_specbond *get_specbonds(int *nspecbond);
-void done_specbonds(int nsb, t_specbond sb[]);
+};
void free_t_restp(int nrtp, t_restp **rtp);
void free_t_hack(int nh, t_hack **h);
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2019, 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.
#define GMX_GMXPREPROCESS_HIZZIE_H
#include "gromacs/math/vectypes.h"
-#include "gromacs/topology/atoms.h"
+#include "gromacs/utility/real.h"
+
+struct t_atoms;
void set_histp(t_atoms *pdba, rvec *x, real angle, real distance);
/* calculate HIStidine protonation state */
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
#include "gromacs/gmxpreprocess/fflibutil.h"
#include "gromacs/gmxpreprocess/gpp_atomtype.h"
#include "gromacs/gmxpreprocess/gpp_nextnb.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/gmxpreprocess/pdb2top.h"
#include "gromacs/gmxpreprocess/toppush.h"
}
}
-int nm2type(int nnm, t_nm2type nm2t[], struct t_symtab *tab, t_atoms *atoms,
- gpp_atomtype_t atype, int *nbonds, t_params *bonds)
+int nm2type(int nnm, t_nm2type nm2t[], t_symtab *tab, t_atoms *atoms,
+ gpp_atomtype *atype, int *nbonds, t_params *bonds)
{
int cur = 0;
#define prev (1-cur)
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2019, 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.
#ifndef GMX_GMX_NM2TYPE_H
#define GMX_GMX_NM2TYPE_H
-#include <stdio.h>
+#include <cstdio>
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-#include "gromacs/topology/atoms.h"
+struct gpp_atomtype;
+struct t_atoms;
+struct t_params;
+struct t_symtab;
-typedef struct {
+struct t_nm2type
+{
char *elem, *type;
double q, m;
int nbonds;
char **bond;
double *blen;
-} t_nm2type;
+};
t_nm2type *rd_nm2type(const char *ffdir, int *nnm);
/* Read the name 2 type database. nnm is the number of entries
void dump_nm2type(FILE *fp, int nnm, t_nm2type nm2t[]);
/* Dump the database for debugging. Can be reread by the program */
-int nm2type(int nnm, t_nm2type nm2t[], struct t_symtab *tab, t_atoms *atoms,
- gpp_atomtype_t atype, int *nbonds, t_params *bond);
+int nm2type(int nnm, t_nm2type nm2t[], t_symtab *tab, t_atoms *atoms,
+ gpp_atomtype *atype, int *nbonds, t_params *bond);
/* Try to determine the atomtype (force field dependent) for the atoms
* with help of the bond list
*/
#include "gromacs/gmxlib/conformation-utilities.h"
#include "gromacs/gmxpreprocess/fflibutil.h"
#include "gromacs/gmxpreprocess/genhydro.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
#include "gromacs/gmxpreprocess/h_db.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
#include "gromacs/gmxpreprocess/hizzie.h"
#include "gromacs/gmxpreprocess/pdb2top.h"
#include "gromacs/gmxpreprocess/pgutil.h"
check_occupancy(&pdba_all, inputConfFile_.c_str(), bVerbose_);
/* Read atomtypes... */
- gpp_atomtype_t atype = read_atype(ffdir_, &symtab);
+ gpp_atomtype *atype = read_atype(ffdir_, &symtab);
/* read residue database */
printf("Reading residue database... (%s)\n", forcefield_);
#include "gromacs/gmxpreprocess/gen_ad.h"
#include "gromacs/gmxpreprocess/gen_vsite.h"
#include "gromacs/gmxpreprocess/gpp_nextnb.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
#include "gromacs/gmxpreprocess/h_db.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/gmxpreprocess/pgutil.h"
#include "gromacs/gmxpreprocess/resall.h"
+#include "gromacs/gmxpreprocess/specbond.h"
#include "gromacs/gmxpreprocess/topdirs.h"
#include "gromacs/gmxpreprocess/topio.h"
#include "gromacs/gmxpreprocess/toputil.h"
void write_top(FILE *out, const char *pr, const char *molname,
t_atoms *at, bool bRTPresname,
int bts[], t_params plist[], t_excls excls[],
- gpp_atomtype_t atype, int *cgnr, int nrexcl)
+ gpp_atomtype *atype, int *cgnr, int nrexcl)
/* NOTE: nrexcl is not the size of *excl! */
{
if (at && atype && cgnr)
void pdb2top(FILE *top_file, const char *posre_fn, const char *molname,
- t_atoms *atoms, rvec **x, gpp_atomtype_t atype, t_symtab *tab,
+ t_atoms *atoms, rvec **x, gpp_atomtype *atype, t_symtab *tab,
int nrtp, t_restp rtp[],
t_restp *restp, t_hackblock *hb,
bool bAllowMissing,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
#ifndef GMX_GMXPREPROCESS_PDB2TOP_H
#define GMX_GMXPREPROCESS_PDB2TOP_H
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-#include "gromacs/gmxpreprocess/hackblock.h"
-#include "gromacs/gmxpreprocess/toputil.h"
+#include <cstdio>
+
+#include "gromacs/math/vectypes.h"
+
+struct gpp_atomtype;
+struct t_atoms;
+struct t_excls;
+struct t_hackblock;
+struct t_mols;
+struct t_params;
+struct t_resinfo;
+struct t_restp;
+struct t_ssbond;
+struct t_symtab;
/* this *MUST* correspond to array in pdb2top.c */
enum {
};
extern const char *hh[ehisNR];
-typedef struct {
- int res1, res2;
- char *a1, *a2;
-} t_ssbond;
-
void choose_ff(const char *ffsel,
char *forcefield, int ff_maxlen,
char *ffdir, int ffdir_maxlen);
void write_top(FILE *out, const char *pr, const char *molname,
t_atoms *at, bool bRTPresname,
int bts[], t_params plist[], t_excls excls[],
- gpp_atomtype_t atype, int *cgnr, int nrexcl);
+ gpp_atomtype *atype, int *cgnr, int nrexcl);
/* NOTE: nrexcl is not the size of *excl! */
void pdb2top(FILE *top_file, const char *posre_fn, const char *molname,
t_atoms *atoms, rvec **x,
- gpp_atomtype_t atype, struct t_symtab *tab,
+ gpp_atomtype *atype, t_symtab *tab,
int nrtp, t_restp rtp[],
t_restp *restp, t_hackblock *hb,
bool bAllowMissing,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
#define GMX_GMXPREPROCESS_READIR_H
#include "gromacs/fileio/readinp.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/real.h"
namespace gmx
{
struct gmx_output_env_t;
struct pull_params_t;
struct pull_t;
+struct t_blocka;
struct t_grpopts;
struct t_inpfile;
struct t_inputrec;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
#include <vector>
#include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/gmxpreprocess/pgutil.h"
+#include "gromacs/topology/atoms.h"
#include "gromacs/topology/symtab.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/strdb.h"
-gpp_atomtype_t read_atype(const char *ffdir, t_symtab *tab)
+gpp_atomtype *read_atype(const char *ffdir, t_symtab *tab)
{
FILE *in;
char buf[STRLEN], name[STRLEN];
double m;
int nratt = 0;
- gpp_atomtype_t at;
+ gpp_atomtype *at;
t_atom *a;
t_param *nb;
return at;
}
-static void print_resatoms(FILE *out, gpp_atomtype_t atype, t_restp *rtp)
+static void print_resatoms(FILE *out, gpp_atomtype *atype, t_restp *rtp)
{
int j, tp;
char *tpnm;
}
static bool read_atoms(FILE *in, char *line,
- t_restp *r0, t_symtab *tab, gpp_atomtype_t atype)
+ t_restp *r0, t_symtab *tab, gpp_atomtype *atype)
{
int i, j, cg, maxentries;
char buf[256], buf1[256];
}
void print_resall(FILE *out, int nrtp, t_restp rtp[],
- gpp_atomtype_t atype)
+ gpp_atomtype *atype)
{
int i, bt;
}
void read_resall(const char *rrdb, int *nrtpptr, t_restp **rtp,
- gpp_atomtype_t atype, t_symtab *tab,
+ gpp_atomtype *atype, t_symtab *tab,
bool bAllowOverrideRTP)
{
FILE *in;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2018,2019, 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.
#ifndef GMX_GMXPREPROCESS_RESALL_H
#define GMX_GMXPREPROCESS_RESALL_H
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-#include "gromacs/gmxpreprocess/hackblock.h"
+#include <cstdio>
+
+struct gpp_atomtype;
+struct t_restp;
+struct t_symtab;
char *search_rtp(const char *key, int nrtp, t_restp rtp[]);
/* Search for an entry in the rtp database, returns the rtp residue name.
* Generates a fatal error when rtpname is not found.
*/
-gpp_atomtype_t read_atype(const char *ffdir, struct t_symtab *tab);
+gpp_atomtype *read_atype(const char *ffdir, t_symtab *tab);
/* read atom type database(s) */
void read_resall(const char *resdb, int *nrtp, t_restp **rtp,
- gpp_atomtype_t atype, struct t_symtab *tab,
+ gpp_atomtype *atype, t_symtab *tab,
bool bAllowOverrideRTP);
/* read rtp database, append to the existing database */
void print_resall(FILE *out, int nrtp, t_restp rtp[],
- gpp_atomtype_t atype);
+ gpp_atomtype *atype);
/* write rtp database */
#endif
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/strdb.h"
+struct t_specbond
+{
+ char *res1, *res2;
+ char *atom1, *atom2;
+ char *newres1, *newres2;
+ int nbond1, nbond2;
+ real length;
+};
+
bool yesno()
{
char c;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
#ifndef GMX_GMXPREPROCESS_SPECBOND_H
#define GMX_GMXPREPROCESS_SPECBOND_H
-#include "gromacs/gmxpreprocess/pdb2top.h"
+#include "gromacs/math/vectypes.h"
+
+struct t_atoms;
+struct t_specbond;
+
+struct t_ssbond
+{
+ int res1, res2;
+ char *a1, *a2;
+};
int mk_specbonds(t_atoms *pdba, rvec x[], bool bInteractive,
t_ssbond **specbonds, bool bVerbose);
+t_specbond *get_specbonds(int *nspecbond);
+void done_specbonds(int nsb, t_specbond sb[]);
+
bool yesno();
#endif
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018,2019, 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.
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
#include "gromacs/gmxpreprocess/h_db.h"
+#include "gromacs/gmxpreprocess/hackblock.h"
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/gmxpreprocess/resall.h"
#include "gromacs/gmxpreprocess/toputil.h"
#define FATAL() gmx_fatal(FARGS, "Reading Termini Database: not enough items on line\n%s", line)
static void read_atom(char *line, bool bAdd,
- char **nname, t_atom *a, gpp_atomtype_t atype, int *cgnr)
+ char **nname, t_atom *a, gpp_atomtype *atype, int *cgnr)
{
int nr, i;
char buf[5][30];
}
}
-static void print_atom(FILE *out, t_atom *a, gpp_atomtype_t atype)
+static void print_atom(FILE *out, t_atom *a, gpp_atomtype *atype)
{
fprintf(out, "\t%s\t%g\t%g\n",
get_atomtype_name(a->type, atype), a->m, a->q);
}
static void print_ter_db(const char *ff, char C, int nb, t_hackblock tb[],
- gpp_atomtype_t atype)
+ gpp_atomtype *atype)
{
FILE *out;
int i, j, k, bt, nrepl, nadd, ndel;
static void read_ter_db_file(const char *fn,
int *ntbptr, t_hackblock **tbptr,
- gpp_atomtype_t atype)
+ gpp_atomtype *atype)
{
char filebase[STRLEN], *ptr;
FILE *in;
}
int read_ter_db(const char *ffdir, char ter,
- t_hackblock **tbptr, gpp_atomtype_t atype)
+ t_hackblock **tbptr, gpp_atomtype *atype)
{
char ext[STRLEN];
int ntb;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2018,2019, 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.
#ifndef GMX_GMXPREPROCESS_TER_DB_H
#define GMX_GMXPREPROCESS_TER_DB_H
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-#include "gromacs/gmxpreprocess/hackblock.h"
-
+struct gpp_atomtype;
+struct t_hackblock;
int read_ter_db(const char *ffdir, char ter,
- t_hackblock **tbptr, gpp_atomtype_t atype);
+ t_hackblock **tbptr, gpp_atomtype *atype);
/* Read database for N&C terminal hacking */
t_hackblock **filter_ter(int nb, t_hackblock tb[],
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018,2019, 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.
}
}
-void convert_harmonics(int nrmols, t_molinfo mols[], gpp_atomtype_t atype)
+void convert_harmonics(int nrmols, t_molinfo mols[], gpp_atomtype *atype)
{
int n2m;
t_2morse *t2m;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2019, 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.
#ifndef GMX_GMXPREPROCESS_TOMORSE_H
#define GMX_GMXPREPROCESS_TOMORSE_H
-#include <stdio.h>
+struct gpp_atomtype;
+struct t_molinfo;
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-
-void convert_harmonics(int nrmols, t_molinfo mols[], gpp_atomtype_t atype);
+void convert_harmonics(int nrmols, t_molinfo mols[], gpp_atomtype *atype);
#endif
Count
};
-typedef struct tagDirStack {
+struct DirStack
+{
Directive d;
- struct tagDirStack *prev;
-} DirStack;
+ DirStack *prev;
+};
int ifunc_index(Directive d, int type);
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/warninp.h"
#include "gromacs/gmxpreprocess/gmxcpp.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
#include "gromacs/gmxpreprocess/gpp_bond_atomtype.h"
#include "gromacs/gmxpreprocess/gpp_nextnb.h"
#include "gromacs/gmxpreprocess/grompp-impl.h"
#define OPENDIR '[' /* starting sign for directive */
#define CLOSEDIR ']' /* ending sign for directive */
-static void free_nbparam(t_nbparam **param, int nr)
-{
- int i;
-
- assert(param);
- for (i = 0; i < nr; i++)
- {
- assert(param[i]);
- sfree(param[i]);
- }
- sfree(param);
-}
-
-static int copy_nbparams(t_nbparam **param, int ftype, t_params *plist, int nr)
-{
- int i, j, f;
- int nrfp, ncopy;
-
- nrfp = NRFP(ftype);
-
- ncopy = 0;
- for (i = 0; i < nr; i++)
- {
- for (j = 0; j <= i; j++)
- {
- assert(param);
- if (param[i][j].bSet)
- {
- for (f = 0; f < nrfp; f++)
- {
- plist->param[nr*i+j].c[f] = param[i][j].c[f];
- plist->param[nr*j+i].c[f] = param[i][j].c[f];
- }
- ncopy++;
- }
- }
- }
-
- return ncopy;
-}
-
static void gen_pairs(t_params *nbs, t_params *pairs, real fudge, int comb)
{
int i, j, ntp, nrfp, nrfpA, nrfpB, nnn;
}
}
-double check_mol(const gmx_mtop_t *mtop, warninp_t wi)
+double check_mol(const gmx_mtop_t *mtop, warninp *wi)
{
char buf[256];
int i, ri, pt;
}
static void get_nbparm(char *nb_str, char *comb_str, int *nb, int *comb,
- warninp_t wi)
+ warninp *wi)
{
int i;
char warn_buf[STRLEN];
}
static char ** cpp_opts(const char *define, const char *include,
- warninp_t wi)
+ warninp *wi)
{
int n, len;
int ncppopts = 0;
static char **read_topol(const char *infile, const char *outfile,
const char *define, const char *include,
t_symtab *symtab,
- gpp_atomtype_t atype,
+ gpp_atomtype *atype,
int *nrmols,
t_molinfo **molinfo,
t_molinfo **intermolecular_interactions,
bool bFEP,
bool bZero,
bool usingFullRangeElectrostatics,
- warninp_t wi)
+ warninp *wi)
{
FILE *out;
int i, sl, nb_funct;
real fudgeLJ = -1; /* Multiplication factor to generate 1-4 from LJ */
bool bReadDefaults, bReadMolType, bGenPairs, bWarn_copy_A_B;
double qt = 0, qBt = 0; /* total charge */
- t_bond_atomtype batype;
+ gpp_bond_atomtype *batype;
int lastcg = -1;
int dcatt = -1, nmol_couple;
/* File handling variables */
int *combination_rule,
double *repulsion_power,
real *fudgeQQ,
- gpp_atomtype_t atype,
+ gpp_atomtype *atype,
int *nrmols,
t_molinfo **molinfo,
t_molinfo **intermolecular_interactions,
const t_inputrec *ir,
std::vector<gmx_molblock_t> *molblock,
bool *ffParametrizedWithHBondConstraints,
- warninp_t wi)
+ warninp *wi)
{
/* Tmpfile might contain a long path */
const char *tmpfile;
free(blink);
} /* generate_qmexcl */
-void generate_qmexcl(gmx_mtop_t *sys, t_inputrec *ir, warninp_t wi, GmxQmmmMode qmmmMode)
+void generate_qmexcl(gmx_mtop_t *sys, t_inputrec *ir, warninp *wi, GmxQmmmMode qmmmMode)
{
/* This routine expects molt->molt[m].ilist to be of size F_NRE and ordered.
*/
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2016,2018, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2018,2019, 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.
#include <vector>
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
+#include "gromacs/utility/real.h"
struct gmx_molblock_t;
struct gmx_mtop_t;
+struct gpp_atomtype;
struct t_gromppopts;
struct t_inputrec;
+struct t_molinfo;
+struct t_params;
+struct t_symtab;
struct warninp;
enum struct GmxQmmmMode;
typedef warninp *warninp_t;
const char *topppfile,
t_gromppopts *opts,
bool bZero,
- struct t_symtab *symtab,
+ t_symtab *symtab,
t_params plist[],
int *combination_rule,
double *repulsion_power,
real *fudgeQQ,
- gpp_atomtype_t atype,
+ gpp_atomtype *atype,
int *nrmols,
t_molinfo **molinfo,
t_molinfo **intermolecular_interactions,
#include "gromacs/fileio/warninp.h"
#include "gromacs/gmxpreprocess/gpp_atomtype.h"
#include "gromacs/gmxpreprocess/gpp_bond_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/gmxpreprocess/readir.h"
#include "gromacs/gmxpreprocess/topdirs.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/stringutil.h"
-void generate_nbparams(int comb, int ftype, t_params *plist, gpp_atomtype_t atype,
- warninp_t wi)
+void generate_nbparams(int comb, int ftype, t_params *plist, gpp_atomtype *atype,
+ warninp *wi)
{
int i, j, k = -1, nf;
int nr, nrfp;
}
}
-static void realloc_nb_params(gpp_atomtype_t at,
+/*! \brief Used to temporarily store the explicit non-bonded parameter
+ * combinations, which will be copied to t_params. */
+struct t_nbparam
+{
+ //! Has this combination been set.
+ bool bSet;
+ //! The non-bonded parameters
+ real c[4];
+};
+
+static void realloc_nb_params(gpp_atomtype *at,
t_nbparam ***nbparam, t_nbparam ***pair)
{
/* Add space in the non-bonded parameters matrix */
}
}
+int copy_nbparams(t_nbparam **param, int ftype, t_params *plist, int nr)
+{
+ int i, j, f;
+ int nrfp, ncopy;
+
+ nrfp = NRFP(ftype);
+
+ ncopy = 0;
+ for (i = 0; i < nr; i++)
+ {
+ for (j = 0; j <= i; j++)
+ {
+ GMX_RELEASE_ASSERT(param, "Must have valid parameters");
+ if (param[i][j].bSet)
+ {
+ for (f = 0; f < nrfp; f++)
+ {
+ plist->param[nr*i+j].c[f] = param[i][j].c[f];
+ plist->param[nr*j+i].c[f] = param[i][j].c[f];
+ }
+ ncopy++;
+ }
+ }
+ }
+
+ return ncopy;
+}
+
+void free_nbparam(t_nbparam **param, int nr)
+{
+ int i;
+
+ GMX_RELEASE_ASSERT(param, "Must have valid parameters");
+ for (i = 0; i < nr; i++)
+ {
+ GMX_RELEASE_ASSERT(param[i], "Must have valid parameters");
+ sfree(param[i]);
+ }
+ sfree(param);
+}
+
static void copy_B_from_A(int ftype, double *c)
{
int nrfpA, nrfpB, i;
}
}
-void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
+void push_at (t_symtab *symtab, gpp_atomtype *at, gpp_bond_atomtype *bat,
char *line, int nb_funct,
t_nbparam ***nbparam, t_nbparam ***pair,
- warninp_t wi)
+ warninp *wi)
{
typedef struct {
const char *entry;
int ftype,
bool bAllowRepeat,
const char * line,
- warninp_t wi)
+ warninp *wi)
{
int nr = bt->nr;
int nrfp = NRFP(ftype);
}
void push_bt(Directive d, t_params bt[], int nral,
- gpp_atomtype_t at,
- t_bond_atomtype bat, char *line,
- warninp_t wi)
+ gpp_atomtype *at,
+ gpp_bond_atomtype *bat, char *line,
+ warninp *wi)
{
const char *formal[MAXATOMLIST+1] = {
"%s",
void push_dihedraltype(Directive d, t_params bt[],
- t_bond_atomtype bat, char *line,
- warninp_t wi)
+ gpp_bond_atomtype *bat, char *line,
+ warninp *wi)
{
const char *formal[MAXATOMLIST+1] = {
"%s",
}
-void push_nbt(Directive d, t_nbparam **nbt, gpp_atomtype_t atype,
+void push_nbt(Directive d, t_nbparam **nbt, gpp_atomtype *atype,
char *pline, int nb_funct,
- warninp_t wi)
+ warninp *wi)
{
/* swap the atoms */
const char *form3 = "%*s%*s%*s%lf%lf%lf";
}
void
-push_cmaptype(Directive d, t_params bt[], int nral, gpp_atomtype_t at,
- t_bond_atomtype bat, char *line,
- warninp_t wi)
+push_cmaptype(Directive d, t_params bt[], int nral, gpp_atomtype *at,
+ gpp_bond_atomtype *bat, char *line,
+ warninp *wi)
{
const char *formal = "%s%s%s%s%s%s%s%s%n";
char *resnumberic,
char *resname, char *name, real m0, real q0,
int typeB, char *ctypeB, real mB, real qB,
- warninp_t wi)
+ warninp *wi)
{
int j, resind = 0, resnr;
unsigned char ric;
}
void push_atom(t_symtab *symtab, t_block *cgs,
- t_atoms *at, gpp_atomtype_t atype, char *line, int *lastcg,
- warninp_t wi)
+ t_atoms *at, gpp_atomtype *atype, char *line, int *lastcg,
+ warninp *wi)
{
int nr, ptype;
int cgnumber, atomnr, type, typeB, nscan;
}
void push_molt(t_symtab *symtab, int *nmol, t_molinfo **mol, char *line,
- warninp_t wi)
+ warninp *wi)
{
char type[STRLEN];
int nrexcl, i;
}
static bool default_cmap_params(t_params bondtype[],
- t_atoms *at, gpp_atomtype_t atype,
+ t_atoms *at, gpp_atomtype *atype,
t_param *p, bool bB,
int *cmap_type, int *nparam_def,
- warninp_t wi)
+ warninp *wi)
{
int i, nparam_found;
int ct;
}
static bool default_params(int ftype, t_params bt[],
- t_atoms *at, gpp_atomtype_t atype,
+ t_atoms *at, gpp_atomtype *atype,
t_param *p, bool bB,
t_param **param_def,
int *nparam_def)
void push_bond(Directive d, t_params bondtype[], t_params bond[],
- t_atoms *at, gpp_atomtype_t atype, char *line,
+ t_atoms *at, gpp_atomtype *atype, char *line,
bool bBonded, bool bGenPairs, real fudgeQQ,
bool bZero, bool *bWarn_copy_A_B,
- warninp_t wi)
+ warninp *wi)
{
const char *aaformat[MAXATOMLIST] = {
"%d%d",
}
void push_cmap(Directive d, t_params bondtype[], t_params bond[],
- t_atoms *at, gpp_atomtype_t atype, char *line,
- warninp_t wi)
+ t_atoms *at, gpp_atomtype *atype, char *line,
+ warninp *wi)
{
const char *aaformat[MAXATOMLIST+1] =
{
void push_vsitesn(Directive d, t_params bond[],
t_atoms *at, char *line,
- warninp_t wi)
+ warninp *wi)
{
char *ptr;
int type, ftype, j, n, ret, nj, a;
void push_mol(int nrmols, t_molinfo mols[], char *pline, int *whichmol,
int *nrcopies,
- warninp_t wi)
+ warninp *wi)
{
char type[STRLEN];
}
}
-void push_excl(char *line, gmx::ExclusionBlocks *b2, warninp_t wi)
+void push_excl(char *line, gmx::ExclusionBlocks *b2, warninp *wi)
{
int i, j;
int n;
while (n == 1);
}
-int add_atomtype_decoupled(t_symtab *symtab, gpp_atomtype_t at,
+int add_atomtype_decoupled(t_symtab *symtab, gpp_atomtype *at,
t_nbparam ***nbparam, t_nbparam ***pair)
{
t_atom atom;
plist[F_LJ14].param = nullptr;
}
-static void generate_LJCpairsNB(t_molinfo *mol, int nb_funct, t_params *nbp, warninp_t wi)
+static void generate_LJCpairsNB(t_molinfo *mol, int nb_funct, t_params *nbp, warninp *wi)
{
int n, ntype, i, j, k;
t_atom *atom;
static void decouple_atoms(t_atoms *atoms, int atomtype_decouple,
int couple_lam0, int couple_lam1,
- const char *mol_name, warninp_t wi)
+ const char *mol_name, warninp *wi)
{
int i;
void convert_moltype_couple(t_molinfo *mol, int atomtype_decouple, real fudgeQQ,
int couple_lam0, int couple_lam1,
bool bCoupleIntra, int nb_funct, t_params *nbp,
- warninp_t wi)
+ warninp *wi)
{
convert_pairs_to_pairsQ(mol->plist, fudgeQQ, &mol->atoms);
if (!bCoupleIntra)
#ifndef GMX_GMXPREPROCESS_TOPPUSH_H
#define GMX_GMXPREPROCESS_TOPPUSH_H
-#include "gromacs/fileio/warninp.h"
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/gpp_bond_atomtype.h"
+#include "gromacs/utility/real.h"
enum class Directive : int;
+struct gpp_atomtype;
+struct gpp_bond_atomtype;
+struct t_atoms;
+struct t_block;
+struct t_molinfo;
+struct t_nbparam;
+struct t_param;
+struct t_params;
+struct t_restp;
+struct warninp;
namespace gmx
{
} // namespace gmx
void generate_nbparams(int comb, int funct, t_params plist[],
- gpp_atomtype_t atype,
- warninp_t wi);
+ gpp_atomtype *atype,
+ warninp *wi);
-void push_at (struct t_symtab *symtab, gpp_atomtype_t at,
- t_bond_atomtype bat, char *line, int nb_funct,
+void push_at (struct t_symtab *symtab, gpp_atomtype *at,
+ gpp_bond_atomtype *bat, char *line, int nb_funct,
t_nbparam ***nbparam, t_nbparam ***pair,
- warninp_t wi);
+ warninp *wi);
void push_bt(Directive d, t_params bt[], int nral,
- gpp_atomtype_t at, t_bond_atomtype bat, char *line,
- warninp_t wi);
+ gpp_atomtype *at, gpp_bond_atomtype *bat, char *line,
+ warninp *wi);
void push_dihedraltype(Directive d, t_params bt[],
- t_bond_atomtype bat, char *line,
- warninp_t wi);
+ gpp_bond_atomtype *bat, char *line,
+ warninp *wi);
-void push_cmaptype(Directive d, t_params bt[], int nral, gpp_atomtype_t at,
- t_bond_atomtype bat, char *line,
- warninp_t wi);
+void push_cmaptype(Directive d, t_params bt[], int nral, gpp_atomtype *at,
+ gpp_bond_atomtype *bat, char *line,
+ warninp *wi);
-void push_nbt(Directive d, t_nbparam **nbt, gpp_atomtype_t atype,
+void push_nbt(Directive d, t_nbparam **nbt, gpp_atomtype *atype,
char *plines, int nb_funct,
- warninp_t wi);
+ warninp *wi);
void push_atom(struct t_symtab *symtab,
t_block *cgs,
t_atoms *at,
- gpp_atomtype_t atype,
+ gpp_atomtype *atype,
char *line,
int *lastcg,
- warninp_t wi);
+ warninp *wi);
void push_bond(Directive d, t_params bondtype[], t_params bond[],
- t_atoms *at, gpp_atomtype_t atype, char *line,
+ t_atoms *at, gpp_atomtype *atype, char *line,
bool bBonded, bool bGenPairs, real fudgeQQ,
bool bZero, bool *bWarn_copy_A_B,
- warninp_t wi);
+ warninp *wi);
void push_cmap(Directive d, t_params bondtype[], t_params bond[],
- t_atoms *at, gpp_atomtype_t atype, char *line,
- warninp_t wi);
+ t_atoms *at, gpp_atomtype *atype, char *line,
+ warninp *wi);
void push_vsitesn(Directive d, t_params bond[],
t_atoms *at, char *line,
- warninp_t wi);
+ warninp *wi);
void push_mol(int nrmols, t_molinfo mols[], char *pline,
int *whichmol, int *nrcopies,
- warninp_t wi);
+ warninp *wi);
void push_molt(struct t_symtab *symtab, int *nmol, t_molinfo **mol, char *line,
- warninp_t wi);
+ warninp *wi);
-void push_excl(char *line, gmx::ExclusionBlocks *b2, warninp_t wi);
+void push_excl(char *line, gmx::ExclusionBlocks *b2, warninp *wi);
-int add_atomtype_decoupled(struct t_symtab *symtab, gpp_atomtype_t at,
+int copy_nbparams(t_nbparam **param, int ftype, t_params *plist, int nr);
+
+void free_nbparam(t_nbparam **param, int nr);
+
+int add_atomtype_decoupled(struct t_symtab *symtab, gpp_atomtype *at,
t_nbparam ***nbparam, t_nbparam ***pair);
/* Add an atom type with all parameters set to zero (no interactions).
* Returns the atom type number.
int couple_lam0, int couple_lam1,
bool bCoupleIntra,
int nb_funct, t_params *nbp,
- warninp_t wi);
+ warninp *wi);
/* Setup mol such that the B-state has no interaction with the rest
* of the system, but full interaction with itself.
*/
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
#include <cctype>
#include <cmath>
+#include "gromacs/gmxpreprocess/grompp-impl.h"
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/gmxpreprocess/readir.h"
#include "gromacs/gmxpreprocess/topdirs.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2019, 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.
#ifndef GMX_GMXPREPROCESS_TOPSHAKE_H
#define GMX_GMXPREPROCESS_TOPSHAKE_H
-#include "gromacs/gmxpreprocess/topio.h"
+struct t_atoms;
+struct t_params;
void make_shake (t_params plist[], t_atoms *atoms, int nshake);
#include <algorithm>
#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/gmxpreprocess/topdirs.h"
#include "gromacs/topology/block.h"
/* PRINTING STRUCTURES */
-static void print_bt(FILE *out, Directive d, gpp_atomtype_t at,
+static void print_bt(FILE *out, Directive d, gpp_atomtype *at,
int ftype, int fsubtype, t_params plist[],
bool bFullDih)
{
return q;
}
-void print_atoms(FILE *out, gpp_atomtype_t atype, t_atoms *at, int *cgnr,
+void print_atoms(FILE *out, gpp_atomtype *atype, t_atoms *at, int *cgnr,
bool bRTPresname)
{
int i, ri;
int ftype, int fsubtype, t_params plist[])
{
t_symtab stab;
- gpp_atomtype_t atype;
+ gpp_atomtype *atype;
t_param *param;
t_atom *a;
int i;
#ifndef GMX_GMXPREPROCESS_TOPUTIL_H
#define GMX_GMXPREPROCESS_TOPUTIL_H
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include <cstdio>
enum class Directive : int;
+struct gpp_atomtype;
+struct t_atoms;
+struct t_blocka;
+struct t_excls;
+struct t_molinfo;
+struct t_param;
+struct t_params;
/* UTILITIES */
void print_blocka(FILE *out, const char *szName, const char *szIndex,
const char *szA, t_blocka *block);
-void print_atoms(FILE *out, gpp_atomtype_t atype, t_atoms *at, int *cgnr,
+void print_atoms(FILE *out, gpp_atomtype *atype, t_atoms *at, int *cgnr,
bool bRTPresname);
void print_bondeds(FILE *out, int natoms, Directive d,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018,2019, 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.
#include <algorithm>
#include "gromacs/gmxpreprocess/add_par.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/gmxpreprocess/resall.h"
#include "gromacs/gmxpreprocess/toputil.h"
return angle;
}
-static char *get_atomtype_name_AB(t_atom *atom, gpp_atomtype_t atype)
+static char *get_atomtype_name_AB(t_atom *atom, gpp_atomtype *atype)
{
char *name;
return name;
}
-static bool calc_vsite3_param(gpp_atomtype_t atype,
+static bool calc_vsite3_param(gpp_atomtype *atype,
t_param *param, t_atoms *at,
int nrbond, t_mybonded *bonds,
int nrang, t_mybonded *angles )
return bError;
}
-static bool calc_vsite3out_param(gpp_atomtype_t atype,
+static bool calc_vsite3out_param(gpp_atomtype *atype,
t_param *param, t_atoms *at,
int nrbond, t_mybonded *bonds,
int nrang, t_mybonded *angles)
-int set_vsites(bool bVerbose, t_atoms *atoms, gpp_atomtype_t atype,
+int set_vsites(bool bVerbose, t_atoms *atoms, gpp_atomtype *atype,
t_params plist[])
{
int i, j, ftype;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
#ifndef GMX_GMXPREPROCESS_VSITE_PARM_H
#define GMX_GMXPREPROCESS_VSITE_PARM_H
-#include "gromacs/gmxpreprocess/gpp_atomtype.h"
-#include "gromacs/gmxpreprocess/grompp-impl.h"
-
+struct gpp_atomtype;
struct gmx_moltype_t;
+struct t_atoms;
+struct t_params;
-int set_vsites(bool bVerbose, t_atoms *atoms, gpp_atomtype_t atype,
+int set_vsites(bool bVerbose, t_atoms *atoms, gpp_atomtype *atype,
t_params plist[]);
/* set parameters for virtual sites, return number of virtual sites */
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, 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.
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/gmxpreprocess/gen_ad.h"
+#include "gromacs/gmxpreprocess/gpp_atomtype.h"
#include "gromacs/gmxpreprocess/gpp_nextnb.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
#include "gromacs/gmxpreprocess/hackblock.h"
#include "gromacs/gmxpreprocess/nm2type.h"
#include "gromacs/gmxpreprocess/notset.h"
#include "gromacs/gmxpreprocess/pdb2top.h"
#include "gromacs/gmxpreprocess/toppush.h"
+#include "gromacs/gmxpreprocess/toputil.h"
#include "gromacs/listed-forces/bonded.h"
#include "gromacs/math/units.h"
#include "gromacs/math/utilities.h"
return cgnr;
}
-static gpp_atomtype_t set_atom_type(t_symtab *tab, t_atoms *atoms, t_params *bonds,
- int *nbonds, int nnm, t_nm2type nm2t[])
+static gpp_atomtype *set_atom_type(t_symtab *tab, t_atoms *atoms, t_params *bonds,
+ int *nbonds, int nnm, t_nm2type nm2t[])
{
- gpp_atomtype_t atype;
+ gpp_atomtype *atype;
int nresolved;
atype = init_atomtype();
}
static void print_rtp(const char *filenm, const char *title, t_atoms *atoms,
- t_params plist[], gpp_atomtype_t atype, int cgnr[])
+ t_params plist[], gpp_atomtype *atype, int cgnr[])
{
FILE *fp;
int i, tp;
FILE *fp;
t_params plist[F_NRE];
t_excls *excls;
- gpp_atomtype_t atype;
+ gpp_atomtype *atype;
t_nextnb nnb;
t_nm2type *nm2t;
t_mols mymol;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018,2019, 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.
#include <vector>
#include "gromacs/gmxpreprocess/fflibutil.h"
+#include "gromacs/gmxpreprocess/grompp-impl.h"
#include "gromacs/gmxpreprocess/hackblock.h"
#include "gromacs/topology/residuetypes.h"
#include "gromacs/topology/symtab.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018,2019, 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.
#ifndef GMX_GMXPREPROCESS_XLATE_H
#define GMX_GMXPREPROCESS_XLATE_H
-#include "gromacs/gmxpreprocess/hackblock.h"
-#include "gromacs/utility/basedefinitions.h"
-
struct gmx_residuetype_t;
struct t_atoms;
+struct t_restp;
struct t_symtab;
/* If bResname is true renames atoms based on residue names,
* otherwise renames atoms based on rtp entry names.
*/
void rename_atoms(const char* xlfile, const char *ffdir,
- struct t_atoms *atoms, struct t_symtab *symtab, const t_restp *restp,
- bool bResname, struct gmx_residuetype_t *rt, bool bReorderNum,
+ t_atoms *atoms, t_symtab *symtab, const t_restp *restp,
+ bool bResname, gmx_residuetype_t *rt, bool bReorderNum,
bool bVerbose);
#endif