#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/txtdump.h"
-static void list_tpx(const char *fn, gmx_bool bShowNumbers, const char *mdpfn,
- gmx_bool bSysTop)
+static void list_tpx(const char *fn,
+ gmx_bool bShowNumbers,
+ gmx_bool bShowParameters,
+ const char *mdpfn,
+ gmx_bool bSysTop)
{
FILE *gp;
int indent, i, j, **gcount, atot;
if (!bSysTop)
{
- pr_mtop(stdout, indent, "topology", &(mtop), bShowNumbers);
+ pr_mtop(stdout, indent, "topology", &(mtop), bShowNumbers, bShowParameters);
}
else
{
- pr_top(stdout, indent, "topology", &(top), bShowNumbers);
+ pr_top(stdout, indent, "topology", &(top), bShowNumbers, bShowParameters);
}
pr_rvecs(stdout, indent, "box", tpx.bBox ? state.box : NULL, DIM);
gmx_output_env_t *oenv;
/* Command line options */
static gmx_bool bShowNumbers = TRUE;
+ static gmx_bool bShowParams = FALSE;
static gmx_bool bSysTop = FALSE;
t_pargs pa[] = {
{ "-nr", FALSE, etBOOL, {&bShowNumbers}, "Show index numbers in output (leaving them out makes comparison easier, but creates a useless topology)" },
+ { "-param", FALSE, etBOOL, {&bShowParams}, "Show parameters for each bonded interaction (for comparing dumps, it is useful to combine this with -nonr)" },
{ "-sys", FALSE, etBOOL, {&bSysTop}, "List the atoms and bonded interactions for the whole system instead of for each molecule type" }
};
if (ftp2bSet(efTPR, NFILE, fnm))
{
- list_tpx(ftp2fn(efTPR, NFILE, fnm), bShowNumbers,
+ list_tpx(ftp2fn(efTPR, NFILE, fnm), bShowNumbers, bShowParams,
ftp2fn_null(efMDP, NFILE, fnm), bSysTop);
}
else if (ftp2bSet(efTRX, NFILE, fnm))
*
* 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,2016, 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 pr_ilist(FILE *fp, int indent, const char *title,
- const t_functype *functype, const t_ilist *ilist, gmx_bool bShowNumbers)
+ const t_functype *functype, const t_ilist *ilist,
+ gmx_bool bShowNumbers,
+ gmx_bool bShowParameters, const t_iparams *iparams)
{
int i, j, k, type, ftype;
t_iatom *iatoms;
iatoms = ilist->iatoms;
for (i = j = 0; i < ilist->nr; )
{
-#ifndef DEBUG
pr_indent(fp, indent+INDENT);
type = *(iatoms++);
ftype = functype[type];
- fprintf(fp, "%d type=%d (%s)",
- bShowNumbers ? j : -1, bShowNumbers ? type : -1,
- interaction_function[ftype].name);
+ if (bShowNumbers)
+ {
+ fprintf(fp, "%d type=%d ", j, type);
+ }
j++;
+ printf("(%s)", interaction_function[ftype].name);
for (k = 0; k < interaction_function[ftype].nratoms; k++)
{
- fprintf(fp, " %d", *(iatoms++));
+ fprintf(fp, " %3d", *(iatoms++));
+ }
+ if (bShowParameters)
+ {
+ fprintf(fp, " ");
+ pr_iparams(fp, ftype, &iparams[type]);
}
fprintf(fp, "\n");
i += 1+interaction_function[ftype].nratoms;
-#else
- fprintf(fp, "%5d%5d\n", i, iatoms[i]);
- i++;
-#endif
}
}
}
pr_cmap(fp, indent, "cmap", &ffparams->cmap_grid, bShowNumbers);
}
-void pr_idef(FILE *fp, int indent, const char *title, const t_idef *idef, gmx_bool bShowNumbers)
+void pr_idef(FILE *fp, int indent, const char *title, const t_idef *idef,
+ gmx_bool bShowNumbers, gmx_bool bShowParameters)
{
int i, j;
for (j = 0; (j < F_NRE); j++)
{
pr_ilist(fp, indent, interaction_function[j].longname,
- idef->functype, &idef->il[j], bShowNumbers);
+ idef->functype, &idef->il[j], bShowNumbers,
+ bShowParameters, idef->iparams);
}
}
}
*
* 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,2016, 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 pr_iparams(FILE *fp, t_functype ftype, const t_iparams *iparams);
void pr_ilist(FILE *fp, int indent, const char *title,
- const t_functype *functype, const t_ilist *ilist, gmx_bool bShowNumbers);
+ const t_functype *functype, const t_ilist *ilist,
+ gmx_bool bShowNumbers,
+ gmx_bool bShowParameters, const t_iparams *iparams);
void pr_ffparams(FILE *fp, int indent, const char *title,
const gmx_ffparams_t *ffparams, gmx_bool bShowNumbers);
-void pr_idef(FILE *fp, int indent, const char *title, const t_idef *idef, gmx_bool bShowNumbers);
+void pr_idef(FILE *fp, int indent, const char *title, const t_idef *idef,
+ gmx_bool bShowNumbers, gmx_bool bShowParameters);
#ifdef __cplusplus
}
static void pr_moltype(FILE *fp, int indent, const char *title,
const gmx_moltype_t *molt, int n,
const gmx_ffparams_t *ffparams,
- gmx_bool bShowNumbers)
+ gmx_bool bShowNumbers, gmx_bool bShowParameters)
{
int j;
for (j = 0; (j < F_NRE); j++)
{
pr_ilist(fp, indent, interaction_function[j].longname,
- ffparams->functype, &molt->ilist[j], bShowNumbers);
+ ffparams->functype, &molt->ilist[j],
+ bShowNumbers, bShowParameters, ffparams->iparams);
}
}
}
void pr_mtop(FILE *fp, int indent, const char *title, const gmx_mtop_t *mtop,
- gmx_bool bShowNumbers)
+ gmx_bool bShowNumbers, gmx_bool bShowParameters)
{
int mt, mb, j;
{
pr_ilist(fp, indent, interaction_function[j].longname,
mtop->ffparams.functype,
- &mtop->intermolecular_ilist[j], bShowNumbers);
+ &mtop->intermolecular_ilist[j],
+ bShowNumbers, bShowParameters, mtop->ffparams.iparams);
}
}
pr_ffparams(fp, indent, "ffparams", &(mtop->ffparams), bShowNumbers);
for (mt = 0; mt < mtop->nmoltype; mt++)
{
pr_moltype(fp, indent, "moltype", &mtop->moltype[mt], mt,
- &mtop->ffparams, bShowNumbers);
+ &mtop->ffparams, bShowNumbers, bShowParameters);
}
pr_groups(fp, indent, &mtop->groups, bShowNumbers);
}
}
-void pr_top(FILE *fp, int indent, const char *title, const t_topology *top, gmx_bool bShowNumbers)
+void pr_top(FILE *fp, int indent, const char *title, const t_topology *top,
+ gmx_bool bShowNumbers, gmx_bool bShowParameters)
{
if (available(fp, top, indent, title))
{
pr_str(fp, indent, "bIntermolecularInteractions",
gmx::boolToString(top->bIntermolecularInteractions));
pr_blocka(fp, indent, "excls", &top->excls, bShowNumbers);
- pr_idef(fp, indent, "idef", &top->idef, bShowNumbers);
+ pr_idef(fp, indent, "idef", &top->idef, bShowNumbers, bShowParameters);
}
}
bool gmx_mtop_has_pdbinfo(const gmx_mtop_t *mtop);
void pr_mtop(FILE *fp, int indent, const char *title, const gmx_mtop_t *mtop,
- gmx_bool bShowNumbers);
-void pr_top(FILE *fp, int indent, const char *title, const t_topology *top, gmx_bool bShowNumbers);
+ gmx_bool bShowNumbers, gmx_bool bShowParameters);
+void pr_top(FILE *fp, int indent, const char *title, const t_topology *top,
+ gmx_bool bShowNumbers, gmx_bool bShowParameters);
void cmp_top(FILE *fp, const t_topology *t1, const t_topology *t2, real ftol, real abstol);
void cmp_groups(FILE *fp, const gmx_groups_t *g0, const gmx_groups_t *g1,