- Make the types forward-declarable, and use that in a few headers.
- Adapt files that were including the file directly.
- Move functions that operate on these structs from typedefs.[ch] to
topology/ as well, and make callers of those functions include
topology.h.
typedefs.h still brings this header with it. That will be cleaned up
separately in parts.
Change-Id: Iff50b854c335d10b97fd79c65d21791e5ae432a1
#include <math.h>
#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
#include "macros.h"
-#include "gromacs/utility/cstringutil.h"
#include "confio.h"
#include "gromacs/math/vec.h"
-#include "gromacs/topology/symtab.h"
#include "gromacs/utility/futil.h"
#include "xdrf.h"
#include "filenm.h"
#include "pdbio.h"
#include "tpxio.h"
#include "trxio.h"
-#include "gromacs/utility/fatalerror.h"
#include "copyrite.h"
#include "gromacs/pbcutil/pbc.h"
#include "mtop_util.h"
#include "gmxfio.h"
+#include "gromacs/topology/symtab.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
+
#define CHAR_SHIFT 24
static int read_g96_pos(char line[], t_symtab *symtab,
#include <stdio.h>
#include "../legacyheaders/types/simple.h"
-#include "../legacyheaders/types/topology.h"
#include "trx.h"
extern "C" {
#endif
+struct gmx_mtop_t;
struct t_atoms;
int read_g96_conf(FILE *fp, const char *infile, t_trxframe *fr, char *line);
* to an STO (.gro or .pdb) file */
void write_sto_conf_mtop(const char *outfile, const char *title,
- gmx_mtop_t *mtop,
+ struct gmx_mtop_t *mtop,
rvec x[], rvec *v, int ePBC, matrix box);
/* As write_sto_conf, but uses a gmx_mtop_t struct */
#include "../legacyheaders/types/energy.h"
#include "../legacyheaders/types/inputrec.h"
#include "../legacyheaders/types/state.h"
-#include "../legacyheaders/types/topology.h"
#include "gmxfio.h"
#include "xdr_datatype.h"
extern "C" {
#endif
+struct gmx_groups_t;
+
/**************************************************************
* These are the base datatypes + functions for reading and
* writing energy files (.edr). They are either called directly
/* Reads enx_frames, memory in fr is (re)allocated if necessary */
void get_enx_state(const char *fn, real t,
- gmx_groups_t *groups, t_inputrec *ir,
+ struct gmx_groups_t *groups, t_inputrec *ir,
t_state *state);
/*
* Reads state variables from enx file fn at time t.
#include <stdio.h>
-#include "../legacyheaders/types/topology.h"
#include "../legacyheaders/types/inputrec.h"
#include "../legacyheaders/types/oenv.h"
#include "../legacyheaders/network.h"
#include "filenm.h"
#include "enxio.h"
+struct gmx_mtop_t;
+
typedef struct gmx_mdoutf *gmx_mdoutf_t;
/*! \brief Allocate and initialize object to manager trajectory writing output
int mdrun_flags,
const t_commrec *cr,
const t_inputrec *ir,
- gmx_mtop_t *mtop,
+ struct gmx_mtop_t *mtop,
const output_env_t oenv);
/*! \brief Getter for file pointer */
#include <stdio.h>
#include "../legacyheaders/atomprop.h"
-#include "../legacyheaders/types/topology.h"
#ifdef __cplusplus
extern "C" {
#endif
struct t_atoms;
+struct t_topology;
typedef struct gmx_conect_t *gmx_conect;
* This function is fundamentally broken as far as thread-safety is concerned.
*/
-void write_pdbfile_indexed(FILE *out, const char *title, t_atoms *atoms,
+void write_pdbfile_indexed(FILE *out, const char *title, struct t_atoms *atoms,
rvec x[], int ePBC, matrix box, char chain,
int model_nr, atom_id nindex, const atom_id index[],
gmx_conect conect, gmx_bool bTerSepChains);
void gmx_conect_add(gmx_conect conect, int ai, int aj);
/* Add a connection between ai and aj (numbered from 0 to natom-1) */
-gmx_conect gmx_conect_generate(t_topology *top);
+gmx_conect gmx_conect_generate(struct t_topology *top);
/* Generate a conect structure from a topology */
gmx_conect gmx_conect_init(void);
#include "gromacs/math/vec.h"
#include "gromacs/topology/block.h"
#include "gromacs/topology/symtab.h"
+#include "gromacs/topology/topology.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
**************************************************************/
#include "../legacyheaders/types/inputrec.h"
#include "../legacyheaders/types/state.h"
-#include "../legacyheaders/types/topology.h"
#include "gmxfio.h"
#ifdef __cplusplus
extern "C" {
#endif
+struct gmx_mtop_t;
struct t_atoms;
struct t_block;
+struct t_topology;
typedef struct
{
*/
void write_tpx_state(const char *fn,
- t_inputrec *ir, t_state *state, gmx_mtop_t *mtop);
+ t_inputrec *ir, t_state *state, struct gmx_mtop_t *mtop);
/* Write a file, and close it again.
* If fn == NULL, an efTPA file will be written to stdout (which
* will not be closed afterwards)
void read_tpx_state(const char *fn,
t_inputrec *ir, t_state *state, rvec *f,
- gmx_mtop_t *mtop);
+ struct gmx_mtop_t *mtop);
int read_tpx(const char *fn,
t_inputrec *ir, matrix box, int *natoms,
- rvec *x, rvec *v, rvec *f, gmx_mtop_t *mtop);
+ rvec *x, rvec *v, rvec *f, struct gmx_mtop_t *mtop);
/* Read a file, and close it again.
* If fn == NULL, an efTPA file will be read from stdin (which
* will not be closed afterwards)
int read_tpx_top(const char *fn,
t_inputrec *ir, matrix box, int *natoms,
- rvec *x, rvec *v, rvec *f, t_topology *top);
+ rvec *x, rvec *v, rvec *f, struct t_topology *top);
/* As read_tpx, but for the old t_topology struct */
gmx_bool fn2bTPX(const char *file);
/* return if *file is one of the TPX file types */
-gmx_bool read_tps_conf(const char *infile, char *title, t_topology *top,
+gmx_bool read_tps_conf(const char *infile, char *title, struct t_topology *top,
int *ePBC, rvec **x, rvec **v, matrix box, gmx_bool bMass);
/* Read title, top.atoms, x, v (if not NULL) and box from an STX file,
* memory for atoms, x and v will be allocated.
#ifndef GMX_FILEIO_TRXIO_H
#define GMX_FILEIO_TRXIO_H
-#include "../legacyheaders/types/topology.h"
#include "../legacyheaders/readinp.h"
#include "../legacyheaders/oenv.h"
}
#endif
+struct gmx_mtop_t;
struct t_atoms;
/* a dedicated status type contains fp, etc. */
* atoms can be NULL for file types which don't need atom names.
*/
-void trjtools_gmx_prepare_tng_writing(const char *filename,
- char filemode,
- t_trxstatus *in,
- t_trxstatus **out,
- const char *infile,
- const int natoms,
- const gmx_mtop_t *mtop,
- const atom_id *index,
- const char *index_group_name);
+void trjtools_gmx_prepare_tng_writing(const char *filename,
+ char filemode,
+ t_trxstatus *in,
+ t_trxstatus **out,
+ const char *infile,
+ const int natoms,
+ const struct gmx_mtop_t *mtop,
+ const atom_id *index,
+ const char *index_group_name);
/* Sets up *out for writing TNG. If *in != NULL and contains a TNG trajectory
* some data, e.g. molecule system, will be copied over from *in to *out.
* If *in == NULL a file name (infile) of a TNG file can be provided instead
#include "copyrite.h"
#include "macros.h"
-#include "gromacs/utility/smalloc.h"
#include "typedefs.h"
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/fileio/trnio.h"
#include "gromacs/fileio/tngio_for_tools.h"
-#include "gromacs/commandline/pargs.h"
#include "gromacs/utility/futil.h"
#include "gromacs/fileio/pdbio.h"
#include "gromacs/fileio/confio.h"
#include "index.h"
#include "gromacs/math/vec.h"
#include "gromacs/fileio/xtcio.h"
-#include "gromacs/pbcutil/rmpbc.h"
-#include "gromacs/pbcutil/pbc.h"
#include "viewit.h"
-#include "gromacs/fileio/xvgr.h"
#include "gmx_ana.h"
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/fileio/xvgr.h"
#include "gromacs/math/do_fit.h"
+#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/topology/topology.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/smalloc.h"
#ifdef HAVE_UNISTD_H
#include <unistd.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 "nsfactor.h"
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
-#include "gromacs/math/vec.h"
-#include "nsfactor.h"
-
-#include "gromacs/utility/futil.h"
#include "gromacs/fileio/strdb.h"
+#include "gromacs/math/vec.h"
#include "gromacs/random/random.h"
+#include "gromacs/topology/topology.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
#include "gromacs/utility/gmxomp.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/legacyheaders/index.h"
#include "gromacs/legacyheaders/oenv.h"
#include "gromacs/legacyheaders/types/simple.h"
-#include "gromacs/legacyheaders/types/topology.h"
#ifdef __cplusplus
extern "C" {
#endif
+struct t_topology;
+
typedef struct gmx_neutron_atomic_structurefactors_t {
int nratoms;
int *p; /* proton number */
} gmx_neutron_atomic_structurefactors_t;
typedef struct gmx_sans_t {
- t_topology *top; /* topology */
- double *slength; /* scattering length for this topology */
+ struct t_topology *top; /* topology */
+ double *slength; /* scattering length for this topology */
} gmx_sans_t;
typedef struct gmx_radial_distribution_histogram_t {
gmx_neutron_atomic_structurefactors_t *gmx_neutronstructurefactors_init(const char *datfn);
-gmx_sans_t *gmx_sans_init(t_topology *top, gmx_neutron_atomic_structurefactors_t *gnsf);
+gmx_sans_t *gmx_sans_init(struct t_topology *top, gmx_neutron_atomic_structurefactors_t *gnsf);
gmx_radial_distribution_histogram_t *calc_radial_distribution_histogram (gmx_sans_t *gsans,
rvec *x,
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/random/random.h"
-#include "gromacs/topology/atoms.h"
-#include "gromacs/topology/block.h"
-#include "gromacs/topology/symtab.h"
#include "gromacs/utility/smalloc.h"
/* The source code in this file should be thread-safe.
return buf;
}
-void init_groups(gmx_groups_t *groups)
-{
- int g;
-
- groups->ngrpname = 0;
- groups->grpname = NULL;
- for (g = 0; (g < egcNR); g++)
- {
- groups->grps[g].nm_ind = NULL;
- groups->ngrpnr[g] = 0;
- groups->grpnr[g] = NULL;
- }
-
-}
-
-void init_mtop(gmx_mtop_t *mtop)
-{
- mtop->name = NULL;
- mtop->nmoltype = 0;
- mtop->moltype = NULL;
- mtop->nmolblock = 0;
- mtop->molblock = NULL;
- mtop->maxres_renum = 0;
- mtop->maxresnr = -1;
- init_groups(&mtop->groups);
- init_block(&mtop->mols);
- open_symtab(&mtop->symtab);
-}
-
-void init_top(t_topology *top)
-{
- int i;
-
- top->name = NULL;
- init_atom (&(top->atoms));
- init_atomtypes(&(top->atomtypes));
- init_block(&top->cgs);
- init_block(&top->mols);
- init_blocka(&top->excls);
- open_symtab(&top->symtab);
-}
-
void init_inputrec(t_inputrec *ir)
{
memset(ir, 0, (size_t)sizeof(*ir));
snew(ir->simtempvals, 1);
}
-void done_moltype(gmx_moltype_t *molt)
-{
- int f;
-
- done_atom(&molt->atoms);
- done_block(&molt->cgs);
- done_blocka(&molt->excls);
-
- for (f = 0; f < F_NRE; f++)
- {
- sfree(molt->ilist[f].iatoms);
- molt->ilist[f].nalloc = 0;
- }
-}
-
-void done_molblock(gmx_molblock_t *molb)
-{
- if (molb->nposres_xA > 0)
- {
- molb->nposres_xA = 0;
- sfree(molb->posres_xA);
- }
- if (molb->nposres_xB > 0)
- {
- molb->nposres_xB = 0;
- sfree(molb->posres_xB);
- }
-}
-
-void done_mtop(gmx_mtop_t *mtop, gmx_bool bDoneSymtab)
-{
- int i;
-
- if (bDoneSymtab)
- {
- done_symtab(&mtop->symtab);
- }
-
- sfree(mtop->ffparams.functype);
- sfree(mtop->ffparams.iparams);
-
- for (i = 0; i < mtop->nmoltype; i++)
- {
- done_moltype(&mtop->moltype[i]);
- }
- sfree(mtop->moltype);
- for (i = 0; i < mtop->nmolblock; i++)
- {
- done_molblock(&mtop->molblock[i]);
- }
- sfree(mtop->molblock);
- done_block(&mtop->mols);
-}
-
-void done_top(t_topology *top)
-{
- int f;
-
- sfree(top->idef.functype);
- sfree(top->idef.iparams);
- for (f = 0; f < F_NRE; ++f)
- {
- sfree(top->idef.il[f].iatoms);
- top->idef.il[f].iatoms = NULL;
- top->idef.il[f].nalloc = 0;
- }
-
- done_atom (&(top->atoms));
-
- /* For GB */
- done_atomtypes(&(top->atomtypes));
-
- done_symtab(&(top->symtab));
- done_block(&(top->cgs));
- done_block(&(top->mols));
- done_blocka(&(top->excls));
-}
-
static void done_pull_group(t_pull_group *pgrp)
{
if (pgrp->nat > 0)
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/block.h"
+#include "gromacs/topology/topology.h"
#include "gromacs/utility/smalloc.h"
static real box_margin;
#include "readir.h"
#include "names.h"
#include "grompp-impl.h"
-#include "gromacs/random/random.h"
#include "gromacs/gmxpreprocess/gen_maxwell_velocities.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/futil.h"
-#include "gromacs/commandline/pargs.h"
#include "splitter.h"
#include "gromacs/gmxpreprocess/sortwater.h"
#include "convparm.h"
-#include "gromacs/utility/fatalerror.h"
#include "warninp.h"
#include "index.h"
#include "gromacs/fileio/gmxfio.h"
#include "tomorse.h"
#include "gromacs/imd/imd.h"
+#include "gromacs/commandline/pargs.h"
#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/random/random.h"
#include "gromacs/topology/symtab.h"
+#include "gromacs/topology/topology.h"
+#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
static int rm_interactions(int ifunc, int nrmols, t_molinfo mols[])
#include "gromacs/utility/cstringutil.h"
#include "gromacs/topology/block.h"
#include "gromacs/topology/symtab.h"
+#include "gromacs/topology/topology.h"
#include "gromacs/utility/fatalerror.h"
#include "warninp.h"
#include "vsite_parm.h"
#include "types/simple.h"
#include "types/enums.h"
#include "../fileio/trx.h"
-#include "types/topology.h"
+#include "../topology/topology.h"
#include "types/energy.h"
#include "types/inputrec.h"
#include "types/nrnb.h"
/* Functions to initiate and delete structures *
* These functions are defined in gmxlib/typedefs.c
*/
-void init_mtop(gmx_mtop_t *mtop);
-void init_top(t_topology *top);
void init_inputrec(t_inputrec *ir);
void init_energyhistory(energyhistory_t * enerhist);
void done_energyhistory(energyhistory_t * enerhist);
void init_df_history(df_history_t *dfhist, int nlambda);
void done_df_history(df_history_t *dfhist);
void copy_df_history(df_history_t * df_dest, df_history_t *df_source);
-void done_moltype(gmx_moltype_t *molt);
-void done_molblock(gmx_molblock_t *molb);
-void done_mtop(gmx_mtop_t *mtop, gmx_bool bDoneSymtab);
-void done_top(t_topology *top);
void done_inputrec(t_inputrec *ir);
void done_state(t_state *state);
void preserve_box_shape(t_inputrec *ir, matrix box_rel, matrix b);
/* Preserve the box shape, b can be box or boxv */
-t_atoms *mtop2atoms(gmx_mtop_t *mtop);
-/* generate a t_atoms struct for the system from gmx_mtop_t */
-
real max_cutoff(real cutoff1, real cutoff2);
/* Returns the maximum of the cut-off's, taking into account that 0=inf. */
#include <config.h>
#endif
-#include "typedefs.h"
+#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/mshift.h"
#include "gromacs/pbcutil/pbc.h"
-
-#include "gromacs/math/vec.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/topology/idef.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include <cstring>
-#include "gromacs/legacyheaders/typedefs.h"
-
#include "gromacs/math/vec.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
+#include "gromacs/topology/atoms.h"
+#include "gromacs/topology/topology.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/smalloc.h"
atoms.h
block.h
idef.h
- symtab.h)
+ symtab.h
+ topology.h)
gmx_install_headers(topology ${TOPOLOGY_PUBLIC_HEADERS})
--- /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 "gromacs/topology/topology.h"
+
+#include "gromacs/topology/symtab.h"
+#include "gromacs/utility/smalloc.h"
+
+static void init_groups(gmx_groups_t *groups)
+{
+ groups->ngrpname = 0;
+ groups->grpname = NULL;
+ for (int g = 0; g < egcNR; g++)
+ {
+ groups->grps[g].nm_ind = NULL;
+ groups->ngrpnr[g] = 0;
+ groups->grpnr[g] = NULL;
+ }
+
+}
+
+void init_mtop(gmx_mtop_t *mtop)
+{
+ mtop->name = NULL;
+ mtop->nmoltype = 0;
+ mtop->moltype = NULL;
+ mtop->nmolblock = 0;
+ mtop->molblock = NULL;
+ mtop->maxres_renum = 0;
+ mtop->maxresnr = -1;
+ init_groups(&mtop->groups);
+ init_block(&mtop->mols);
+ open_symtab(&mtop->symtab);
+}
+
+void init_top(t_topology *top)
+{
+ top->name = NULL;
+ init_atom(&(top->atoms));
+ init_atomtypes(&(top->atomtypes));
+ init_block(&top->cgs);
+ init_block(&top->mols);
+ init_blocka(&top->excls);
+ open_symtab(&top->symtab);
+}
+
+
+void done_moltype(gmx_moltype_t *molt)
+{
+ done_atom(&molt->atoms);
+ done_block(&molt->cgs);
+ done_blocka(&molt->excls);
+
+ for (int f = 0; f < F_NRE; f++)
+ {
+ sfree(molt->ilist[f].iatoms);
+ molt->ilist[f].nalloc = 0;
+ }
+}
+
+void done_molblock(gmx_molblock_t *molb)
+{
+ if (molb->nposres_xA > 0)
+ {
+ molb->nposres_xA = 0;
+ sfree(molb->posres_xA);
+ }
+ if (molb->nposres_xB > 0)
+ {
+ molb->nposres_xB = 0;
+ sfree(molb->posres_xB);
+ }
+}
+
+void done_mtop(gmx_mtop_t *mtop, gmx_bool bDoneSymtab)
+{
+ if (bDoneSymtab)
+ {
+ done_symtab(&mtop->symtab);
+ }
+
+ sfree(mtop->ffparams.functype);
+ sfree(mtop->ffparams.iparams);
+
+ for (int i = 0; i < mtop->nmoltype; i++)
+ {
+ done_moltype(&mtop->moltype[i]);
+ }
+ sfree(mtop->moltype);
+ for (int i = 0; i < mtop->nmolblock; i++)
+ {
+ done_molblock(&mtop->molblock[i]);
+ }
+ sfree(mtop->molblock);
+ done_block(&mtop->mols);
+}
+
+void done_top(t_topology *top)
+{
+ sfree(top->idef.functype);
+ sfree(top->idef.iparams);
+ for (int f = 0; f < F_NRE; ++f)
+ {
+ sfree(top->idef.il[f].iatoms);
+ top->idef.il[f].iatoms = NULL;
+ top->idef.il[f].nalloc = 0;
+ }
+
+ done_atom(&(top->atoms));
+
+ /* For GB */
+ done_atomtypes(&(top->atomtypes));
+
+ done_symtab(&(top->symtab));
+ done_block(&(top->cgs));
+ done_block(&(top->mols));
+ done_blocka(&(top->excls));
+}
* 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_LEGACYHEADERS_TOPOLOGY_H
-#define GMX_LEGACYHEADERS_TOPOLOGY_H
+#ifndef GMX_TOPOLOGY_TOPOLOGY_H
+#define GMX_TOPOLOGY_TOPOLOGY_H
-#include "simple.h"
-#include "../../topology/idef.h"
-#include "../../topology/atoms.h"
-#include "../../topology/block.h"
-#include "../../topology/symtab.h"
+#include "../math/vectypes.h"
+#include "atoms.h"
+#include "block.h"
+#include "idef.h"
+#include "symtab.h"
#ifdef __cplusplus
extern "C" {
egcNR
};
-typedef struct {
+typedef struct gmx_moltype_t
+{
char **name; /* Name of the molecule type */
t_atoms atoms; /* The atoms */
t_ilist ilist[F_NRE];
t_blocka excls; /* The exclusions */
} gmx_moltype_t;
-typedef struct {
+typedef struct gmx_molblock_t
+{
int type; /* The molcule type index in mtop.moltype */
int nmol; /* The number of molecules in this block */
int natoms_mol; /* The number of atoms in one molecule */
rvec *posres_xB; /* The posres coords for top B */
} gmx_molblock_t;
-typedef struct {
+typedef struct gmx_groups_t
+{
t_grps grps[egcNR]; /* Groups of things */
int ngrpname; /* Number of groupnames */
char ***grpname; /* Names of the groups */
/* The global, complete system topology struct, based on molecule types.
This structure should contain no data that is O(natoms) in memory. */
-typedef struct {
+typedef struct gmx_mtop_t
+{
char **name; /* Name of the topology */
gmx_ffparams_t ffparams;
int nmoltype;
} gmx_mtop_t;
/* The mdrun node-local topology struct, completely written out */
-typedef struct {
- t_idef idef; /* The interaction function definition */
+typedef struct gmx_localtop_t
+{
+ t_idef idef; /* The interaction function definition */
t_atomtypes atomtypes; /* Atomtype properties */
t_block cgs; /* The charge groups */
t_blocka excls; /* The exclusions */
} gmx_localtop_t;
/* The old topology struct, completely written out, used in analysis tools */
-typedef struct {
+typedef struct t_topology
+{
char **name; /* Name of the topology */
- t_idef idef; /* The interaction function definition */
+ t_idef idef; /* The interaction function definition */
t_atoms atoms; /* The atoms */
t_atomtypes atomtypes; /* Atomtype properties */
t_block cgs; /* The charge groups */
t_symtab symtab; /* The symbol table */
} t_topology;
+void init_mtop(gmx_mtop_t *mtop);
+void init_top(t_topology *top);
+void done_moltype(gmx_moltype_t *molt);
+void done_molblock(gmx_molblock_t *molb);
+void done_mtop(gmx_mtop_t *mtop, gmx_bool bDoneSymtab);
+void done_top(t_topology *top);
+
+t_atoms *mtop2atoms(gmx_mtop_t *mtop);
+/* generate a t_atoms struct for the system from gmx_mtop_t */
+
#ifdef __cplusplus
}
#endif
#include "gromacs/fileio/trxio.h"
#include "gromacs/math/vec.h"
+#include "gromacs/topology/topology.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/smalloc.h"