- Remove some unnecessary includes.
- Convert the source file to C++ and fix some issues.
- Some header cleanup in touched files.
This introduces a fileio<->topology cyclic dependency, but that needs to
wait for later resolution.
Change-Id: I88e70cd9024d86c56c4d4435fa91c42af9af7c29
#include "typedefs.h"
#include "gbutil.h"
#include "gromacs/math/units.h"
-#include "atomprop.h"
void copy_atom(t_symtab *tab,t_atoms *a1,int i1,t_atoms *a2,int i2,
rvec xin[],rvec xout[],rvec vin[],rvec vout[])
#include "gromacs/fileio/trnio.h"
#include "gromacs/topology/symtab.h"
#include "gromacs/fileio/strdb.h"
-#include "atomprop.h"
#include "gromacs/fileio/confio.h"
#define TET 109.47
#include <stdlib.h>
#include <string.h>
-#include "gromacs/legacyheaders/atomprop.h"
#include "gromacs/legacyheaders/copyrite.h"
+#include "gromacs/legacyheaders/index.h"
#include "gromacs/legacyheaders/types/ifunc.h"
#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/utility/futil.h"
#include "gromacs/math/units.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/atomprop.h"
#include "gromacs/topology/symtab.h"
#include "gromacs/topology/topology.h"
#include "gromacs/utility/cstringutil.h"
#include <stdio.h>
-#include "../legacyheaders/atomprop.h"
+#include "../legacyheaders/types/simple.h"
#ifdef __cplusplus
extern "C" {
#endif
+struct gmx_atomprop;
struct t_atoms;
struct t_topology;
* which may be useful for visualization purposes.
*/
-void get_pdb_atomnumber(struct t_atoms *atoms, gmx_atomprop_t aps);
+void get_pdb_atomnumber(struct t_atoms *atoms, struct gmx_atomprop *aps);
/* Routine to extract atomic numbers from the atom names */
int read_pdbfile(FILE *in, char *title, int *model_nr,
#include "tpxio.h"
#include "txtdump.h"
#include "confio.h"
-#include "atomprop.h"
#include "copyrite.h"
-#include "gromacs/topology/mtop_util.h"
#include "gromacs/math/vec.h"
+#include "gromacs/topology/atomprop.h"
#include "gromacs/topology/block.h"
+#include "gromacs/topology/mtop_util.h"
#include "gromacs/topology/symtab.h"
#include "gromacs/topology/topology.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/pbcutil/pbc.h"
+#include "index.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/fileio/pdbio.h"
#include "gromacs/fileio/confio.h"
-#include "gromacs/utility/smalloc.h"
#include "macros.h"
-#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/strdb.h"
#include "index.h"
-#include "gromacs/math/vec.h"
#include "typedefs.h"
#include "gromacs/gmxlib/conformation-utilities.h"
#include "gromacs/math/units.h"
-#include "atomprop.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/pbcutil/pbc.h"
#include "princ.h"
#include "txtdump.h"
#include "viewit.h"
-#include "gromacs/pbcutil/rmpbc.h"
#include "gmx_ana.h"
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/atomprop.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
typedef struct
{
#include "gromacs/math/utilities.h"
#include "gromacs/fileio/confio.h"
#include "macros.h"
-#include "atomprop.h"
#include "names.h"
#include "gromacs/math/vec.h"
#include "gromacs/gmxlib/conformation-utilities.h"
#include "gromacs/pbcutil/ishift.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/random/random.h"
+#include "gromacs/topology/atomprop.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/gmxlib/conformation-utilities.h"
#include "genhydro.h"
#include "readinp.h"
-#include "atomprop.h"
#include "index.h"
#include "fflibutil.h"
#include "macros.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/strdb.h"
+#include "gromacs/topology/atomprop.h"
#include "gromacs/topology/block.h"
#include "gromacs/topology/symtab.h"
#include "gromacs/utility/smalloc.h"
#include "read-conformation.h"
#include "gromacs/fileio/confio.h"
-#include "gromacs/legacyheaders/atomprop.h"
#include "gromacs/legacyheaders/types/simple.h"
#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/topology/atomprop.h"
#include "gromacs/topology/atoms.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/smalloc.h"
#define GMX_GMXPREPROCESS_READ_CONFORMATION_H
#include "types/simple.h"
-#include "atomprop.h"
#ifdef __cplusplus
extern "C" {
#endif
+struct gmx_atomprop;
struct t_atoms;
/*! \brief Allocate and fill an array of inter-atomic half distances
* default value. Used directly and indirectly by solvate and
* insert-molecules for deciding whether molecules clash. The return
* pointer should be freed by the caller. */
-real *makeExclusionDistances(const struct t_atoms *a, gmx_atomprop_t aps,
+real *makeExclusionDistances(const struct t_atoms *a, struct gmx_atomprop *aps,
real defaultDistance, real scaleFactor);
/*! \brief Read a conformation from a file, allocate and fill data structures.
#include <string.h>
#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/utility/cstringutil.h"
#include "gromacs/fileio/confio.h"
#include "macros.h"
#include "gromacs/utility/futil.h"
-#include "atomprop.h"
#include "names.h"
-#include "gromacs/math/vec.h"
-#include "gromacs/utility/fatalerror.h"
-#include "gromacs/commandline/pargs.h"
#include "gromacs/gmxlib/conformation-utilities.h"
#include "addconf.h"
#include "read-conformation.h"
#include "gromacs/fileio/pdbio.h"
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/topology/atomprop.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
+
#ifdef DEBUG
static void print_stat(rvec *x, int natoms, matrix box)
{
#include "pdb2top.h"
#include "gen_ad.h"
#include "gpp_nextnb.h"
-#include "atomprop.h"
#include "hackblock.h"
#include "nm2type.h"
#include <string.h>
#include "macros.h"
-#include "gromacs/commandline/pargs.h"
#include "txtdump.h"
-#include "gromacs/utility/fatalerror.h"
-#include "atomprop.h"
#include "gromacs/math/vec.h"
-#include "gromacs/pbcutil/pbc.h"
#include "gromacs/math/units.h"
#include "index.h"
-#include "gromacs/utility/smalloc.h"
#include "names.h"
-#include "gromacs/topology/mtop_util.h"
#include "gromacs/utility/futil.h"
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/trnio.h"
#include "gromacs/fileio/enxio.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
+
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/atomprop.h"
#include "gromacs/topology/block.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
#include "compare.h"
set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${TOPOLOGY_SOURCES} PARENT_SCOPE)
set(TOPOLOGY_PUBLIC_HEADERS
+ atomprop.h
atoms.h
block.h
idef.h
* 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 "gromacs/topology/atomprop.h"
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include "gromacs/fileio/strdb.h"
-#include "gromacs/legacyheaders/atomprop.h"
#include "gromacs/legacyheaders/copyrite.h"
#include "gromacs/legacyheaders/index.h"
-#include "gromacs/legacyheaders/macros.h"
-#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/math/utilities.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
while (get_a_line(fp, line, STRLEN))
{
line_no++;
- if (sscanf(line, "%s %s %lf", resnm, atomnm, &pp) == 3)
+ if (sscanf(line, "%31s %31s %20lf", resnm, atomnm, &pp) == 3)
{
pp *= factor;
add_prop(ap, aps->restype, resnm, atomnm, pp, line_no);
gmx_atomprop_t gmx_atomprop_init(void)
{
gmx_atomprop *aps;
- int p;
snew(aps, 1);
real *value)
{
gmx_atomprop *ap = (gmx_atomprop*) aps;
- size_t i;
int j;
#define MAXQ 32
char atomname[MAXQ], resname[MAXQ];
}
if (isdigit(atomnm[0]))
{
+ int i;
/* put digit after atomname */
- for (i = 1; (i < min(MAXQ-1, strlen(atomnm))); i++)
+ for (i = 1; i < MAXQ-1 && atomnm[i] != '\0'; i++)
{
atomname[i-1] = atomnm[i];
}
return gmx_nint(ap->prop[epropElement].value[i]);
}
}
- return NOTSET;
+ return -1;
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
* 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_TOPOLOGY_ATOMPROP_H
+#define GMX_TOPOLOGY_ATOMPROP_H
-#ifndef _atomprop_h
-#define _atomprop_h
+#include "../utility/basedefinitions.h"
+#include "../utility/real.h"
#ifdef __cplusplus
extern "C" {
#endif
-#include "index.h"
-
/* Abstract type for the atom property database */
typedef struct gmx_atomprop *gmx_atomprop_t;
}
#endif
-
#endif
#include <string>
-#include "gromacs/legacyheaders/atomprop.h"
#include "gromacs/legacyheaders/copyrite.h"
#include "gromacs/analysisdata/analysisdata.h"
#include "gromacs/selection/nbsearch.h"
#include "gromacs/selection/selection.h"
#include "gromacs/selection/selectionoption.h"
+#include "gromacs/topology/atomprop.h"
#include "gromacs/topology/topology.h"
#include "gromacs/trajectoryanalysis/analysissettings.h"
#include "gromacs/utility/arrayref.h"
#include <string>
#include <vector>
-#include "gromacs/legacyheaders/atomprop.h"
#include "gromacs/legacyheaders/copyrite.h"
#include "gromacs/analysisdata/analysisdata.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/selection/selection.h"
#include "gromacs/selection/selectionoption.h"
+#include "gromacs/topology/atomprop.h"
#include "gromacs/topology/symtab.h"
#include "gromacs/topology/topology.h"
#include "gromacs/trajectoryanalysis/analysismodule.h"
#include "typedefs.h"
#include "macros.h"
-#include "atomprop.h"
#include "names.h"
-#include "gromacs/pbcutil/pbc.h"
#include "copyrite.h"
+#include "gromacs/fileio/tpxio.h"
#include "gromacs/math/utilities.h"
#include "gromacs/math/vec.h"
-#include "gromacs/fileio/tpxio.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/atomprop.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"