Exemplo n.º 1
0
int main(int argc,char *argv[])
{
  static char *desc[] = {
    "gmxdump reads a run input file ([TT].tpa[tt]/[TT].tpr[tt]/[TT].tpb[tt]),",
    "a trajectory ([TT].trj[tt]/[TT].trr[tt]/[TT].xtc[tt]), an energy",
    "file ([TT].ene[tt]/[TT].edr[tt]), or a checkpoint file ([TT].cpt[tt])",
    "and prints that to standard output in a readable format.",
    "This program is essential for checking your run input file in case of",
    "problems.[PAR]",
    "The program can also preprocess a topology to help finding problems.",
    "Note that currently setting GMXLIB is the only way to customize",
    "directories used for searching include files.",
  };
  t_filenm fnm[] = {
    { efTPX, "-s", NULL, ffOPTRD },
    { efTRX, "-f", NULL, ffOPTRD },
    { efENX, "-e", NULL, ffOPTRD },
    { efCPT, NULL, NULL, ffOPTRD },
    { efTOP, "-p", NULL, ffOPTRD },
    { efMTX, "-mtx", "hessian", ffOPTRD }, 
    { efMDP, "-om", NULL, ffOPTWR }
  };
#define NFILE asize(fnm)

  /* Command line options */
  static bool bXVG=FALSE;
  static bool bShowNumbers=TRUE;
  static bool bSysTop=FALSE;
  t_pargs pa[] = {
    { "-xvg", FALSE, etBOOL, {&bXVG}, "HIDDENXVG layout for xtc" },
    { "-nr",FALSE, etBOOL, {&bShowNumbers},"Show index numbers in output (leaving them out makes comparison easier, but creates a useless topology)" },
    { "-sys", FALSE, etBOOL, {&bSysTop}, "List the atoms and bonded interactions for the whole system instead of for each molecule type" }
  };
  
  CopyRight(stderr,argv[0]);
  parse_common_args(&argc,argv,0,NFILE,fnm,asize(pa),pa,
		    asize(desc),desc,0,NULL);


  if (ftp2bSet(efTPX,NFILE,fnm))
    list_tpx(ftp2fn(efTPX,NFILE,fnm),bShowNumbers,
	     ftp2fn_null(efMDP,NFILE,fnm),bSysTop);
  else if (ftp2bSet(efTRX,NFILE,fnm)) 
    list_trx(ftp2fn(efTRX,NFILE,fnm),bXVG);
  else if (ftp2bSet(efENX,NFILE,fnm))
    list_ene(ftp2fn(efENX,NFILE,fnm));
  else if (ftp2bSet(efCPT,NFILE,fnm))
    list_checkpoint(ftp2fn(efCPT,NFILE,fnm),stdout);
  else if (ftp2bSet(efTOP,NFILE,fnm))
    list_top(ftp2fn(efTOP,NFILE,fnm));
  else if (ftp2bSet(efMTX,NFILE,fnm))
    list_mtx(ftp2fn(efMTX,NFILE,fnm));
    
  thanx(stderr);

  return 0;
}
Exemplo n.º 2
0
int gmx_dump(int argc, char *argv[])
{
    const char *desc[] = {
        "[THISMODULE] reads a run input file ([REF].tpr[ref]),",
        "a trajectory ([REF].trr[ref]/[REF].xtc[ref]/[TT]/tng[tt]), an energy",
        "file ([REF].edr[ref]) or a checkpoint file ([REF].cpt[ref])",
        "and prints that to standard output in a readable format.",
        "This program is essential for checking your run input file in case of",
        "problems.[PAR]",
        "The program can also preprocess a topology to help finding problems.",
        "Note that currently setting [TT]GMXLIB[tt] is the only way to customize",
        "directories used for searching include files.",
    };
    const char *bugs[] = {
        "Position restraint output from -sys -s is broken"
    };
    t_filenm    fnm[] = {
        { efTPR, "-s", NULL, ffOPTRD },
        { efTRX, "-f", NULL, ffOPTRD },
        { efEDR, "-e", NULL, ffOPTRD },
        { efCPT, NULL, NULL, ffOPTRD },
        { efTOP, "-p", NULL, ffOPTRD },
        { efMTX, "-mtx", "hessian", ffOPTRD },
        { efMDP, "-om", NULL, ffOPTWR }
    };
#define NFILE asize(fnm)

    output_env_t    oenv;
    /* Command line options */
    static gmx_bool bShowNumbers = TRUE;
    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)" },
        { "-sys", FALSE, etBOOL, {&bSysTop}, "List the atoms and bonded interactions for the whole system instead of for each molecule type" }
    };

    if (!parse_common_args(&argc, argv, 0, NFILE, fnm, asize(pa), pa,
                           asize(desc), desc, asize(bugs), bugs, &oenv))
    {
        return 0;
    }


    if (ftp2bSet(efTPR, NFILE, fnm))
    {
        list_tpx(ftp2fn(efTPR, NFILE, fnm), bShowNumbers,
                 ftp2fn_null(efMDP, NFILE, fnm), bSysTop);
    }
    else if (ftp2bSet(efTRX, NFILE, fnm))
    {
        list_trx(ftp2fn(efTRX, NFILE, fnm));
    }
    else if (ftp2bSet(efEDR, NFILE, fnm))
    {
        list_ene(ftp2fn(efEDR, NFILE, fnm));
    }
    else if (ftp2bSet(efCPT, NFILE, fnm))
    {
        list_checkpoint(ftp2fn(efCPT, NFILE, fnm), stdout);
    }
    else if (ftp2bSet(efTOP, NFILE, fnm))
    {
        list_top(ftp2fn(efTOP, NFILE, fnm));
    }
    else if (ftp2bSet(efMTX, NFILE, fnm))
    {
        list_mtx(ftp2fn(efMTX, NFILE, fnm));
    }

    return 0;
}