#include "gromacs/ewald/pme.h"
#include "gromacs/fft/parallel_3dfft.h"
#include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/network.h"
#include "gromacs/gmxlib/nrnb.h"
#include "gromacs/math/gmxcomplex.h"
#include "tpxio.h"
+#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "gromacs/fileio/filetypes.h"
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/gmxfio-xdr.h"
+#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/ifunc.h"
#include "gromacs/math/vec.h"
#include "gromacs/mdtypes/inputrec.h"
{
return (efTPR == fn2ftp(file));
}
+
+void pr_tpxheader(FILE *fp, int indent, const char *title, const t_tpxheader *sh)
+{
+ if (available(fp, sh, indent, title))
+ {
+ indent = pr_title(fp, indent, title);
+ pr_indent(fp, indent);
+ fprintf(fp, "bIr = %spresent\n", sh->bIr ? "" : "not ");
+ pr_indent(fp, indent);
+ fprintf(fp, "bBox = %spresent\n", sh->bBox ? "" : "not ");
+ pr_indent(fp, indent);
+ fprintf(fp, "bTop = %spresent\n", sh->bTop ? "" : "not ");
+ pr_indent(fp, indent);
+ fprintf(fp, "bX = %spresent\n", sh->bX ? "" : "not ");
+ pr_indent(fp, indent);
+ fprintf(fp, "bV = %spresent\n", sh->bV ? "" : "not ");
+ pr_indent(fp, indent);
+ fprintf(fp, "bF = %spresent\n", sh->bF ? "" : "not ");
+
+ pr_indent(fp, indent);
+ fprintf(fp, "natoms = %d\n", sh->natoms);
+ pr_indent(fp, indent);
+ fprintf(fp, "lambda = %e\n", sh->lambda);
+ }
+}
* 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_FILEIO_TPXIO_H
#define GMX_FILEIO_TPXIO_H
+#include <cstdio>
-/**************************************************************
- *
- * The routines in the corresponding c-file tpxio.c
- * are based on the lower level routines in gmxfio.c
- *
- **************************************************************/
#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/mdtypes/state.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
-
struct gmx_mtop_t;
struct t_atoms;
struct t_block;
gmx_bool fn2bTPX(const char *file);
/* return if *file is one of the TPX file types */
-#ifdef __cplusplus
-}
-#endif
+void pr_tpxheader(FILE *fp, int indent, const char *title, const t_tpxheader *sh);
#endif
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/gmxfio-xdr.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include <cstdio>
#include <cstdlib>
-#include <algorithm>
-
-#include "gromacs/fileio/tpxio.h"
-#include "gromacs/gmxlib/ifunc.h"
#include "gromacs/math/vec.h"
-#include "gromacs/mdtypes/commrec.h"
+#include "gromacs/mdtypes/inputrec.h"
#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/mdtypes/pull-params.h"
#include "gromacs/pbcutil/pbc.h"
-#include "gromacs/topology/topology.h"
#include "gromacs/utility/cstringutil.h"
-#include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/snprintf.h"
#include "gromacs/utility/stringutil.h"
}
-/*
- void pr_mat(FILE *fp,int indent,char *title,matrix m)
- {
- int i,j;
-
- if (available(fp,m,indent,title)) {
- indent=pr_title_n(fp,indent,title,n);
- for(i=0; i<n; i++) {
- pr_indent(fp,indent);
- fprintf(fp,"%s[%d]=%12.5e %12.5e %12.5e\n",
- title,bShowNumbers?i:-1,m[i][XX],m[i][YY],m[i][ZZ]);
- }
- }
- }
- */
-
void pr_rvecs_len(FILE *fp, int indent, const char *title, const rvec vec[], int n)
{
int i, j;
}
}
-static void pr_int(FILE *fp, int indent, const char *title, int i)
+void pr_int(FILE *fp, int indent, const char *title, int i)
{
pr_indent(fp, indent);
fprintf(fp, "%-30s = %d\n", title, i);
fprintf(fp, "%-30s = %s\n", title, gmx_step_str(i, buf));
}
-static void pr_real(FILE *fp, int indent, const char *title, real r)
+void pr_real(FILE *fp, int indent, const char *title, real r)
{
pr_indent(fp, indent);
fprintf(fp, "%-30s = %g\n", title, r);
}
-static void pr_double(FILE *fp, int indent, const char *title, double d)
+void pr_double(FILE *fp, int indent, const char *title, double d)
{
pr_indent(fp, indent);
fprintf(fp, "%-30s = %g\n", title, d);
}
-static void pr_str(FILE *fp, int indent, const char *title, const char *s)
+void pr_str(FILE *fp, int indent, const char *title, const char *s)
{
pr_indent(fp, indent);
fprintf(fp, "%-30s = %s\n", title, s);
#undef PR
#undef PI
-static void pr_harm(FILE *fp, const t_iparams *iparams, const char *r, const char *kr)
-{
- fprintf(fp, "%sA=%12.5e, %sA=%12.5e, %sB=%12.5e, %sB=%12.5e\n",
- r, iparams->harmonic.rA, kr, iparams->harmonic.krA,
- r, iparams->harmonic.rB, kr, iparams->harmonic.krB);
-}
-
-void pr_iparams(FILE *fp, t_functype ftype, const t_iparams *iparams)
-{
- switch (ftype)
- {
- case F_ANGLES:
- case F_G96ANGLES:
- pr_harm(fp, iparams, "th", "ct");
- break;
- case F_CROSS_BOND_BONDS:
- fprintf(fp, "r1e=%15.8e, r2e=%15.8e, krr=%15.8e\n",
- iparams->cross_bb.r1e, iparams->cross_bb.r2e,
- iparams->cross_bb.krr);
- break;
- case F_CROSS_BOND_ANGLES:
- fprintf(fp, "r1e=%15.8e, r1e=%15.8e, r3e=%15.8e, krt=%15.8e\n",
- iparams->cross_ba.r1e, iparams->cross_ba.r2e,
- iparams->cross_ba.r3e, iparams->cross_ba.krt);
- break;
- case F_LINEAR_ANGLES:
- fprintf(fp, "klinA=%15.8e, aA=%15.8e, klinB=%15.8e, aB=%15.8e\n",
- iparams->linangle.klinA, iparams->linangle.aA,
- iparams->linangle.klinB, iparams->linangle.aB);
- break;
- case F_UREY_BRADLEY:
- fprintf(fp, "thetaA=%15.8e, kthetaA=%15.8e, r13A=%15.8e, kUBA=%15.8e, thetaB=%15.8e, kthetaB=%15.8e, r13B=%15.8e, kUBB=%15.8e\n", iparams->u_b.thetaA, iparams->u_b.kthetaA, iparams->u_b.r13A, iparams->u_b.kUBA, iparams->u_b.thetaB, iparams->u_b.kthetaB, iparams->u_b.r13B, iparams->u_b.kUBB);
- break;
- case F_QUARTIC_ANGLES:
- fprintf(fp, "theta=%15.8e", iparams->qangle.theta);
- for (int i = 0; i < 5; i++)
- {
- fprintf(fp, ", c%c=%15.8e", '0'+i, iparams->qangle.c[i]);
- }
- fprintf(fp, "\n");
- break;
- case F_BHAM:
- fprintf(fp, "a=%15.8e, b=%15.8e, c=%15.8e\n",
- iparams->bham.a, iparams->bham.b, iparams->bham.c);
- break;
- case F_BONDS:
- case F_G96BONDS:
- case F_HARMONIC:
- pr_harm(fp, iparams, "b0", "cb");
- break;
- case F_IDIHS:
- pr_harm(fp, iparams, "xi", "cx");
- break;
- case F_MORSE:
- fprintf(fp, "b0A=%15.8e, cbA=%15.8e, betaA=%15.8e, b0B=%15.8e, cbB=%15.8e, betaB=%15.8e\n",
- iparams->morse.b0A, iparams->morse.cbA, iparams->morse.betaA,
- iparams->morse.b0B, iparams->morse.cbB, iparams->morse.betaB);
- break;
- case F_CUBICBONDS:
- fprintf(fp, "b0=%15.8e, kb=%15.8e, kcub=%15.8e\n",
- iparams->cubic.b0, iparams->cubic.kb, iparams->cubic.kcub);
- break;
- case F_CONNBONDS:
- fprintf(fp, "\n");
- break;
- case F_FENEBONDS:
- fprintf(fp, "bm=%15.8e, kb=%15.8e\n", iparams->fene.bm, iparams->fene.kb);
- break;
- case F_RESTRBONDS:
- fprintf(fp, "lowA=%15.8e, up1A=%15.8e, up2A=%15.8e, kA=%15.8e, lowB=%15.8e, up1B=%15.8e, up2B=%15.8e, kB=%15.8e,\n",
- iparams->restraint.lowA, iparams->restraint.up1A,
- iparams->restraint.up2A, iparams->restraint.kA,
- iparams->restraint.lowB, iparams->restraint.up1B,
- iparams->restraint.up2B, iparams->restraint.kB);
- break;
- case F_TABBONDS:
- case F_TABBONDSNC:
- case F_TABANGLES:
- case F_TABDIHS:
- fprintf(fp, "tab=%d, kA=%15.8e, kB=%15.8e\n",
- iparams->tab.table, iparams->tab.kA, iparams->tab.kB);
- break;
- case F_POLARIZATION:
- fprintf(fp, "alpha=%15.8e\n", iparams->polarize.alpha);
- break;
- case F_ANHARM_POL:
- fprintf(fp, "alpha=%15.8e drcut=%15.8e khyp=%15.8e\n",
- iparams->anharm_polarize.alpha,
- iparams->anharm_polarize.drcut,
- iparams->anharm_polarize.khyp);
- break;
- case F_THOLE_POL:
- fprintf(fp, "a=%15.8e, alpha1=%15.8e, alpha2=%15.8e, rfac=%15.8e\n",
- iparams->thole.a, iparams->thole.alpha1, iparams->thole.alpha2,
- iparams->thole.rfac);
- break;
- case F_WATER_POL:
- fprintf(fp, "al_x=%15.8e, al_y=%15.8e, al_z=%15.8e, rOH=%9.6f, rHH=%9.6f, rOD=%9.6f\n",
- iparams->wpol.al_x, iparams->wpol.al_y, iparams->wpol.al_z,
- iparams->wpol.rOH, iparams->wpol.rHH, iparams->wpol.rOD);
- break;
- case F_LJ:
- fprintf(fp, "c6=%15.8e, c12=%15.8e\n", iparams->lj.c6, iparams->lj.c12);
- break;
- case F_LJ14:
- fprintf(fp, "c6A=%15.8e, c12A=%15.8e, c6B=%15.8e, c12B=%15.8e\n",
- iparams->lj14.c6A, iparams->lj14.c12A,
- iparams->lj14.c6B, iparams->lj14.c12B);
- break;
- case F_LJC14_Q:
- fprintf(fp, "fqq=%15.8e, qi=%15.8e, qj=%15.8e, c6=%15.8e, c12=%15.8e\n",
- iparams->ljc14.fqq,
- iparams->ljc14.qi, iparams->ljc14.qj,
- iparams->ljc14.c6, iparams->ljc14.c12);
- break;
- case F_LJC_PAIRS_NB:
- fprintf(fp, "qi=%15.8e, qj=%15.8e, c6=%15.8e, c12=%15.8e\n",
- iparams->ljcnb.qi, iparams->ljcnb.qj,
- iparams->ljcnb.c6, iparams->ljcnb.c12);
- break;
- case F_PDIHS:
- case F_PIDIHS:
- case F_ANGRES:
- case F_ANGRESZ:
- fprintf(fp, "phiA=%15.8e, cpA=%15.8e, phiB=%15.8e, cpB=%15.8e, mult=%d\n",
- iparams->pdihs.phiA, iparams->pdihs.cpA,
- iparams->pdihs.phiB, iparams->pdihs.cpB,
- iparams->pdihs.mult);
- break;
- case F_DISRES:
- fprintf(fp, "label=%4d, type=%1d, low=%15.8e, up1=%15.8e, up2=%15.8e, fac=%15.8e)\n",
- iparams->disres.label, iparams->disres.type,
- iparams->disres.low, iparams->disres.up1,
- iparams->disres.up2, iparams->disres.kfac);
- break;
- case F_ORIRES:
- fprintf(fp, "ex=%4d, label=%d, power=%4d, c=%15.8e, obs=%15.8e, kfac=%15.8e)\n",
- iparams->orires.ex, iparams->orires.label, iparams->orires.power,
- iparams->orires.c, iparams->orires.obs, iparams->orires.kfac);
- break;
- case F_DIHRES:
- fprintf(fp, "phiA=%15.8e, dphiA=%15.8e, kfacA=%15.8e, phiB=%15.8e, dphiB=%15.8e, kfacB=%15.8e\n",
- iparams->dihres.phiA, iparams->dihres.dphiA, iparams->dihres.kfacA,
- iparams->dihres.phiB, iparams->dihres.dphiB, iparams->dihres.kfacB);
- break;
- case F_POSRES:
- fprintf(fp, "pos0A=(%15.8e,%15.8e,%15.8e), fcA=(%15.8e,%15.8e,%15.8e), pos0B=(%15.8e,%15.8e,%15.8e), fcB=(%15.8e,%15.8e,%15.8e)\n",
- iparams->posres.pos0A[XX], iparams->posres.pos0A[YY],
- iparams->posres.pos0A[ZZ], iparams->posres.fcA[XX],
- iparams->posres.fcA[YY], iparams->posres.fcA[ZZ],
- iparams->posres.pos0B[XX], iparams->posres.pos0B[YY],
- iparams->posres.pos0B[ZZ], iparams->posres.fcB[XX],
- iparams->posres.fcB[YY], iparams->posres.fcB[ZZ]);
- break;
- case F_FBPOSRES:
- fprintf(fp, "pos0=(%15.8e,%15.8e,%15.8e), geometry=%d, r=%15.8e, k=%15.8e\n",
- iparams->fbposres.pos0[XX], iparams->fbposres.pos0[YY],
- iparams->fbposres.pos0[ZZ], iparams->fbposres.geom,
- iparams->fbposres.r, iparams->fbposres.k);
- break;
- case F_RBDIHS:
- for (int i = 0; i < NR_RBDIHS; i++)
- {
- fprintf(fp, "%srbcA[%d]=%15.8e", i == 0 ? "" : ", ", i, iparams->rbdihs.rbcA[i]);
- }
- fprintf(fp, "\n");
- for (int i = 0; i < NR_RBDIHS; i++)
- {
- fprintf(fp, "%srbcB[%d]=%15.8e", i == 0 ? "" : ", ", i, iparams->rbdihs.rbcB[i]);
- }
- fprintf(fp, "\n");
- break;
- case F_FOURDIHS:
- {
- /* Use the OPLS -> Ryckaert-Bellemans formula backwards to get
- * the OPLS potential constants back.
- */
- const real *rbcA = iparams->rbdihs.rbcA;
- const real *rbcB = iparams->rbdihs.rbcB;
- real VA[4], VB[4];
-
- VA[3] = -0.25*rbcA[4];
- VA[2] = -0.5*rbcA[3];
- VA[1] = 4.0*VA[3]-rbcA[2];
- VA[0] = 3.0*VA[2]-2.0*rbcA[1];
-
- VB[3] = -0.25*rbcB[4];
- VB[2] = -0.5*rbcB[3];
- VB[1] = 4.0*VB[3]-rbcB[2];
- VB[0] = 3.0*VB[2]-2.0*rbcB[1];
-
- for (int i = 0; i < NR_FOURDIHS; i++)
- {
- fprintf(fp, "%sFourA[%d]=%15.8e", i == 0 ? "" : ", ", i, VA[i]);
- }
- fprintf(fp, "\n");
- for (int i = 0; i < NR_FOURDIHS; i++)
- {
- fprintf(fp, "%sFourB[%d]=%15.8e", i == 0 ? "" : ", ", i, VB[i]);
- }
- fprintf(fp, "\n");
- }
- break;
-
- case F_CONSTR:
- case F_CONSTRNC:
- fprintf(fp, "dA=%15.8e, dB=%15.8e\n", iparams->constr.dA, iparams->constr.dB);
- break;
- case F_SETTLE:
- fprintf(fp, "doh=%15.8e, dhh=%15.8e\n", iparams->settle.doh,
- iparams->settle.dhh);
- break;
- case F_VSITE2:
- fprintf(fp, "a=%15.8e\n", iparams->vsite.a);
- break;
- case F_VSITE3:
- case F_VSITE3FD:
- case F_VSITE3FAD:
- fprintf(fp, "a=%15.8e, b=%15.8e\n", iparams->vsite.a, iparams->vsite.b);
- break;
- case F_VSITE3OUT:
- case F_VSITE4FD:
- case F_VSITE4FDN:
- fprintf(fp, "a=%15.8e, b=%15.8e, c=%15.8e\n",
- iparams->vsite.a, iparams->vsite.b, iparams->vsite.c);
- break;
- case F_VSITEN:
- fprintf(fp, "n=%2d, a=%15.8e\n", iparams->vsiten.n, iparams->vsiten.a);
- break;
- case F_GB12:
- case F_GB13:
- case F_GB14:
- fprintf(fp, "sar=%15.8e, st=%15.8e, pi=%15.8e, gbr=%15.8e, bmlt=%15.8e\n", iparams->gb.sar, iparams->gb.st, iparams->gb.pi, iparams->gb.gbr, iparams->gb.bmlt);
- break;
- case F_CMAP:
- fprintf(fp, "cmapA=%1d, cmapB=%1d\n", iparams->cmap.cmapA, iparams->cmap.cmapB);
- break;
- case F_RESTRANGLES:
- pr_harm(fp, iparams, "ktheta", "costheta0");
- break;
- case F_RESTRDIHS:
- fprintf(fp, "phiA=%15.8e, cpA=%15.8e",
- iparams->pdihs.phiA, iparams->pdihs.cpA);
- break;
- case F_CBTDIHS:
- fprintf(fp, "kphi=%15.8e", iparams->cbtdihs.cbtcA[0]);
- for (int i = 1; i < NR_CBTDIHS; i++)
- {
- fprintf(fp, ", cbtcA[%d]=%15.8e", i-1, iparams->cbtdihs.cbtcA[i]);
- }
- fprintf(fp, "\n");
- break;
- default:
- gmx_fatal(FARGS, "unknown function type %d (%s) in %s line %d",
- ftype, interaction_function[ftype].name, __FILE__, __LINE__);
- }
-}
-
-void pr_ilist(FILE *fp, int indent, const char *title,
- const t_functype *functype, const t_ilist *ilist, gmx_bool bShowNumbers)
-{
- int i, j, k, type, ftype;
- t_iatom *iatoms;
-
- if (available(fp, ilist, indent, title) && ilist->nr > 0)
- {
- indent = pr_title(fp, indent, title);
- pr_indent(fp, indent);
- fprintf(fp, "nr: %d\n", ilist->nr);
- if (ilist->nr > 0)
- {
- pr_indent(fp, indent);
- fprintf(fp, "iatoms:\n");
- 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);
- j++;
- for (k = 0; k < interaction_function[ftype].nratoms; k++)
- {
- fprintf(fp, " %d", *(iatoms++));
- }
- fprintf(fp, "\n");
- i += 1+interaction_function[ftype].nratoms;
-#else
- fprintf(fp, "%5d%5d\n", i, iatoms[i]);
- i++;
-#endif
- }
- }
- }
-}
-
-static void pr_cmap(FILE *fp, int indent, const char *title,
- const gmx_cmap_t *cmap_grid, gmx_bool bShowNumbers)
-{
- int i, j, nelem;
- real dx, idx;
-
- dx = 360.0 / cmap_grid->grid_spacing;
- nelem = cmap_grid->grid_spacing*cmap_grid->grid_spacing;
-
- if (available(fp, cmap_grid, indent, title))
- {
- fprintf(fp, "%s\n", title);
-
- for (i = 0; i < cmap_grid->ngrid; i++)
- {
- idx = -180.0;
- fprintf(fp, "%8s %8s %8s %8s\n", "V", "dVdx", "dVdy", "d2dV");
-
- fprintf(fp, "grid[%3d]={\n", bShowNumbers ? i : -1);
-
- for (j = 0; j < nelem; j++)
- {
- if ( (j%cmap_grid->grid_spacing) == 0)
- {
- fprintf(fp, "%8.1f\n", idx);
- idx += dx;
- }
-
- fprintf(fp, "%8.3f ", cmap_grid->cmapdata[i].cmap[j*4]);
- fprintf(fp, "%8.3f ", cmap_grid->cmapdata[i].cmap[j*4+1]);
- fprintf(fp, "%8.3f ", cmap_grid->cmapdata[i].cmap[j*4+2]);
- fprintf(fp, "%8.3f\n", cmap_grid->cmapdata[i].cmap[j*4+3]);
- }
- fprintf(fp, "\n");
- }
- }
-
-}
-
-void pr_ffparams(FILE *fp, int indent, const char *title,
- const gmx_ffparams_t *ffparams,
- gmx_bool bShowNumbers)
-{
- int i;
-
- indent = pr_title(fp, indent, title);
- pr_indent(fp, indent);
- fprintf(fp, "atnr=%d\n", ffparams->atnr);
- pr_indent(fp, indent);
- fprintf(fp, "ntypes=%d\n", ffparams->ntypes);
- for (i = 0; i < ffparams->ntypes; i++)
- {
- pr_indent(fp, indent+INDENT);
- fprintf(fp, "functype[%d]=%s, ",
- bShowNumbers ? i : -1,
- interaction_function[ffparams->functype[i]].name);
- pr_iparams(fp, ffparams->functype[i], &ffparams->iparams[i]);
- }
- pr_double(fp, indent, "reppow", ffparams->reppow);
- pr_real(fp, indent, "fudgeQQ", ffparams->fudgeQQ);
- 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)
-{
- int i, j;
-
- if (available(fp, idef, indent, title))
- {
- indent = pr_title(fp, indent, title);
- pr_indent(fp, indent);
- fprintf(fp, "atnr=%d\n", idef->atnr);
- pr_indent(fp, indent);
- fprintf(fp, "ntypes=%d\n", idef->ntypes);
- for (i = 0; i < idef->ntypes; i++)
- {
- pr_indent(fp, indent+INDENT);
- fprintf(fp, "functype[%d]=%s, ",
- bShowNumbers ? i : -1,
- interaction_function[idef->functype[i]].name);
- pr_iparams(fp, idef->functype[i], &idef->iparams[i]);
- }
- pr_real(fp, indent, "fudgeQQ", idef->fudgeQQ);
-
- for (j = 0; (j < F_NRE); j++)
- {
- pr_ilist(fp, indent, interaction_function[j].longname,
- idef->functype, &idef->il[j], bShowNumbers);
- }
- }
-}
-
-static int pr_block_title(FILE *fp, int indent, const char *title, const t_block *block)
-{
- if (available(fp, block, indent, title))
- {
- indent = pr_title(fp, indent, title);
- pr_indent(fp, indent);
- fprintf(fp, "nr=%d\n", block->nr);
- }
- return indent;
-}
-
-static int pr_blocka_title(FILE *fp, int indent, const char *title, const t_blocka *block)
-{
- if (available(fp, block, indent, title))
- {
- indent = pr_title(fp, indent, title);
- pr_indent(fp, indent);
- fprintf(fp, "nr=%d\n", block->nr);
- pr_indent(fp, indent);
- fprintf(fp, "nra=%d\n", block->nra);
- }
- return indent;
-}
-
-static void low_pr_blocka(FILE *fp, int indent, const char *title, const t_blocka *block, gmx_bool bShowNumbers)
-{
- int i;
-
- if (available(fp, block, indent, title))
- {
- indent = pr_blocka_title(fp, indent, title, block);
- for (i = 0; i <= block->nr; i++)
- {
- pr_indent(fp, indent+INDENT);
- fprintf(fp, "%s->index[%d]=%d\n",
- title, bShowNumbers ? i : -1, block->index[i]);
- }
- for (i = 0; i < block->nra; i++)
- {
- pr_indent(fp, indent+INDENT);
- fprintf(fp, "%s->a[%d]=%d\n",
- title, bShowNumbers ? i : -1, block->a[i]);
- }
- }
-}
-
-void pr_block(FILE *fp, int indent, const char *title, const t_block *block, gmx_bool bShowNumbers)
-{
- int i, start;
-
- if (available(fp, block, indent, title))
- {
- indent = pr_block_title(fp, indent, title, block);
- start = 0;
- if (block->index[start] != 0)
- {
- fprintf(fp, "block->index[%d] should be 0\n", start);
- }
- else
- {
- for (i = 0; i < block->nr; i++)
- {
- int end = block->index[i+1];
- pr_indent(fp, indent);
- if (end <= start)
- {
- fprintf(fp, "%s[%d]={}\n", title, i);
- }
- else
- {
- fprintf(fp, "%s[%d]={%d..%d}\n",
- title, bShowNumbers ? i : -1,
- bShowNumbers ? start : -1, bShowNumbers ? end-1 : -1);
- }
- start = end;
- }
- }
- }
-}
-
-void pr_blocka(FILE *fp, int indent, const char *title, const t_blocka *block, gmx_bool bShowNumbers)
-{
- int i, j, ok, size, start, end;
-
- if (available(fp, block, indent, title))
- {
- indent = pr_blocka_title(fp, indent, title, block);
- start = 0;
- end = start;
- if ((ok = (block->index[start] == 0)) == 0)
- {
- fprintf(fp, "block->index[%d] should be 0\n", start);
- }
- else
- {
- for (i = 0; i < block->nr; i++)
- {
- end = block->index[i+1];
- size = pr_indent(fp, indent);
- if (end <= start)
- {
- size += fprintf(fp, "%s[%d]={", title, i);
- }
- else
- {
- size += fprintf(fp, "%s[%d][%d..%d]={",
- title, bShowNumbers ? i : -1,
- bShowNumbers ? start : -1, bShowNumbers ? end-1 : -1);
- }
- for (j = start; j < end; j++)
- {
- if (j > start)
- {
- size += fprintf(fp, ", ");
- }
- if ((size) > (USE_WIDTH))
- {
- fprintf(fp, "\n");
- size = pr_indent(fp, indent+INDENT);
- }
- size += fprintf(fp, "%d", block->a[j]);
- }
- fprintf(fp, "}\n");
- start = end;
- }
- }
- if ((end != block->nra) || (!ok))
- {
- pr_indent(fp, indent);
- fprintf(fp, "tables inconsistent, dumping complete tables:\n");
- low_pr_blocka(fp, indent, title, block, bShowNumbers);
- }
- }
-}
-
-static void pr_strings(FILE *fp, int indent, const char *title, char ***nm, int n, gmx_bool bShowNumbers)
+void pr_strings(FILE *fp, int indent, const char *title, char ***nm, int n, gmx_bool bShowNumbers)
{
int i;
}
}
}
-
-static void pr_strings2(FILE *fp, int indent, const char *title,
- char ***nm, char ***nmB, int n, gmx_bool bShowNumbers)
-{
- int i;
-
- if (available(fp, nm, indent, title))
- {
- indent = pr_title_n(fp, indent, title, n);
- for (i = 0; i < n; i++)
- {
- pr_indent(fp, indent);
- fprintf(fp, "%s[%d]={name=\"%s\",nameB=\"%s\"}\n",
- title, bShowNumbers ? i : -1, *(nm[i]), *(nmB[i]));
- }
- }
-}
-
-static void pr_resinfo(FILE *fp, int indent, const char *title, t_resinfo *resinfo, int n, gmx_bool bShowNumbers)
-{
- int i;
-
- if (available(fp, resinfo, indent, title))
- {
- indent = pr_title_n(fp, indent, title, n);
- for (i = 0; i < n; i++)
- {
- pr_indent(fp, indent);
- fprintf(fp, "%s[%d]={name=\"%s\", nr=%d, ic='%c'}\n",
- title, bShowNumbers ? i : -1,
- *(resinfo[i].name), resinfo[i].nr,
- (resinfo[i].ic == '\0') ? ' ' : resinfo[i].ic);
- }
- }
-}
-
-static void pr_atom(FILE *fp, int indent, const char *title, const t_atom *atom, int n)
-{
- int i;
-
- if (available(fp, atom, indent, title))
- {
- indent = pr_title_n(fp, indent, title, n);
- for (i = 0; i < n; i++)
- {
- pr_indent(fp, indent);
- fprintf(fp, "%s[%6d]={type=%3d, typeB=%3d, ptype=%8s, m=%12.5e, "
- "q=%12.5e, mB=%12.5e, qB=%12.5e, resind=%5d, atomnumber=%3d}\n",
- title, i, atom[i].type, atom[i].typeB, ptype_str[atom[i].ptype],
- atom[i].m, atom[i].q, atom[i].mB, atom[i].qB,
- atom[i].resind, atom[i].atomnumber);
- }
- }
-}
-
-static void pr_grps(FILE *fp, const char *title, const t_grps grps[], char **grpname[])
-{
- int i, j;
-
- for (i = 0; (i < egcNR); i++)
- {
- fprintf(fp, "%s[%-12s] nr=%d, name=[", title, gtypes[i], grps[i].nr);
- for (j = 0; (j < grps[i].nr); j++)
- {
- fprintf(fp, " %s", *(grpname[grps[i].nm_ind[j]]));
- }
- fprintf(fp, "]\n");
- }
-}
-
-static void pr_groups(FILE *fp, int indent,
- const gmx_groups_t *groups,
- gmx_bool bShowNumbers)
-{
- int nat_max, i, g;
-
- pr_grps(fp, "grp", groups->grps, groups->grpname);
- pr_strings(fp, indent, "grpname", groups->grpname, groups->ngrpname, bShowNumbers);
-
- pr_indent(fp, indent);
- fprintf(fp, "groups ");
- for (g = 0; g < egcNR; g++)
- {
- printf(" %5.5s", gtypes[g]);
- }
- printf("\n");
-
- pr_indent(fp, indent);
- fprintf(fp, "allocated ");
- nat_max = 0;
- for (g = 0; g < egcNR; g++)
- {
- printf(" %5d", groups->ngrpnr[g]);
- nat_max = std::max(nat_max, groups->ngrpnr[g]);
- }
- printf("\n");
-
- if (nat_max == 0)
- {
- pr_indent(fp, indent);
- fprintf(fp, "groupnr[%5s] =", "*");
- for (g = 0; g < egcNR; g++)
- {
- fprintf(fp, " %3d ", 0);
- }
- fprintf(fp, "\n");
- }
- else
- {
- for (i = 0; i < nat_max; i++)
- {
- pr_indent(fp, indent);
- fprintf(fp, "groupnr[%5d] =", i);
- for (g = 0; g < egcNR; g++)
- {
- fprintf(fp, " %3d ",
- groups->grpnr[g] ? groups->grpnr[g][i] : 0);
- }
- fprintf(fp, "\n");
- }
- }
-}
-
-void pr_atoms(FILE *fp, int indent, const char *title, const t_atoms *atoms,
- gmx_bool bShownumbers)
-{
- if (available(fp, atoms, indent, title))
- {
- indent = pr_title(fp, indent, title);
- pr_atom(fp, indent, "atom", atoms->atom, atoms->nr);
- pr_strings(fp, indent, "atom", atoms->atomname, atoms->nr, bShownumbers);
- pr_strings2(fp, indent, "type", atoms->atomtype, atoms->atomtypeB, atoms->nr, bShownumbers);
- pr_resinfo(fp, indent, "residue", atoms->resinfo, atoms->nres, bShownumbers);
- }
-}
-
-
-void pr_atomtypes(FILE *fp, int indent, const char *title, const t_atomtypes *atomtypes,
- gmx_bool bShowNumbers)
-{
- int i;
- if (available(fp, atomtypes, indent, title))
- {
- indent = pr_title(fp, indent, title);
- for (i = 0; i < atomtypes->nr; i++)
- {
- pr_indent(fp, indent);
- fprintf(fp,
- "atomtype[%3d]={radius=%12.5e, volume=%12.5e, gb_radius=%12.5e, surftens=%12.5e, atomnumber=%4d, S_hct=%12.5e)}\n",
- bShowNumbers ? i : -1, atomtypes->radius[i], atomtypes->vol[i],
- atomtypes->gb_radius[i],
- atomtypes->surftens[i], atomtypes->atomnumber[i], atomtypes->S_hct[i]);
- }
- }
-}
-
-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)
-{
- int j;
-
- indent = pr_title_n(fp, indent, title, n);
- pr_indent(fp, indent);
- fprintf(fp, "name=\"%s\"\n", *(molt->name));
- pr_atoms(fp, indent, "atoms", &(molt->atoms), bShowNumbers);
- pr_block(fp, indent, "cgs", &molt->cgs, bShowNumbers);
- pr_blocka(fp, indent, "excls", &molt->excls, bShowNumbers);
- for (j = 0; (j < F_NRE); j++)
- {
- pr_ilist(fp, indent, interaction_function[j].longname,
- ffparams->functype, &molt->ilist[j], bShowNumbers);
- }
-}
-
-static void pr_molblock(FILE *fp, int indent, const char *title,
- const gmx_molblock_t *molb, int n,
- const gmx_moltype_t *molt)
-{
- indent = pr_title_n(fp, indent, title, n);
- pr_indent(fp, indent);
- fprintf(fp, "%-20s = %d \"%s\"\n",
- "moltype", molb->type, *(molt[molb->type].name));
- pr_int(fp, indent, "#molecules", molb->nmol);
- pr_int(fp, indent, "#atoms_mol", molb->natoms_mol);
- pr_int(fp, indent, "#posres_xA", molb->nposres_xA);
- if (molb->nposres_xA > 0)
- {
- pr_rvecs(fp, indent, "posres_xA", molb->posres_xA, molb->nposres_xA);
- }
- pr_int(fp, indent, "#posres_xB", molb->nposres_xB);
- if (molb->nposres_xB > 0)
- {
- pr_rvecs(fp, indent, "posres_xB", molb->posres_xB, molb->nposres_xB);
- }
-}
-
-void pr_mtop(FILE *fp, int indent, const char *title, const gmx_mtop_t *mtop,
- gmx_bool bShowNumbers)
-{
- int mt, mb, j;
-
- if (available(fp, mtop, indent, title))
- {
- indent = pr_title(fp, indent, title);
- pr_indent(fp, indent);
- fprintf(fp, "name=\"%s\"\n", *(mtop->name));
- pr_int(fp, indent, "#atoms", mtop->natoms);
- pr_int(fp, indent, "#molblock", mtop->nmolblock);
- for (mb = 0; mb < mtop->nmolblock; mb++)
- {
- pr_molblock(fp, indent, "molblock", &mtop->molblock[mb], mb, mtop->moltype);
- }
- pr_str(fp, indent, "bIntermolecularInteractions", EBOOL(mtop->bIntermolecularInteractions));
- if (mtop->bIntermolecularInteractions)
- {
- for (j = 0; (j < F_NRE); j++)
- {
- pr_ilist(fp, indent, interaction_function[j].longname,
- mtop->ffparams.functype,
- &mtop->intermolecular_ilist[j], bShowNumbers);
- }
- }
- pr_ffparams(fp, indent, "ffparams", &(mtop->ffparams), bShowNumbers);
- pr_atomtypes(fp, indent, "atomtypes", &(mtop->atomtypes), bShowNumbers);
- for (mt = 0; mt < mtop->nmoltype; mt++)
- {
- pr_moltype(fp, indent, "moltype", &mtop->moltype[mt], mt,
- &mtop->ffparams, bShowNumbers);
- }
- pr_groups(fp, indent, &mtop->groups, bShowNumbers);
- }
-}
-
-void pr_top(FILE *fp, int indent, const char *title, const t_topology *top, gmx_bool bShowNumbers)
-{
- if (available(fp, top, indent, title))
- {
- indent = pr_title(fp, indent, title);
- pr_indent(fp, indent);
- fprintf(fp, "name=\"%s\"\n", *(top->name));
- pr_atoms(fp, indent, "atoms", &(top->atoms), bShowNumbers);
- pr_atomtypes(fp, indent, "atomtypes", &(top->atomtypes), bShowNumbers);
- pr_block(fp, indent, "cgs", &top->cgs, bShowNumbers);
- pr_block(fp, indent, "mols", &top->mols, bShowNumbers);
- pr_str(fp, indent, "bIntermolecularInteractions", EBOOL(top->bIntermolecularInteractions));
- pr_blocka(fp, indent, "excls", &top->excls, bShowNumbers);
- pr_idef(fp, indent, "idef", &top->idef, bShowNumbers);
- }
-}
-
-void pr_header(FILE *fp, int indent, const char *title, const t_tpxheader *sh)
-{
- if (available(fp, sh, indent, title))
- {
- indent = pr_title(fp, indent, title);
- pr_indent(fp, indent);
- fprintf(fp, "bIr = %spresent\n", sh->bIr ? "" : "not ");
- pr_indent(fp, indent);
- fprintf(fp, "bBox = %spresent\n", sh->bBox ? "" : "not ");
- pr_indent(fp, indent);
- fprintf(fp, "bTop = %spresent\n", sh->bTop ? "" : "not ");
- pr_indent(fp, indent);
- fprintf(fp, "bX = %spresent\n", sh->bX ? "" : "not ");
- pr_indent(fp, indent);
- fprintf(fp, "bV = %spresent\n", sh->bV ? "" : "not ");
- pr_indent(fp, indent);
- fprintf(fp, "bF = %spresent\n", sh->bF ? "" : "not ");
-
- pr_indent(fp, indent);
- fprintf(fp, "natoms = %d\n", sh->natoms);
- pr_indent(fp, indent);
- fprintf(fp, "lambda = %e\n", sh->lambda);
- }
-}
-
-void pr_commrec(FILE *fp, int indent, const t_commrec *cr)
-{
- pr_indent(fp, indent);
- fprintf(fp, "commrec:\n");
- indent += 2;
- pr_indent(fp, indent);
- fprintf(fp, "rank = %d\n", cr->nodeid);
- pr_indent(fp, indent);
- fprintf(fp, "number of ranks = %d\n", cr->nnodes);
- pr_indent(fp, indent);
- fprintf(fp, "PME-only ranks = %d\n", cr->npmenodes);
- /*
- pr_indent(fp,indent);
- fprintf(fp,"threadid = %d\n",cr->threadid);
- pr_indent(fp,indent);
- fprintf(fp,"nthreads = %d\n",cr->nthreads);
- */
-}
#include <cstdio>
-#include "gromacs/topology/idef.h"
+#include "gromacs/math/vectypes.h"
#include "gromacs/utility/basedefinitions.h"
-struct gmx_mtop_t;
-struct t_atoms;
-struct t_atomtypes;
-struct t_block;
-struct t_blocka;
-struct t_commrec;
-struct t_idef;
struct t_inputrec;
-struct t_topology;
-struct t_tpxheader;
#define LINE_WIDTH 80
#define RMARGIN 10
void pr_ivecs(FILE *fp, int indent, const char *title, const ivec vec[], int n, gmx_bool bShowNumbers);
void pr_bvec(FILE *fp, int indent, const char *title, const gmx_bool vec[], int n, gmx_bool bShowNnumbers);
void pr_rvec(FILE *fp, int indent, const char *title, const real vec[], int n, gmx_bool bShowNumbers);
-void pr_rvecs_of_dim(FILE *fp, int indent, const char *title, rvec vec[], int n, int dim);
+void pr_rvecs_of_dim(FILE *fp, int indent, const char *title, const rvec vec[], int n, int dim);
void pr_dvec(FILE *fp, int indent, const char *title, const double vec[], int n, gmx_bool bShowNumbers);
void pr_rvecs(FILE *fp, int indent, const char *title, const rvec vec[], int n);
void pr_rvecs_len(FILE *fp, int indent, const char *title, const rvec vec[], int n);
void pr_reals(FILE *fp, int indent, const char *title, const real vec[], int n);
void pr_doubles(FILE *fp, int indent, const char *title, const double *vec, int n);
void pr_reals_of_dim(FILE *fp, int indent, const char *title, const real *vec, int n, int dim);
-void pr_block(FILE *fp, int indent, const char *title, const t_block *block, gmx_bool bShowNumbers);
-void pr_blocka(FILE *fp, int indent, const char *title, const t_blocka *block, gmx_bool bShowNumbers);
-void pr_ilist(FILE *fp, int indent, const char *title,
- const t_functype *functype, const t_ilist *ilist, gmx_bool bShowNumbers);
-void pr_iparams(FILE *fp, t_functype ftype, const t_iparams *iparams);
-void pr_idef(FILE *fp, int indent, const char *title, const t_idef *idef, gmx_bool bShowNumbers);
+void pr_int(FILE *fp, int indent, const char *title, int i);
+void pr_real(FILE *fp, int indent, const char *title, real r);
+void pr_double(FILE *fp, int indent, const char *title, double d);
+void pr_str(FILE *fp, int indent, const char *title, const char *s);
+void pr_strings(FILE *fp, int indent, const char *title, char ***nm, int n, gmx_bool bShowNumbers);
void pr_inputrec(FILE *fp, int indent, const char *title, const t_inputrec *ir,
gmx_bool bMDPformat);
-void pr_atoms(FILE *fp, int indent, const char *title, const t_atoms *atoms,
- gmx_bool bShownumbers);
-void pr_atomtypes(FILE *fp, int indent, const char *title,
- t_atomtypes *atomtypes, gmx_bool bShowNumbers);
-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);
-/*
- * This routine prints out a (human) readable representation of
- * the topology to the file fp. Ident specifies the number of
- * spaces the text should be indented. Title is used to print a
- * header text.
- */
-void pr_header(FILE *fp, int indent, const char *title, const t_tpxheader *sh);
-/*
- * This routine prints out a (human) readable representation of
- * a header to the file fp. Ident specifies the number of spaces
- * the text should be indented. Title is used to print a header text.
- */
-
-void pr_commrec(FILE *fp, int indent, const struct t_commrec *cr);
-#endif /* GMX_FILEIO_TXTDUMP_H */
+#endif
#include "gromacs/fileio/pdbio.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/eigio.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/correlationfunctions/expfit.h"
#include "gromacs/correlationfunctions/integrate.h"
#include "gromacs/fileio/copyrite.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/gmxana/gstat.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/matio.h"
#include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/gmxana/gstat.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/groio.h"
#include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/math/do_fit.h"
#include "gromacs/math/vec.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/matio.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/eigio.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/matio.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/gmxana/gstat.h"
#include "gromacs/math/vec.h"
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/trx.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/math/units.h"
#include "gromacs/fileio/pdbio.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/gmxana/princ.h"
#include "gromacs/gmxlib/conformation-utilities.h"
#include "gromacs/fileio/matio.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/gmxana/gstat.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/fitahx.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/commandline/viewit.h"
#include "gromacs/fileio/enxio.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/gmxana/gstat.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/eigio.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/fileio/copyrite.h"
#include "gromacs/fileio/mtxio.h"
#include "gromacs/fileio/tpxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/eigio.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/pdbio.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxana/eigio.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/math/units.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/pdbio.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxana/eigio.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/math/units.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/gmxana/gstat.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/matio.h"
#include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/gmxana/gstat.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/commandline/viewit.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/math/units.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/trx.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/gmxana/gstat.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/trx.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/math/vec.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/trx.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/gmxana/gstat.h"
#include <cmath>
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/linearalgebra/nrjac.h"
#include "gromacs/math/vec.h"
#include "gromacs/topology/topology.h"
#include "thread_mpi/threads.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/nrnb.h"
#include "gromacs/gmxlib/nonbonded/nb_free_energy.h"
#include "gromacs/gmxlib/nonbonded/nb_generic.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/readinp.h"
#include "gromacs/math/3dtransforms.h"
#include "gromacs/math/utilities.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trx.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/calcgrid.h"
#include "gromacs/gmxlib/ifunc.h"
#include "gromacs/gmxlib/splitter.h"
#include <algorithm>
#include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/readinp.h"
#include "gromacs/gmxpreprocess/fflibutil.h"
#include "gromacs/gmxpreprocess/gpp_atomtype.h"
#include <sys/types.h>
#include "gromacs/fileio/gmxfio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/ifunc.h"
#include "gromacs/gmxlib/warninp.h"
#include "gromacs/gmxpreprocess/gmxcpp.h"
#include "gromacs/domdec/domdec.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/gmxfio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xtcio.h"
#include "gromacs/gmxlib/chargegroup.h"
#include "gromacs/gmxlib/disre.h"
#include "gromacs/fileio/copyrite.h"
#include "gromacs/fileio/filetypes.h"
#include "gromacs/fileio/trx.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/gmx_detect_hardware.h"
#include "gromacs/gmxlib/gmx_omp_nthreads.h"
#include "gromacs/gmxlib/md_logging.h"
#include "gromacs/ewald/pme.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/mtxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/gmx_omp_nthreads.h"
#include "gromacs/gmxlib/md_logging.h"
#include "gromacs/gmxlib/network.h"
#include <string.h>
#include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/network.h"
#include "gromacs/gmxlib/nrnb.h"
#include "gromacs/math/units.h"
#include <string.h>
#include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/network.h"
#include "gromacs/gmxlib/nrnb.h"
#include "gromacs/math/units.h"
#include <string.h>
#include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/network.h"
#include "gromacs/gmxlib/nrnb.h"
#include "gromacs/math/units.h"
#include <string.h>
#include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/network.h"
#include "gromacs/gmxlib/nrnb.h"
#include "gromacs/math/units.h"
#include "gromacs/domdec/domdec_struct.h"
#include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/network.h"
#include "gromacs/gmxlib/nrnb.h"
#include "gromacs/math/units.h"
#include <math.h>
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/nrnb.h"
#include "gromacs/math/vec.h"
#include "gromacs/mdlib/constr.h"
#include "gromacs/domdec/domdec.h"
#include "gromacs/domdec/domdec_struct.h"
#include "gromacs/fileio/checkpoint.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xtcio.h"
#include "gromacs/gmxlib/network.h"
#include "gromacs/math/utilities.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/trx.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxlib/chargegroup.h"
#include "gromacs/gmxlib/conformation-utilities.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trx.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/fileio/xtcio.h"
#include "gromacs/gmxlib/ifunc.h"
#include "gromacs/math/units.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trx.h"
#include "gromacs/fileio/trxio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/gmxlib/ifunc.h"
#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/mdtypes/pull-params.h"
pr_title(stdout, indent, fn);
pr_inputrec(stdout, 0, "inputrec", tpx.bIr ? &(ir) : NULL, FALSE);
- pr_header(stdout, indent, "header", &(tpx));
+ pr_tpxheader(stdout, indent, "header", &(tpx));
if (!bSysTop)
{
#include "atoms.h"
+#include <cstdio>
#include <cstring>
+#include "gromacs/fileio/txtdump.h"
#include "gromacs/topology/symtab.h"
#include "gromacs/utility/smalloc.h"
ri->chainnum = chainnum;
ri->chainid = chainid;
}
+
+static void pr_atom(FILE *fp, int indent, const char *title, const t_atom *atom, int n)
+{
+ int i;
+
+ if (available(fp, atom, indent, title))
+ {
+ indent = pr_title_n(fp, indent, title, n);
+ for (i = 0; i < n; i++)
+ {
+ pr_indent(fp, indent);
+ fprintf(fp, "%s[%6d]={type=%3d, typeB=%3d, ptype=%8s, m=%12.5e, "
+ "q=%12.5e, mB=%12.5e, qB=%12.5e, resind=%5d, atomnumber=%3d}\n",
+ title, i, atom[i].type, atom[i].typeB, ptype_str[atom[i].ptype],
+ atom[i].m, atom[i].q, atom[i].mB, atom[i].qB,
+ atom[i].resind, atom[i].atomnumber);
+ }
+ }
+}
+
+static void pr_strings2(FILE *fp, int indent, const char *title,
+ char ***nm, char ***nmB, int n, gmx_bool bShowNumbers)
+{
+ int i;
+
+ if (available(fp, nm, indent, title))
+ {
+ indent = pr_title_n(fp, indent, title, n);
+ for (i = 0; i < n; i++)
+ {
+ pr_indent(fp, indent);
+ fprintf(fp, "%s[%d]={name=\"%s\",nameB=\"%s\"}\n",
+ title, bShowNumbers ? i : -1, *(nm[i]), *(nmB[i]));
+ }
+ }
+}
+
+static void pr_resinfo(FILE *fp, int indent, const char *title, const t_resinfo *resinfo, int n,
+ gmx_bool bShowNumbers)
+{
+ int i;
+
+ if (available(fp, resinfo, indent, title))
+ {
+ indent = pr_title_n(fp, indent, title, n);
+ for (i = 0; i < n; i++)
+ {
+ pr_indent(fp, indent);
+ fprintf(fp, "%s[%d]={name=\"%s\", nr=%d, ic='%c'}\n",
+ title, bShowNumbers ? i : -1,
+ *(resinfo[i].name), resinfo[i].nr,
+ (resinfo[i].ic == '\0') ? ' ' : resinfo[i].ic);
+ }
+ }
+}
+
+void pr_atoms(FILE *fp, int indent, const char *title, const t_atoms *atoms,
+ gmx_bool bShownumbers)
+{
+ if (available(fp, atoms, indent, title))
+ {
+ indent = pr_title(fp, indent, title);
+ pr_atom(fp, indent, "atom", atoms->atom, atoms->nr);
+ pr_strings(fp, indent, "atom", atoms->atomname, atoms->nr, bShownumbers);
+ pr_strings2(fp, indent, "type", atoms->atomtype, atoms->atomtypeB, atoms->nr, bShownumbers);
+ pr_resinfo(fp, indent, "residue", atoms->resinfo, atoms->nres, bShownumbers);
+ }
+}
+
+
+void pr_atomtypes(FILE *fp, int indent, const char *title, const t_atomtypes *atomtypes,
+ gmx_bool bShowNumbers)
+{
+ int i;
+ if (available(fp, atomtypes, indent, title))
+ {
+ indent = pr_title(fp, indent, title);
+ for (i = 0; i < atomtypes->nr; i++)
+ {
+ pr_indent(fp, indent);
+ fprintf(fp,
+ "atomtype[%3d]={radius=%12.5e, volume=%12.5e, gb_radius=%12.5e, surftens=%12.5e, atomnumber=%4d, S_hct=%12.5e)}\n",
+ bShowNumbers ? i : -1, atomtypes->radius[i], atomtypes->vol[i],
+ atomtypes->gb_radius[i],
+ atomtypes->surftens[i], atomtypes->atomnumber[i], atomtypes->S_hct[i]);
+ }
+ }
+}
#ifndef GMX_TOPOLOGY_ATOMS_H
#define GMX_TOPOLOGY_ATOMS_H
+#include <stdio.h>
+
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/real.h"
* of atom index atom_ind.
*/
+void pr_atoms(FILE *fp, int indent, const char *title, const t_atoms *atoms,
+ gmx_bool bShownumbers);
+void pr_atomtypes(FILE *fp, int indent, const char *title,
+ const t_atomtypes *atomtypes, gmx_bool bShowNumbers);
+
#ifdef __cplusplus
}
#endif
*
* 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
+ * Copyright (c) 2013,2014,2015, 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 "block.h"
+#include <cstdio>
+
#include <algorithm>
+#include "gromacs/fileio/txtdump.h"
#include "gromacs/utility/smalloc.h"
void init_block(t_block *block)
dest->a[i] = src->a[i];
}
}
+
+static int pr_block_title(FILE *fp, int indent, const char *title, const t_block *block)
+{
+ if (available(fp, block, indent, title))
+ {
+ indent = pr_title(fp, indent, title);
+ pr_indent(fp, indent);
+ fprintf(fp, "nr=%d\n", block->nr);
+ }
+ return indent;
+}
+
+static int pr_blocka_title(FILE *fp, int indent, const char *title, const t_blocka *block)
+{
+ if (available(fp, block, indent, title))
+ {
+ indent = pr_title(fp, indent, title);
+ pr_indent(fp, indent);
+ fprintf(fp, "nr=%d\n", block->nr);
+ pr_indent(fp, indent);
+ fprintf(fp, "nra=%d\n", block->nra);
+ }
+ return indent;
+}
+
+static void low_pr_blocka(FILE *fp, int indent, const char *title, const t_blocka *block, gmx_bool bShowNumbers)
+{
+ int i;
+
+ if (available(fp, block, indent, title))
+ {
+ indent = pr_blocka_title(fp, indent, title, block);
+ for (i = 0; i <= block->nr; i++)
+ {
+ pr_indent(fp, indent+INDENT);
+ fprintf(fp, "%s->index[%d]=%d\n",
+ title, bShowNumbers ? i : -1, block->index[i]);
+ }
+ for (i = 0; i < block->nra; i++)
+ {
+ pr_indent(fp, indent+INDENT);
+ fprintf(fp, "%s->a[%d]=%d\n",
+ title, bShowNumbers ? i : -1, block->a[i]);
+ }
+ }
+}
+
+void pr_block(FILE *fp, int indent, const char *title, const t_block *block, gmx_bool bShowNumbers)
+{
+ int i, start;
+
+ if (available(fp, block, indent, title))
+ {
+ indent = pr_block_title(fp, indent, title, block);
+ start = 0;
+ if (block->index[start] != 0)
+ {
+ fprintf(fp, "block->index[%d] should be 0\n", start);
+ }
+ else
+ {
+ for (i = 0; i < block->nr; i++)
+ {
+ int end = block->index[i+1];
+ pr_indent(fp, indent);
+ if (end <= start)
+ {
+ fprintf(fp, "%s[%d]={}\n", title, i);
+ }
+ else
+ {
+ fprintf(fp, "%s[%d]={%d..%d}\n",
+ title, bShowNumbers ? i : -1,
+ bShowNumbers ? start : -1, bShowNumbers ? end-1 : -1);
+ }
+ start = end;
+ }
+ }
+ }
+}
+
+void pr_blocka(FILE *fp, int indent, const char *title, const t_blocka *block, gmx_bool bShowNumbers)
+{
+ int i, j, ok, size, start, end;
+
+ if (available(fp, block, indent, title))
+ {
+ indent = pr_blocka_title(fp, indent, title, block);
+ start = 0;
+ end = start;
+ if ((ok = (block->index[start] == 0)) == 0)
+ {
+ fprintf(fp, "block->index[%d] should be 0\n", start);
+ }
+ else
+ {
+ for (i = 0; i < block->nr; i++)
+ {
+ end = block->index[i+1];
+ size = pr_indent(fp, indent);
+ if (end <= start)
+ {
+ size += fprintf(fp, "%s[%d]={", title, i);
+ }
+ else
+ {
+ size += fprintf(fp, "%s[%d][%d..%d]={",
+ title, bShowNumbers ? i : -1,
+ bShowNumbers ? start : -1, bShowNumbers ? end-1 : -1);
+ }
+ for (j = start; j < end; j++)
+ {
+ if (j > start)
+ {
+ size += fprintf(fp, ", ");
+ }
+ if ((size) > (USE_WIDTH))
+ {
+ fprintf(fp, "\n");
+ size = pr_indent(fp, indent+INDENT);
+ }
+ size += fprintf(fp, "%d", block->a[j]);
+ }
+ fprintf(fp, "}\n");
+ start = end;
+ }
+ }
+ if ((end != block->nra) || (!ok))
+ {
+ pr_indent(fp, indent);
+ fprintf(fp, "tables inconsistent, dumping complete tables:\n");
+ low_pr_blocka(fp, indent, title, block, bShowNumbers);
+ }
+ }
+}
#ifndef GMX_TOPOLOGY_BLOCK_H
#define GMX_TOPOLOGY_BLOCK_H
+#include <stdio.h>
+
#include "gromacs/utility/basedefinitions.h"
#ifdef __cplusplus
* There is one atom per index entry
*/
+void pr_block(FILE *fp, int indent, const char *title, const t_block *block, gmx_bool bShowNumbers);
+void pr_blocka(FILE *fp, int indent, const char *title, const t_blocka *block, gmx_bool bShowNumbers);
+
#ifdef __cplusplus
}
#endif
--- /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,2015, 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 "gmxpre.h"
+
+#include "idef.h"
+
+#include <cstdio>
+
+#include "gromacs/fileio/txtdump.h"
+#include "gromacs/gmxlib/ifunc.h"
+#include "gromacs/utility/fatalerror.h"
+
+static void pr_harm(FILE *fp, const t_iparams *iparams, const char *r, const char *kr)
+{
+ fprintf(fp, "%sA=%12.5e, %sA=%12.5e, %sB=%12.5e, %sB=%12.5e\n",
+ r, iparams->harmonic.rA, kr, iparams->harmonic.krA,
+ r, iparams->harmonic.rB, kr, iparams->harmonic.krB);
+}
+
+void pr_iparams(FILE *fp, t_functype ftype, const t_iparams *iparams)
+{
+ switch (ftype)
+ {
+ case F_ANGLES:
+ case F_G96ANGLES:
+ pr_harm(fp, iparams, "th", "ct");
+ break;
+ case F_CROSS_BOND_BONDS:
+ fprintf(fp, "r1e=%15.8e, r2e=%15.8e, krr=%15.8e\n",
+ iparams->cross_bb.r1e, iparams->cross_bb.r2e,
+ iparams->cross_bb.krr);
+ break;
+ case F_CROSS_BOND_ANGLES:
+ fprintf(fp, "r1e=%15.8e, r1e=%15.8e, r3e=%15.8e, krt=%15.8e\n",
+ iparams->cross_ba.r1e, iparams->cross_ba.r2e,
+ iparams->cross_ba.r3e, iparams->cross_ba.krt);
+ break;
+ case F_LINEAR_ANGLES:
+ fprintf(fp, "klinA=%15.8e, aA=%15.8e, klinB=%15.8e, aB=%15.8e\n",
+ iparams->linangle.klinA, iparams->linangle.aA,
+ iparams->linangle.klinB, iparams->linangle.aB);
+ break;
+ case F_UREY_BRADLEY:
+ fprintf(fp, "thetaA=%15.8e, kthetaA=%15.8e, r13A=%15.8e, kUBA=%15.8e, thetaB=%15.8e, kthetaB=%15.8e, r13B=%15.8e, kUBB=%15.8e\n", iparams->u_b.thetaA, iparams->u_b.kthetaA, iparams->u_b.r13A, iparams->u_b.kUBA, iparams->u_b.thetaB, iparams->u_b.kthetaB, iparams->u_b.r13B, iparams->u_b.kUBB);
+ break;
+ case F_QUARTIC_ANGLES:
+ fprintf(fp, "theta=%15.8e", iparams->qangle.theta);
+ for (int i = 0; i < 5; i++)
+ {
+ fprintf(fp, ", c%c=%15.8e", '0'+i, iparams->qangle.c[i]);
+ }
+ fprintf(fp, "\n");
+ break;
+ case F_BHAM:
+ fprintf(fp, "a=%15.8e, b=%15.8e, c=%15.8e\n",
+ iparams->bham.a, iparams->bham.b, iparams->bham.c);
+ break;
+ case F_BONDS:
+ case F_G96BONDS:
+ case F_HARMONIC:
+ pr_harm(fp, iparams, "b0", "cb");
+ break;
+ case F_IDIHS:
+ pr_harm(fp, iparams, "xi", "cx");
+ break;
+ case F_MORSE:
+ fprintf(fp, "b0A=%15.8e, cbA=%15.8e, betaA=%15.8e, b0B=%15.8e, cbB=%15.8e, betaB=%15.8e\n",
+ iparams->morse.b0A, iparams->morse.cbA, iparams->morse.betaA,
+ iparams->morse.b0B, iparams->morse.cbB, iparams->morse.betaB);
+ break;
+ case F_CUBICBONDS:
+ fprintf(fp, "b0=%15.8e, kb=%15.8e, kcub=%15.8e\n",
+ iparams->cubic.b0, iparams->cubic.kb, iparams->cubic.kcub);
+ break;
+ case F_CONNBONDS:
+ fprintf(fp, "\n");
+ break;
+ case F_FENEBONDS:
+ fprintf(fp, "bm=%15.8e, kb=%15.8e\n", iparams->fene.bm, iparams->fene.kb);
+ break;
+ case F_RESTRBONDS:
+ fprintf(fp, "lowA=%15.8e, up1A=%15.8e, up2A=%15.8e, kA=%15.8e, lowB=%15.8e, up1B=%15.8e, up2B=%15.8e, kB=%15.8e,\n",
+ iparams->restraint.lowA, iparams->restraint.up1A,
+ iparams->restraint.up2A, iparams->restraint.kA,
+ iparams->restraint.lowB, iparams->restraint.up1B,
+ iparams->restraint.up2B, iparams->restraint.kB);
+ break;
+ case F_TABBONDS:
+ case F_TABBONDSNC:
+ case F_TABANGLES:
+ case F_TABDIHS:
+ fprintf(fp, "tab=%d, kA=%15.8e, kB=%15.8e\n",
+ iparams->tab.table, iparams->tab.kA, iparams->tab.kB);
+ break;
+ case F_POLARIZATION:
+ fprintf(fp, "alpha=%15.8e\n", iparams->polarize.alpha);
+ break;
+ case F_ANHARM_POL:
+ fprintf(fp, "alpha=%15.8e drcut=%15.8e khyp=%15.8e\n",
+ iparams->anharm_polarize.alpha,
+ iparams->anharm_polarize.drcut,
+ iparams->anharm_polarize.khyp);
+ break;
+ case F_THOLE_POL:
+ fprintf(fp, "a=%15.8e, alpha1=%15.8e, alpha2=%15.8e, rfac=%15.8e\n",
+ iparams->thole.a, iparams->thole.alpha1, iparams->thole.alpha2,
+ iparams->thole.rfac);
+ break;
+ case F_WATER_POL:
+ fprintf(fp, "al_x=%15.8e, al_y=%15.8e, al_z=%15.8e, rOH=%9.6f, rHH=%9.6f, rOD=%9.6f\n",
+ iparams->wpol.al_x, iparams->wpol.al_y, iparams->wpol.al_z,
+ iparams->wpol.rOH, iparams->wpol.rHH, iparams->wpol.rOD);
+ break;
+ case F_LJ:
+ fprintf(fp, "c6=%15.8e, c12=%15.8e\n", iparams->lj.c6, iparams->lj.c12);
+ break;
+ case F_LJ14:
+ fprintf(fp, "c6A=%15.8e, c12A=%15.8e, c6B=%15.8e, c12B=%15.8e\n",
+ iparams->lj14.c6A, iparams->lj14.c12A,
+ iparams->lj14.c6B, iparams->lj14.c12B);
+ break;
+ case F_LJC14_Q:
+ fprintf(fp, "fqq=%15.8e, qi=%15.8e, qj=%15.8e, c6=%15.8e, c12=%15.8e\n",
+ iparams->ljc14.fqq,
+ iparams->ljc14.qi, iparams->ljc14.qj,
+ iparams->ljc14.c6, iparams->ljc14.c12);
+ break;
+ case F_LJC_PAIRS_NB:
+ fprintf(fp, "qi=%15.8e, qj=%15.8e, c6=%15.8e, c12=%15.8e\n",
+ iparams->ljcnb.qi, iparams->ljcnb.qj,
+ iparams->ljcnb.c6, iparams->ljcnb.c12);
+ break;
+ case F_PDIHS:
+ case F_PIDIHS:
+ case F_ANGRES:
+ case F_ANGRESZ:
+ fprintf(fp, "phiA=%15.8e, cpA=%15.8e, phiB=%15.8e, cpB=%15.8e, mult=%d\n",
+ iparams->pdihs.phiA, iparams->pdihs.cpA,
+ iparams->pdihs.phiB, iparams->pdihs.cpB,
+ iparams->pdihs.mult);
+ break;
+ case F_DISRES:
+ fprintf(fp, "label=%4d, type=%1d, low=%15.8e, up1=%15.8e, up2=%15.8e, fac=%15.8e)\n",
+ iparams->disres.label, iparams->disres.type,
+ iparams->disres.low, iparams->disres.up1,
+ iparams->disres.up2, iparams->disres.kfac);
+ break;
+ case F_ORIRES:
+ fprintf(fp, "ex=%4d, label=%d, power=%4d, c=%15.8e, obs=%15.8e, kfac=%15.8e)\n",
+ iparams->orires.ex, iparams->orires.label, iparams->orires.power,
+ iparams->orires.c, iparams->orires.obs, iparams->orires.kfac);
+ break;
+ case F_DIHRES:
+ fprintf(fp, "phiA=%15.8e, dphiA=%15.8e, kfacA=%15.8e, phiB=%15.8e, dphiB=%15.8e, kfacB=%15.8e\n",
+ iparams->dihres.phiA, iparams->dihres.dphiA, iparams->dihres.kfacA,
+ iparams->dihres.phiB, iparams->dihres.dphiB, iparams->dihres.kfacB);
+ break;
+ case F_POSRES:
+ fprintf(fp, "pos0A=(%15.8e,%15.8e,%15.8e), fcA=(%15.8e,%15.8e,%15.8e), pos0B=(%15.8e,%15.8e,%15.8e), fcB=(%15.8e,%15.8e,%15.8e)\n",
+ iparams->posres.pos0A[XX], iparams->posres.pos0A[YY],
+ iparams->posres.pos0A[ZZ], iparams->posres.fcA[XX],
+ iparams->posres.fcA[YY], iparams->posres.fcA[ZZ],
+ iparams->posres.pos0B[XX], iparams->posres.pos0B[YY],
+ iparams->posres.pos0B[ZZ], iparams->posres.fcB[XX],
+ iparams->posres.fcB[YY], iparams->posres.fcB[ZZ]);
+ break;
+ case F_FBPOSRES:
+ fprintf(fp, "pos0=(%15.8e,%15.8e,%15.8e), geometry=%d, r=%15.8e, k=%15.8e\n",
+ iparams->fbposres.pos0[XX], iparams->fbposres.pos0[YY],
+ iparams->fbposres.pos0[ZZ], iparams->fbposres.geom,
+ iparams->fbposres.r, iparams->fbposres.k);
+ break;
+ case F_RBDIHS:
+ for (int i = 0; i < NR_RBDIHS; i++)
+ {
+ fprintf(fp, "%srbcA[%d]=%15.8e", i == 0 ? "" : ", ", i, iparams->rbdihs.rbcA[i]);
+ }
+ fprintf(fp, "\n");
+ for (int i = 0; i < NR_RBDIHS; i++)
+ {
+ fprintf(fp, "%srbcB[%d]=%15.8e", i == 0 ? "" : ", ", i, iparams->rbdihs.rbcB[i]);
+ }
+ fprintf(fp, "\n");
+ break;
+ case F_FOURDIHS:
+ {
+ /* Use the OPLS -> Ryckaert-Bellemans formula backwards to get
+ * the OPLS potential constants back.
+ */
+ const real *rbcA = iparams->rbdihs.rbcA;
+ const real *rbcB = iparams->rbdihs.rbcB;
+ real VA[4], VB[4];
+
+ VA[3] = -0.25*rbcA[4];
+ VA[2] = -0.5*rbcA[3];
+ VA[1] = 4.0*VA[3]-rbcA[2];
+ VA[0] = 3.0*VA[2]-2.0*rbcA[1];
+
+ VB[3] = -0.25*rbcB[4];
+ VB[2] = -0.5*rbcB[3];
+ VB[1] = 4.0*VB[3]-rbcB[2];
+ VB[0] = 3.0*VB[2]-2.0*rbcB[1];
+
+ for (int i = 0; i < NR_FOURDIHS; i++)
+ {
+ fprintf(fp, "%sFourA[%d]=%15.8e", i == 0 ? "" : ", ", i, VA[i]);
+ }
+ fprintf(fp, "\n");
+ for (int i = 0; i < NR_FOURDIHS; i++)
+ {
+ fprintf(fp, "%sFourB[%d]=%15.8e", i == 0 ? "" : ", ", i, VB[i]);
+ }
+ fprintf(fp, "\n");
+ break;
+ }
+
+ case F_CONSTR:
+ case F_CONSTRNC:
+ fprintf(fp, "dA=%15.8e, dB=%15.8e\n", iparams->constr.dA, iparams->constr.dB);
+ break;
+ case F_SETTLE:
+ fprintf(fp, "doh=%15.8e, dhh=%15.8e\n", iparams->settle.doh,
+ iparams->settle.dhh);
+ break;
+ case F_VSITE2:
+ fprintf(fp, "a=%15.8e\n", iparams->vsite.a);
+ break;
+ case F_VSITE3:
+ case F_VSITE3FD:
+ case F_VSITE3FAD:
+ fprintf(fp, "a=%15.8e, b=%15.8e\n", iparams->vsite.a, iparams->vsite.b);
+ break;
+ case F_VSITE3OUT:
+ case F_VSITE4FD:
+ case F_VSITE4FDN:
+ fprintf(fp, "a=%15.8e, b=%15.8e, c=%15.8e\n",
+ iparams->vsite.a, iparams->vsite.b, iparams->vsite.c);
+ break;
+ case F_VSITEN:
+ fprintf(fp, "n=%2d, a=%15.8e\n", iparams->vsiten.n, iparams->vsiten.a);
+ break;
+ case F_GB12:
+ case F_GB13:
+ case F_GB14:
+ fprintf(fp, "sar=%15.8e, st=%15.8e, pi=%15.8e, gbr=%15.8e, bmlt=%15.8e\n", iparams->gb.sar, iparams->gb.st, iparams->gb.pi, iparams->gb.gbr, iparams->gb.bmlt);
+ break;
+ case F_CMAP:
+ fprintf(fp, "cmapA=%1d, cmapB=%1d\n", iparams->cmap.cmapA, iparams->cmap.cmapB);
+ break;
+ case F_RESTRANGLES:
+ pr_harm(fp, iparams, "ktheta", "costheta0");
+ break;
+ case F_RESTRDIHS:
+ fprintf(fp, "phiA=%15.8e, cpA=%15.8e",
+ iparams->pdihs.phiA, iparams->pdihs.cpA);
+ break;
+ case F_CBTDIHS:
+ fprintf(fp, "kphi=%15.8e", iparams->cbtdihs.cbtcA[0]);
+ for (int i = 1; i < NR_CBTDIHS; i++)
+ {
+ fprintf(fp, ", cbtcA[%d]=%15.8e", i-1, iparams->cbtdihs.cbtcA[i]);
+ }
+ fprintf(fp, "\n");
+ break;
+ default:
+ gmx_fatal(FARGS, "unknown function type %d (%s) in %s line %d",
+ ftype, interaction_function[ftype].name, __FILE__, __LINE__);
+ }
+}
+
+void pr_ilist(FILE *fp, int indent, const char *title,
+ const t_functype *functype, const t_ilist *ilist, gmx_bool bShowNumbers)
+{
+ int i, j, k, type, ftype;
+ t_iatom *iatoms;
+
+ if (available(fp, ilist, indent, title) && ilist->nr > 0)
+ {
+ indent = pr_title(fp, indent, title);
+ pr_indent(fp, indent);
+ fprintf(fp, "nr: %d\n", ilist->nr);
+ if (ilist->nr > 0)
+ {
+ pr_indent(fp, indent);
+ fprintf(fp, "iatoms:\n");
+ 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);
+ j++;
+ for (k = 0; k < interaction_function[ftype].nratoms; k++)
+ {
+ fprintf(fp, " %d", *(iatoms++));
+ }
+ fprintf(fp, "\n");
+ i += 1+interaction_function[ftype].nratoms;
+#else
+ fprintf(fp, "%5d%5d\n", i, iatoms[i]);
+ i++;
+#endif
+ }
+ }
+ }
+}
+
+static void pr_cmap(FILE *fp, int indent, const char *title,
+ const gmx_cmap_t *cmap_grid, gmx_bool bShowNumbers)
+{
+ int i, j, nelem;
+ real dx, idx;
+
+ dx = 360.0 / cmap_grid->grid_spacing;
+ nelem = cmap_grid->grid_spacing*cmap_grid->grid_spacing;
+
+ if (available(fp, cmap_grid, indent, title))
+ {
+ fprintf(fp, "%s\n", title);
+
+ for (i = 0; i < cmap_grid->ngrid; i++)
+ {
+ idx = -180.0;
+ fprintf(fp, "%8s %8s %8s %8s\n", "V", "dVdx", "dVdy", "d2dV");
+
+ fprintf(fp, "grid[%3d]={\n", bShowNumbers ? i : -1);
+
+ for (j = 0; j < nelem; j++)
+ {
+ if ( (j%cmap_grid->grid_spacing) == 0)
+ {
+ fprintf(fp, "%8.1f\n", idx);
+ idx += dx;
+ }
+
+ fprintf(fp, "%8.3f ", cmap_grid->cmapdata[i].cmap[j*4]);
+ fprintf(fp, "%8.3f ", cmap_grid->cmapdata[i].cmap[j*4+1]);
+ fprintf(fp, "%8.3f ", cmap_grid->cmapdata[i].cmap[j*4+2]);
+ fprintf(fp, "%8.3f\n", cmap_grid->cmapdata[i].cmap[j*4+3]);
+ }
+ fprintf(fp, "\n");
+ }
+ }
+
+}
+
+void pr_ffparams(FILE *fp, int indent, const char *title,
+ const gmx_ffparams_t *ffparams,
+ gmx_bool bShowNumbers)
+{
+ int i;
+
+ indent = pr_title(fp, indent, title);
+ pr_indent(fp, indent);
+ fprintf(fp, "atnr=%d\n", ffparams->atnr);
+ pr_indent(fp, indent);
+ fprintf(fp, "ntypes=%d\n", ffparams->ntypes);
+ for (i = 0; i < ffparams->ntypes; i++)
+ {
+ pr_indent(fp, indent+INDENT);
+ fprintf(fp, "functype[%d]=%s, ",
+ bShowNumbers ? i : -1,
+ interaction_function[ffparams->functype[i]].name);
+ pr_iparams(fp, ffparams->functype[i], &ffparams->iparams[i]);
+ }
+ pr_double(fp, indent, "reppow", ffparams->reppow);
+ pr_real(fp, indent, "fudgeQQ", ffparams->fudgeQQ);
+ 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)
+{
+ int i, j;
+
+ if (available(fp, idef, indent, title))
+ {
+ indent = pr_title(fp, indent, title);
+ pr_indent(fp, indent);
+ fprintf(fp, "atnr=%d\n", idef->atnr);
+ pr_indent(fp, indent);
+ fprintf(fp, "ntypes=%d\n", idef->ntypes);
+ for (i = 0; i < idef->ntypes; i++)
+ {
+ pr_indent(fp, indent+INDENT);
+ fprintf(fp, "functype[%d]=%s, ",
+ bShowNumbers ? i : -1,
+ interaction_function[idef->functype[i]].name);
+ pr_iparams(fp, idef->functype[i], &idef->iparams[i]);
+ }
+ pr_real(fp, indent, "fudgeQQ", idef->fudgeQQ);
+
+ for (j = 0; (j < F_NRE); j++)
+ {
+ pr_ilist(fp, indent, interaction_function[j].longname,
+ idef->functype, &idef->il[j], bShowNumbers);
+ }
+ }
+}
#ifndef GMX_TOPOLOGY_IDEF_H
#define GMX_TOPOLOGY_IDEF_H
+#include <stdio.h>
+
#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/real.h"
#ifdef __cplusplus
extern "C" {
#endif
-
/* check kernel/toppush.c when you change these numbers */
#define MAXATOMLIST 6
#define MAXFORCEPARAM 12
* should be at least F_NRE*(nthreads+1).
*/
+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);
+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);
+
#ifdef __cplusplus
}
#endif
#include <algorithm>
#include "gromacs/fileio/gmxfio.h"
-#include "gromacs/fileio/txtdump.h"
#include "gromacs/topology/atoms.h"
#include "gromacs/topology/block.h"
#include "gromacs/topology/invblock.h"
#include "topology.h"
+#include <cstdio>
+
+#include <algorithm>
+
+#include "gromacs/fileio/txtdump.h"
+#include "gromacs/gmxlib/ifunc.h"
#include "gromacs/topology/symtab.h"
#include "gromacs/utility/smalloc.h"
+#include "gromacs/utility/stringutil.h"
const char *gtypes[egcNR+1] = {
"T-Coupling", "Energy Mon.", "Acceleration", "Freeze",
done_block(&(top->mols));
done_blocka(&(top->excls));
}
+
+static void pr_grps(FILE *fp, const char *title, const t_grps grps[], char **grpname[])
+{
+ int i, j;
+
+ for (i = 0; (i < egcNR); i++)
+ {
+ fprintf(fp, "%s[%-12s] nr=%d, name=[", title, gtypes[i], grps[i].nr);
+ for (j = 0; (j < grps[i].nr); j++)
+ {
+ fprintf(fp, " %s", *(grpname[grps[i].nm_ind[j]]));
+ }
+ fprintf(fp, "]\n");
+ }
+}
+
+static void pr_groups(FILE *fp, int indent,
+ const gmx_groups_t *groups,
+ gmx_bool bShowNumbers)
+{
+ int nat_max, i, g;
+
+ pr_grps(fp, "grp", groups->grps, groups->grpname);
+ pr_strings(fp, indent, "grpname", groups->grpname, groups->ngrpname, bShowNumbers);
+
+ pr_indent(fp, indent);
+ fprintf(fp, "groups ");
+ for (g = 0; g < egcNR; g++)
+ {
+ printf(" %5.5s", gtypes[g]);
+ }
+ printf("\n");
+
+ pr_indent(fp, indent);
+ fprintf(fp, "allocated ");
+ nat_max = 0;
+ for (g = 0; g < egcNR; g++)
+ {
+ printf(" %5d", groups->ngrpnr[g]);
+ nat_max = std::max(nat_max, groups->ngrpnr[g]);
+ }
+ printf("\n");
+
+ if (nat_max == 0)
+ {
+ pr_indent(fp, indent);
+ fprintf(fp, "groupnr[%5s] =", "*");
+ for (g = 0; g < egcNR; g++)
+ {
+ fprintf(fp, " %3d ", 0);
+ }
+ fprintf(fp, "\n");
+ }
+ else
+ {
+ for (i = 0; i < nat_max; i++)
+ {
+ pr_indent(fp, indent);
+ fprintf(fp, "groupnr[%5d] =", i);
+ for (g = 0; g < egcNR; g++)
+ {
+ fprintf(fp, " %3d ",
+ groups->grpnr[g] ? groups->grpnr[g][i] : 0);
+ }
+ fprintf(fp, "\n");
+ }
+ }
+}
+
+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)
+{
+ int j;
+
+ indent = pr_title_n(fp, indent, title, n);
+ pr_indent(fp, indent);
+ fprintf(fp, "name=\"%s\"\n", *(molt->name));
+ pr_atoms(fp, indent, "atoms", &(molt->atoms), bShowNumbers);
+ pr_block(fp, indent, "cgs", &molt->cgs, bShowNumbers);
+ pr_blocka(fp, indent, "excls", &molt->excls, bShowNumbers);
+ for (j = 0; (j < F_NRE); j++)
+ {
+ pr_ilist(fp, indent, interaction_function[j].longname,
+ ffparams->functype, &molt->ilist[j], bShowNumbers);
+ }
+}
+
+static void pr_molblock(FILE *fp, int indent, const char *title,
+ const gmx_molblock_t *molb, int n,
+ const gmx_moltype_t *molt)
+{
+ indent = pr_title_n(fp, indent, title, n);
+ pr_indent(fp, indent);
+ fprintf(fp, "%-20s = %d \"%s\"\n",
+ "moltype", molb->type, *(molt[molb->type].name));
+ pr_int(fp, indent, "#molecules", molb->nmol);
+ pr_int(fp, indent, "#atoms_mol", molb->natoms_mol);
+ pr_int(fp, indent, "#posres_xA", molb->nposres_xA);
+ if (molb->nposres_xA > 0)
+ {
+ pr_rvecs(fp, indent, "posres_xA", molb->posres_xA, molb->nposres_xA);
+ }
+ pr_int(fp, indent, "#posres_xB", molb->nposres_xB);
+ if (molb->nposres_xB > 0)
+ {
+ pr_rvecs(fp, indent, "posres_xB", molb->posres_xB, molb->nposres_xB);
+ }
+}
+
+void pr_mtop(FILE *fp, int indent, const char *title, const gmx_mtop_t *mtop,
+ gmx_bool bShowNumbers)
+{
+ int mt, mb, j;
+
+ if (available(fp, mtop, indent, title))
+ {
+ indent = pr_title(fp, indent, title);
+ pr_indent(fp, indent);
+ fprintf(fp, "name=\"%s\"\n", *(mtop->name));
+ pr_int(fp, indent, "#atoms", mtop->natoms);
+ pr_int(fp, indent, "#molblock", mtop->nmolblock);
+ for (mb = 0; mb < mtop->nmolblock; mb++)
+ {
+ pr_molblock(fp, indent, "molblock", &mtop->molblock[mb], mb, mtop->moltype);
+ }
+ pr_str(fp, indent, "bIntermolecularInteractions",
+ gmx::boolToString(mtop->bIntermolecularInteractions));
+ if (mtop->bIntermolecularInteractions)
+ {
+ for (j = 0; (j < F_NRE); j++)
+ {
+ pr_ilist(fp, indent, interaction_function[j].longname,
+ mtop->ffparams.functype,
+ &mtop->intermolecular_ilist[j], bShowNumbers);
+ }
+ }
+ pr_ffparams(fp, indent, "ffparams", &(mtop->ffparams), bShowNumbers);
+ pr_atomtypes(fp, indent, "atomtypes", &(mtop->atomtypes), bShowNumbers);
+ for (mt = 0; mt < mtop->nmoltype; mt++)
+ {
+ pr_moltype(fp, indent, "moltype", &mtop->moltype[mt], mt,
+ &mtop->ffparams, bShowNumbers);
+ }
+ pr_groups(fp, indent, &mtop->groups, bShowNumbers);
+ }
+}
+
+void pr_top(FILE *fp, int indent, const char *title, const t_topology *top, gmx_bool bShowNumbers)
+{
+ if (available(fp, top, indent, title))
+ {
+ indent = pr_title(fp, indent, title);
+ pr_indent(fp, indent);
+ fprintf(fp, "name=\"%s\"\n", *(top->name));
+ pr_atoms(fp, indent, "atoms", &(top->atoms), bShowNumbers);
+ pr_atomtypes(fp, indent, "atomtypes", &(top->atomtypes), bShowNumbers);
+ pr_block(fp, indent, "cgs", &top->cgs, bShowNumbers);
+ pr_block(fp, indent, "mols", &top->mols, bShowNumbers);
+ 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);
+ }
+}
#ifndef GMX_TOPOLOGY_TOPOLOGY_H
#define GMX_TOPOLOGY_TOPOLOGY_H
+#include <cstdio>
+
#include "gromacs/math/vectypes.h"
#include "gromacs/topology/atoms.h"
#include "gromacs/topology/block.h"
t_atoms *mtop2atoms(gmx_mtop_t *mtop);
/* generate a t_atoms struct for the system from gmx_mtop_t */
+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);
+
#ifdef __cplusplus
}
#endif