void thanx(FILE *fp)
{
  char cq[1024];
  int  cqnum;

  /* protect the audience from suggestive discussions */
  cool_quote(cq,1023,&cqnum);
  
  if (be_cool()) 
    fprintf(fp,"\ngcq#%d: %s\n\n",cqnum,cq);
  else
    fprintf(fp,"\n%s\n\n",cq);
}
Example #2
0
void gmx_thanx(FILE *fp)
{
    char cq[1024];
    int  cqnum = -1;

    /* protect the audience from suggestive discussions */
    cool_quote(cq, 1023, &cqnum);

    if (cqnum >= 0)
    {
        fprintf(fp, "\ngcq#%d: %s\n\n", cqnum, cq);
    }
    else
    {
        fprintf(fp, "\n%s\n\n", cq);
    }
}
Example #3
0
void _gmx_error(const char *key,const char *msg,const char *file,int line)
{
  char buf[10240],tmpbuf[1024];
  int  cqnum;

  /* protect the audience from suggestive discussions */
  char *lines = "-------------------------------------------------------";
  
  cool_quote(tmpbuf,1023,&cqnum);
  sprintf(buf,"\n%s\nProgram %s, %s\n"
	  "Source code file: %s, line: %d\n\n"
	  "%s:\n%s\n%s\n\n%s\n",
	  lines,ShortProgram(),GromacsVersion(),file,line,
	  gmx_strerror(key),msg ? msg : warn_buf,lines,tmpbuf);
  
  gmx_error_handler(buf);
}
Example #4
0
void _gmx_error(const char *key,const char *msg,const char *file,int line)
{
  char buf[10240],tmpbuf[1024];
  int  cqnum;

  /* protect the audience from suggestive discussions */
  const char *lines = "-------------------------------------------------------";
  
  cool_quote(tmpbuf,1023,&cqnum);
  sprintf(buf,"\n%s\nProgram %s, %s\n"
	  "Source code file: %s, line: %d\n\n"
	  "%s:\n%s\nFor more information and tips for trouble shooting please check the GROMACS Wiki at\n"
	  "http://wiki.gromacs.org/index.php/Errors\n%s\n\n%s\n",
	  lines,ShortProgram(),GromacsVersion(),file,line,
	  gmx_strerror(key),msg ? msg : warn_buf,lines,tmpbuf);
  
  gmx_error_handler(buf);
}
Example #5
0
void set_file(t_x11 *x11,t_manager *man,char *trajectory,char *status)
{
  gmx_atomprop_t aps;
  char         buf[256],quote[256];
  t_tpxheader  sh;
  t_atoms      *at;
  bool         *bB;
  int          i,idum;
  real         rdum;

  read_tpxheader(status,&sh,TRUE,NULL,NULL);
  snew(man->ix,sh.natoms);
  snew(man->zz,sh.natoms);
  snew(man->col,sh.natoms);
  snew(man->size,sh.natoms);
  snew(man->vdw,sh.natoms);
  snew(man->bLabel,sh.natoms);
  snew(man->bVis,sh.natoms);
  for(i=0; (i<sh.natoms); i++)
    man->bVis[i]=FALSE;

  man->bPbc=FALSE;

  snew(man->szLab,sh.natoms);
  snew(man->bHydro,sh.natoms);
  snew(bB,sh.natoms);
  read_tpx_top(status,&(man->step),&(man->time),&rdum,NULL,man->box,
	       &man->natom,NULL,NULL,NULL,&man->top);
  
  man->natom=
    read_first_x(&man->status,trajectory,&(man->time),&(man->x),man->box);
  man->trajfile=strdup(trajectory);
  if (man->natom > man->top.atoms.nr)
    gmx_fatal(FARGS,"Topology %s (%d atoms) and trajectory %s (%d atoms) "
		"do not match",status,man->top.atoms.nr,
		trajectory,man->natom);
 
  cool_quote(quote,255,NULL);
  sprintf(buf,"%s: %s",*man->top.name,quote);
  man->title.text = strdup(buf);
  man->view       = init_view(man->box);
  at  = &(man->top.atoms);
  aps = gmx_atomprop_init();
  for(i=0; (i<man->natom); i++) {
    char *aname=*(at->atomname[i]);
    int  resnr=at->atom[i].resnr;

    man->col[i]=Type2Color(aname);
    snew(man->szLab[i],20);
    sprintf(man->szLab[i],"%s%d, %s",*(at->resname[resnr]),resnr+1,aname);
    man->bHydro[i]=(toupper(aname[0])=='H');
    if ( man->bHydro[i] )
      man->vdw[i]=0;
    else if (!gmx_atomprop_query(aps,epropVDW,
				 *(at->resname[resnr]),aname,
				 &(man->vdw[i])))
      man->vdw[i] = 0;
  }
  gmx_atomprop_destroy(aps);
  add_bpl(man,&(man->top.idef),bB);
  for(i=0; (i<man->natom); i++)
    if (!bB[i]) 
      add_object(man,eOSingle,(atom_id) i,0);
  sfree(bB);

  ExposeWin(x11->disp,man->molw->wd.self);
}
void set_file(t_x11 *x11, t_manager *man, const char *trajectory,
              const char *status)
{
    gmx_atomprop_t    aps;
    char              buf[256], quote[256];
    t_tpxheader       sh;
    t_atoms          *at;
    bool             *bB;
    int               i;

    read_tpxheader(status, &sh, true, NULL, NULL);
    snew(man->ix, sh.natoms);
    snew(man->zz, sh.natoms);
    snew(man->col, sh.natoms);
    snew(man->size, sh.natoms);
    snew(man->vdw, sh.natoms);
    snew(man->bLabel, sh.natoms);
    snew(man->bVis, sh.natoms);
    for (i = 0; (i < sh.natoms); i++)
    {
        man->bVis[i] = false;
    }

    man->bPbc = false;

    snew(man->szLab, sh.natoms);
    snew(man->bHydro, sh.natoms);
    snew(bB, sh.natoms);
    read_tpx_top(status, NULL, man->box, &man->natom, NULL, NULL, NULL, &man->top);
    man->gpbc = gmx_rmpbc_init(&man->top.idef, -1, man->natom);

    man->natom =
        read_first_x(man->oenv, &man->status, trajectory, &(man->time), &(man->x),
                     man->box);
    man->trajfile = strdup(trajectory);
    if (man->natom > man->top.atoms.nr)
    {
        gmx_fatal(FARGS, "Topology %s (%d atoms) and trajectory %s (%d atoms) "
                  "do not match", status, man->top.atoms.nr,
                  trajectory, man->natom);
    }

    cool_quote(quote, 255, NULL);
    sprintf(buf, "%s: %s", *man->top.name, quote);
    man->title.text = strdup(buf);
    man->view       = init_view(man->box);
    at              = &(man->top.atoms);
    aps             = gmx_atomprop_init();
    for (i = 0; (i < man->natom); i++)
    {
        char      *aname = *(at->atomname[i]);
        t_resinfo *ri    = &at->resinfo[at->atom[i].resind];

        man->col[i] = Type2Color(aname);
        snew(man->szLab[i], 20);
        if (ri->ic != ' ')
        {
            sprintf(man->szLab[i], "%s%d%c, %s", *ri->name, ri->nr, ri->ic, aname);
        }
        else
        {
            sprintf(man->szLab[i], "%s%d, %s", *ri->name, ri->nr, aname);
        }
        man->bHydro[i] = (toupper(aname[0]) == 'H');
        if (man->bHydro[i])
        {
            man->vdw[i] = 0;
        }
        else if (!gmx_atomprop_query(aps, epropVDW, *ri->name, aname, &(man->vdw[i])))
        {
            man->vdw[i] = 0;
        }
    }
    gmx_atomprop_destroy(aps);
    add_bpl(man, &(man->top.idef), bB);
    for (i = 0; (i < man->natom); i++)
    {
        if (!bB[i])
        {
            add_object(man, eOSingle, (atom_id) i, 0);
        }
    }
    sfree(bB);

    ExposeWin(x11->disp, man->molw->wd.self);
}