Пример #1
0
void pr_inputrec(FILE *fp,int indent,const char *title,t_inputrec *ir,
                 gmx_bool bMDPformat)
{
  const char *infbuf="inf";
  int  i;
  
  if (available(fp,ir,indent,title)) {
    if (!bMDPformat)
      indent=pr_title(fp,indent,title);
    PS("integrator",EI(ir->eI));
    PSTEP("nsteps",ir->nsteps);
    PSTEP("init-step",ir->init_step);
    PS("ns-type",ENS(ir->ns_type));
    PI("nstlist",ir->nstlist);
    PI("ndelta",ir->ndelta);
    PI("nstcomm",ir->nstcomm);
    PS("comm-mode",ECOM(ir->comm_mode));
    PI("nstlog",ir->nstlog);
    PI("nstxout",ir->nstxout);
    PI("nstvout",ir->nstvout);
    PI("nstfout",ir->nstfout);
    PI("nstcalcenergy",ir->nstcalcenergy);
    PI("nstenergy",ir->nstenergy);
    PI("nstxtcout",ir->nstxtcout);
    PR("init-t",ir->init_t);
    PR("delta-t",ir->delta_t);
    
    PR("xtcprec",ir->xtcprec);
    PI("nkx",ir->nkx);
    PI("nky",ir->nky);
    PI("nkz",ir->nkz);
    PI("pme-order",ir->pme_order);
    PR("ewald-rtol",ir->ewald_rtol);
    PR("ewald-geometry",ir->ewald_geometry);
    PR("epsilon-surface",ir->epsilon_surface);
    PS("optimize-fft",BOOL(ir->bOptFFT));
    PS("ePBC",EPBC(ir->ePBC));
    PS("bPeriodicMols",BOOL(ir->bPeriodicMols));
    PS("bContinuation",BOOL(ir->bContinuation));
    PS("bShakeSOR",BOOL(ir->bShakeSOR));
    PS("etc",ETCOUPLTYPE(ir->etc));
    PI("nsttcouple",ir->nsttcouple);
    PS("epc",EPCOUPLTYPE(ir->epc));
    PS("epctype",EPCOUPLTYPETYPE(ir->epct));
    PI("nstpcouple",ir->nstpcouple);
    PR("tau-p",ir->tau_p);
    pr_matrix(fp,indent,"ref-p",ir->ref_p,bMDPformat);
    pr_matrix(fp,indent,"compress",ir->compress,bMDPformat);
    PS("refcoord-scaling",EREFSCALINGTYPE(ir->refcoord_scaling));
    if (bMDPformat)
      fprintf(fp,"posres-com  = %g %g %g\n",ir->posres_com[XX],
	      ir->posres_com[YY],ir->posres_com[ZZ]);
    else
      pr_rvec(fp,indent,"posres-com",ir->posres_com,DIM,TRUE);
    if (bMDPformat)
      fprintf(fp,"posres-comB = %g %g %g\n",ir->posres_comB[XX],
	      ir->posres_comB[YY],ir->posres_comB[ZZ]);
    else
      pr_rvec(fp,indent,"posres-comB",ir->posres_comB,DIM,TRUE);
    PI("andersen-seed",ir->andersen_seed);
    PR("rlist",ir->rlist);
    PR("rlistlong",ir->rlistlong);
    PR("rtpi",ir->rtpi);
    PS("coulombtype",EELTYPE(ir->coulombtype));
    PR("rcoulomb-switch",ir->rcoulomb_switch);
    PR("rcoulomb",ir->rcoulomb);
    PS("vdwtype",EVDWTYPE(ir->vdwtype));
    PR("rvdw-switch",ir->rvdw_switch);
    PR("rvdw",ir->rvdw);
    if (ir->epsilon_r != 0)
      PR("epsilon-r",ir->epsilon_r);
    else
      PS("epsilon-r",infbuf);
    if (ir->epsilon_rf != 0)
      PR("epsilon-rf",ir->epsilon_rf);
    else
      PS("epsilon-rf",infbuf);
    PR("tabext",ir->tabext);
    PS("implicit-solvent",EIMPLICITSOL(ir->implicit_solvent));
    PS("gb-algorithm",EGBALGORITHM(ir->gb_algorithm));
    PR("gb-epsilon-solvent",ir->gb_epsilon_solvent);
    PI("nstgbradii",ir->nstgbradii);
    PR("rgbradii",ir->rgbradii);
    PR("gb-saltconc",ir->gb_saltconc);
    PR("gb-obc-alpha",ir->gb_obc_alpha);
    PR("gb-obc-beta",ir->gb_obc_beta);
    PR("gb-obc-gamma",ir->gb_obc_gamma);
    PR("gb-dielectric-offset",ir->gb_dielectric_offset);
    PS("sa-algorithm",ESAALGORITHM(ir->gb_algorithm));
    PR("sa-surface-tension",ir->sa_surface_tension);
	  
    PS("DispCorr",EDISPCORR(ir->eDispCorr));
    PS("free-energy",EFEPTYPE(ir->efep));
    PR("init-lambda",ir->init_lambda);
    PR("delta-lambda",ir->delta_lambda);
    if (!bMDPformat)
    {
        PI("n-foreign-lambda",ir->n_flambda);
    }
    if (ir->n_flambda > 0)
    {
        pr_indent(fp,indent);
        fprintf(fp,"foreign-lambda%s",bMDPformat ? " = " : ":");
        for(i=0; i<ir->n_flambda; i++)
        {
            fprintf(fp,"  %10g",ir->flambda[i]);
        }
        fprintf(fp,"\n");
    }
    PR("sc-alpha",ir->sc_alpha);
    PI("sc-power",ir->sc_power);
    PR("sc-sigma",ir->sc_sigma);
    PR("sc-sigma-min",ir->sc_sigma_min);
    PI("nstdhdl", ir->nstdhdl);
    PS("separate-dhdl-file", SEPDHDLFILETYPE(ir->separate_dhdl_file));
    PS("dhdl-derivatives", DHDLDERIVATIVESTYPE(ir->dhdl_derivatives));
    PI("dh-hist-size", ir->dh_hist_size);
    PD("dh-hist-spacing", ir->dh_hist_spacing);

    PI("nwall",ir->nwall);
    PS("wall-type",EWALLTYPE(ir->wall_type));
    PI("wall-atomtype[0]",ir->wall_atomtype[0]);
    PI("wall-atomtype[1]",ir->wall_atomtype[1]);
    PR("wall-density[0]",ir->wall_density[0]);
    PR("wall-density[1]",ir->wall_density[1]);
    PR("wall-ewald-zfac",ir->wall_ewald_zfac);

    PS("pull",EPULLTYPE(ir->ePull));
    if (ir->ePull != epullNO)
      pr_pull(fp,indent,ir->pull);
    
    PS("rotation",BOOL(ir->bRot));
    if (ir->bRot)
      pr_rot(fp,indent,ir->rot);

    PS("disre",EDISRETYPE(ir->eDisre));
    PS("disre-weighting",EDISREWEIGHTING(ir->eDisreWeighting));
    PS("disre-mixed",BOOL(ir->bDisreMixed));
    PR("dr-fc",ir->dr_fc);
    PR("dr-tau",ir->dr_tau);
    PR("nstdisreout",ir->nstdisreout);
    PR("orires-fc",ir->orires_fc);
    PR("orires-tau",ir->orires_tau);
    PR("nstorireout",ir->nstorireout);

    PR("dihre-fc",ir->dihre_fc);
    
    PR("em-stepsize",ir->em_stepsize);
    PR("em-tol",ir->em_tol);
    PI("niter",ir->niter);
    PR("fc-stepsize",ir->fc_stepsize);
    PI("nstcgsteep",ir->nstcgsteep);
    PI("nbfgscorr",ir->nbfgscorr);

    PS("ConstAlg",ECONSTRTYPE(ir->eConstrAlg));
    PR("shake-tol",ir->shake_tol);
    PI("lincs-order",ir->nProjOrder);
    PR("lincs-warnangle",ir->LincsWarnAngle);
    PI("lincs-iter",ir->nLincsIter);
    PR("bd-fric",ir->bd_fric);
    PI("ld-seed",ir->ld_seed);
    PR("cos-accel",ir->cos_accel);
    pr_matrix(fp,indent,"deform",ir->deform,bMDPformat);

    PS("adress",BOOL(ir->bAdress));
    if (ir->bAdress){
        PS("adress_type",EADRESSTYPE(ir->adress->type));
        PR("adress_const_wf",ir->adress->const_wf);
        PR("adress_ex_width",ir->adress->ex_width);
        PR("adress_hy_width",ir->adress->hy_width);
        PS("adress_interface_correction",EADRESSICTYPE(ir->adress->icor));
        PS("adress_site",EADRESSSITETYPE(ir->adress->site));
        PR("adress_ex_force_cap",ir->adress->ex_forcecap);
        PS("adress_do_hybridpairs", BOOL(ir->adress->do_hybridpairs));

        pr_rvec(fp,indent,"adress_reference_coords",ir->adress->refs,DIM,TRUE);
    }
    PI("userint1",ir->userint1);
    PI("userint2",ir->userint2);
    PI("userint3",ir->userint3);
    PI("userint4",ir->userint4);
    PR("userreal1",ir->userreal1);
    PR("userreal2",ir->userreal2);
    PR("userreal3",ir->userreal3);
    PR("userreal4",ir->userreal4);
    pr_grp_opts(fp,indent,"grpopts",&(ir->opts),bMDPformat);
    pr_cosine(fp,indent,"efield-x",&(ir->ex[XX]),bMDPformat);
    pr_cosine(fp,indent,"efield-xt",&(ir->et[XX]),bMDPformat);
    pr_cosine(fp,indent,"efield-y",&(ir->ex[YY]),bMDPformat);
    pr_cosine(fp,indent,"efield-yt",&(ir->et[YY]),bMDPformat);
    pr_cosine(fp,indent,"efield-z",&(ir->ex[ZZ]),bMDPformat);
    pr_cosine(fp,indent,"efield-zt",&(ir->et[ZZ]),bMDPformat);
    PS("bQMMM",BOOL(ir->bQMMM));
    PI("QMconstraints",ir->QMconstraints);
    PI("QMMMscheme",ir->QMMMscheme);
    PR("scalefactor",ir->scalefactor);
    pr_qm_opts(fp,indent,"qm-opts",&(ir->opts));
  }
}
Пример #2
0
void pr_inputrec(FILE *fp,int indent,char *title,t_inputrec *ir)
{
  char *infbuf="inf";
  
  if (available(fp,ir,title)) {
    indent=pr_title(fp,indent,title);
#define PS(t,s) pr_str(fp,indent,t,s)
#define PI(t,s) pr_int(fp,indent,t,s)
#define PR(t,s) pr_real(fp,indent,t,s)
    PS("integrator",EI(ir->eI));
    PI("nsteps",ir->nsteps);
    PS("ns_type",ENS(ir->ns_type));
    PI("nstlist",ir->nstlist);
    PI("ndelta",ir->ndelta);
    PS("bDomDecomp",BOOL(ir->bDomDecomp));
    PI("decomp_dir",ir->decomp_dir);
    PI("nstcomm",ir->nstcomm);
    PI("nstlog",ir->nstlog);
    PI("nstxout",ir->nstxout);
    PI("nstvout",ir->nstvout);
    PI("nstfout",ir->nstfout);
    PI("nstenergy",ir->nstenergy);
    PI("nstxtcout",ir->nstxtcout);
    PR("init_t",ir->init_t);
    PR("delta_t",ir->delta_t);
    PR("xtcprec",ir->xtcprec);
    PI("nkx",ir->nkx);
    PI("nky",ir->nky);
    PI("nkz",ir->nkz);
    PI("pme_order",ir->pme_order);
    PR("ewald_rtol",ir->ewald_rtol);
    PR("ewald_geometry",ir->ewald_geometry);
    PR("epsilon_surface",ir->epsilon_surface);
    PS("optimize_fft",BOOL(ir->bOptFFT));
    PS("ePBC",EPBC(ir->ePBC));
    PS("bUncStart",BOOL(ir->bUncStart));
    PS("bShakeSOR",BOOL(ir->bShakeSOR));
    PS("etc",ETCOUPLTYPE(ir->etc));
    PS("epc",EPCOUPLTYPE(ir->epc));
    PS("epctype",EPCOUPLTYPETYPE(ir->epct));
    PR("tau_p",ir->tau_p);
    pr_rvecs(fp,indent,"ref_p",ir->ref_p,DIM);
    pr_rvecs(fp,indent,"compress",ir->compress,DIM);
    PS("bSimAnn",BOOL(ir->bSimAnn)); 
    PR("zero_temp_time",ir->zero_temp_time); 
    PR("rlist",ir->rlist);
    PS("coulombtype",EELTYPE(ir->coulombtype));
    PR("rcoulomb_switch",ir->rcoulomb_switch);
    PR("rcoulomb",ir->rcoulomb);
    PS("vdwtype",EVDWTYPE(ir->vdwtype));
    PR("rvdw_switch",ir->rvdw_switch);
    PR("rvdw",ir->rvdw);
    if (fabs(ir->epsilon_r) > GMX_REAL_MIN)
      PR("epsilon_r",ir->epsilon_r);
    else
      PS("epsilon_r",infbuf);
    PS("DispCorr",EDISPCORR(ir->eDispCorr));
    PR("fudgeQQ",ir->fudgeQQ);
    PS("free_energy",EFEPTYPE(ir->efep));
    PR("init_lambda",ir->init_lambda);
    PR("sc_alpha",ir->sc_alpha);
    PR("sc_sigma",ir->sc_sigma);
    PR("delta_lambda",ir->delta_lambda);
    PS("disre_weighting",EDISREWEIGHTING(ir->eDisreWeighting));
    PS("disre_mixed",BOOL(ir->bDisreMixed));
    PR("dr_fc",ir->dr_fc);
    PR("dr_tau",ir->dr_tau);
    PR("nstdisreout",ir->nstdisreout);
    PR("orires_fc",ir->orires_fc);
    PR("orires_tau",ir->orires_tau);
    PR("nstorireout",ir->nstorireout);
    PR("em_stepsize",ir->em_stepsize);
    PR("em_tol",ir->em_tol);
    PI("niter",ir->niter);
    PR("fc_stepsize",ir->fc_stepsize);
    PI("nstcgsteep",ir->nstcgsteep);
    PS("ConstAlg",ESHAKETYPE(ir->eConstrAlg));
    PR("shake_tol",ir->shake_tol);
    PI("lincs_order",ir->nProjOrder);
    PR("lincs_warnangle",ir->LincsWarnAngle);
    PR("bd_temp",ir->bd_temp);
    PR("bd_fric",ir->bd_fric);
    PI("ld_seed",ir->ld_seed);
    PR("cos_accel",ir->cos_accel);
    PI("userint1",ir->userint1);
    PI("userint2",ir->userint2);
    PI("userint3",ir->userint3);
    PI("userint4",ir->userint4);
    PR("userreal1",ir->userreal1);
    PR("userreal2",ir->userreal2);
    PR("userreal3",ir->userreal3);
    PR("userreal4",ir->userreal4);
#undef PS
#undef PR
#undef PI
    pr_grp_opts(fp,indent,"grpopts",&(ir->opts));
    pr_cosine(fp,indent,"efield-x",&(ir->ex[XX]));
    pr_cosine(fp,indent,"efield-xt",&(ir->et[XX]));
    pr_cosine(fp,indent,"efield-y",&(ir->ex[YY]));
    pr_cosine(fp,indent,"efield-yt",&(ir->et[YY]));
    pr_cosine(fp,indent,"efield-z",&(ir->ex[ZZ]));
    pr_cosine(fp,indent,"efield-zt",&(ir->et[ZZ]));
  }
}
Пример #3
0
void parrinellorahman_pcoupl(FILE *fplog,gmx_step_t step,
			     t_inputrec *ir,real dt,tensor pres,
			     tensor box,tensor box_rel,tensor boxv,
			     tensor M,matrix mu,bool bFirstStep)
{
  /* This doesn't do any coordinate updating. It just
   * integrates the box vector equations from the calculated
   * acceleration due to pressure difference. We also compute
   * the tensor M which is used in update to couple the particle
   * coordinates to the box vectors.
   *
   * In Nose and Klein (Mol.Phys 50 (1983) no 5., p 1055) this is
   * given as
   *            -1    .           .     -1
   * M_nk = (h')   * (h' * h + h' h) * h
   *
   * with the dots denoting time derivatives and h is the transformation from
   * the scaled frame to the real frame, i.e. the TRANSPOSE of the box. 
   * This also goes for the pressure and M tensors - they are transposed relative
   * to ours. Our equation thus becomes:
   *
   *                  -1       .    .           -1
   * M_gmx = M_nk' = b  * (b * b' + b * b') * b'
   * 
   * where b is the gromacs box matrix.                       
   * Our box accelerations are given by
   *   ..                                    ..
   *   b = vol/W inv(box') * (P-ref_P)     (=h')
   */
  
  int    d,n;
  tensor winv;
  real   vol=box[XX][XX]*box[YY][YY]*box[ZZ][ZZ];
  real   atot,arel,change,maxchange,xy_pressure;
  tensor invbox,pdiff,t1,t2;

  real maxl;

  m_inv_ur0(box,invbox);

  if (!bFirstStep) {
    /* Note that PRESFAC does not occur here.
     * The pressure and compressibility always occur as a product,
     * therefore the pressure unit drops out.
     */
    maxl=max(box[XX][XX],box[YY][YY]);
    maxl=max(maxl,box[ZZ][ZZ]);
    for(d=0;d<DIM;d++)
      for(n=0;n<DIM;n++)
	winv[d][n]=
	  (4*M_PI*M_PI*ir->compress[d][n])/(3*ir->tau_p*ir->tau_p*maxl);
    
    m_sub(pres,ir->ref_p,pdiff);
    
    if(ir->epct==epctSURFACETENSION) {
      /* Unlike Berendsen coupling it might not be trivial to include a z
       * pressure correction here? On the other hand we don't scale the
       * box momentarily, but change accelerations, so it might not be crucial.
       */
      xy_pressure=0.5*(pres[XX][XX]+pres[YY][YY]);
      for(d=0;d<ZZ;d++)
	pdiff[d][d]=(xy_pressure-(pres[ZZ][ZZ]-ir->ref_p[d][d]/box[d][d]));
    }
    
    tmmul(invbox,pdiff,t1);
    /* Move the off-diagonal elements of the 'force' to one side to ensure
     * that we obey the box constraints.
     */
    for(d=0;d<DIM;d++) {
      for(n=0;n<d;n++) {
	t1[d][n] += t1[n][d];
	t1[n][d] = 0;
      }
    }
    
    switch (ir->epct) {
    case epctANISOTROPIC:
      for(d=0;d<DIM;d++) 
	for(n=0;n<=d;n++)
	  t1[d][n] *= winv[d][n]*vol;
      break;
    case epctISOTROPIC:
      /* calculate total volume acceleration */
      atot=box[XX][XX]*box[YY][YY]*t1[ZZ][ZZ]+
	box[XX][XX]*t1[YY][YY]*box[ZZ][ZZ]+
	t1[XX][XX]*box[YY][YY]*box[ZZ][ZZ];
      arel=atot/(3*vol);
      /* set all RELATIVE box accelerations equal, and maintain total V
       * change speed */
      for(d=0;d<DIM;d++)
	for(n=0;n<=d;n++)
	  t1[d][n] = winv[0][0]*vol*arel*box[d][n];    
      break;
    case epctSEMIISOTROPIC:
    case epctSURFACETENSION:
      /* Note the correction to pdiff above for surftens. coupling  */
      
      /* calculate total XY volume acceleration */
      atot=box[XX][XX]*t1[YY][YY]+t1[XX][XX]*box[YY][YY];
      arel=atot/(2*box[XX][XX]*box[YY][YY]);
      /* set RELATIVE XY box accelerations equal, and maintain total V
       * change speed. Dont change the third box vector accelerations */
      for(d=0;d<ZZ;d++)
	for(n=0;n<=d;n++)
	  t1[d][n] = winv[d][n]*vol*arel*box[d][n];
      for(n=0;n<DIM;n++)
	t1[ZZ][n] *= winv[d][n]*vol;
      break;
    default:
      gmx_fatal(FARGS,"Parrinello-Rahman pressure coupling type %s "
		  "not supported yet\n",EPCOUPLTYPETYPE(ir->epct));
      break;
    }
    
    maxchange=0;
    for(d=0;d<DIM;d++)
      for(n=0;n<=d;n++) {
	boxv[d][n] += dt*t1[d][n];
	/* We do NOT update the box vectors themselves here, since
	 * we need them for shifting later. It is instead done last
	 * in the update() routine.
	 */
	
	/* Calculate the change relative to diagonal elements -
	 * since it's perfectly ok for the off-diagonal ones to
	 * be zero it doesn't make sense to check the change relative
	 * to its current size.
	 */
	change=fabs(dt*boxv[d][n]/box[d][d]);
	if(change>maxchange)
	  maxchange=change;
      }
    
    if (maxchange > 0.01 && fplog) {
      char buf[22];
      fprintf(fplog,"\nStep %s  Warning: Pressure scaling more than 1%%.\n",
	      gmx_step_str(step,buf));
    }
  }
  
  preserve_box_shape(ir,box_rel,boxv);

  mtmul(boxv,box,t1);       /* t1=boxv * b' */
  mmul(invbox,t1,t2);
  mtmul(t2,invbox,M);

  /* Determine the scaling matrix mu for the coordinates */
  for(d=0;d<DIM;d++)
    for(n=0;n<=d;n++)
      t1[d][n] = box[d][n] + dt*boxv[d][n];
  preserve_box_shape(ir,box_rel,t1);
  /* t1 is the box at t+dt, determine mu as the relative change */
  mmul_ur0(invbox,t1,mu);
}
Пример #4
0
void berendsen_pcoupl(FILE *fplog,gmx_step_t step,
		      t_inputrec *ir,real dt,tensor pres,matrix box,
		      matrix mu)
{
  int    d,n;
  real   scalar_pressure, xy_pressure, p_corr_z;
  char   *ptr,buf[STRLEN];

  /*
   *  Calculate the scaling matrix mu
   */
  scalar_pressure=0;
  xy_pressure=0;
  for(d=0; d<DIM; d++) {
    scalar_pressure += pres[d][d]/DIM;
    if (d != ZZ)
      xy_pressure += pres[d][d]/(DIM-1);
  }
  /* Pressure is now in bar, everywhere. */
#define factor(d,m) (ir->compress[d][m]*dt/ir->tau_p)
  
  /* mu has been changed from pow(1+...,1/3) to 1+.../3, since this is
   * necessary for triclinic scaling
   */
  clear_mat(mu);
  switch (ir->epct) {
  case epctISOTROPIC:
    for(d=0; d<DIM; d++)
      mu[d][d] = 1.0 - factor(d,d)*(ir->ref_p[d][d] - scalar_pressure)/DIM;
    break;
  case epctSEMIISOTROPIC:
    for(d=0; d<ZZ; d++)
      mu[d][d] = 1.0 - factor(d,d)*(ir->ref_p[d][d]-xy_pressure)/DIM;
    mu[ZZ][ZZ] = 
      1.0 - factor(ZZ,ZZ)*(ir->ref_p[ZZ][ZZ] - pres[ZZ][ZZ])/DIM;
    break;
  case epctANISOTROPIC:
    for(d=0; d<DIM; d++)
      for(n=0; n<DIM; n++)
	mu[d][n] = (d==n ? 1.0 : 0.0) 
	  -factor(d,n)*(ir->ref_p[d][n] - pres[d][n])/DIM;
    break;
  case epctSURFACETENSION:
    /* ir->ref_p[0/1] is the reference surface-tension times *
     * the number of surfaces                                */
    if (ir->compress[ZZ][ZZ])
      p_corr_z = dt/ir->tau_p*(ir->ref_p[ZZ][ZZ] - pres[ZZ][ZZ]);
    else
      /* when the compressibity is zero, set the pressure correction   *
       * in the z-direction to zero to get the correct surface tension */
      p_corr_z = 0;
    mu[ZZ][ZZ] = 1.0 - ir->compress[ZZ][ZZ]*p_corr_z;
    for(d=0; d<DIM-1; d++)
      mu[d][d] = 1.0 + factor(d,d)*(ir->ref_p[d][d]/(mu[ZZ][ZZ]*box[ZZ][ZZ])
				    - (pres[ZZ][ZZ]+p_corr_z - xy_pressure))/(DIM-1);
    break;
  default:
    gmx_fatal(FARGS,"Berendsen pressure coupling type %s not supported yet\n",
		EPCOUPLTYPETYPE(ir->epct));
    break;
  }
  /* To fullfill the orientation restrictions on triclinic boxes
   * we will set mu_yx, mu_zx and mu_zy to 0 and correct
   * the other elements of mu to first order.
   */
  mu[YY][XX] += mu[XX][YY];
  mu[ZZ][XX] += mu[XX][ZZ];
  mu[ZZ][YY] += mu[YY][ZZ];
  mu[XX][YY] = 0;
  mu[XX][ZZ] = 0;
  mu[YY][ZZ] = 0;

  if (debug) {
    pr_rvecs(debug,0,"PC: pres ",pres,3);
    pr_rvecs(debug,0,"PC: mu   ",mu,3);
  }
  
  if (mu[XX][XX]<0.99 || mu[XX][XX]>1.01 ||
      mu[YY][YY]<0.99 || mu[YY][YY]>1.01 ||
      mu[ZZ][ZZ]<0.99 || mu[ZZ][ZZ]>1.01) {
    char buf2[22];
    sprintf(buf,"\nStep %s  Warning: pressure scaling more than 1%%, "
	    "mu: %g %g %g\n",
	    gmx_step_str(step,buf2),mu[XX][XX],mu[YY][YY],mu[ZZ][ZZ]);
    if (fplog)
      fprintf(fplog,"%s",buf);
    fprintf(stderr,"%s",buf);
  }
}
Пример #5
0
void pr_inputrec(FILE *fp,int indent,const char *title,t_inputrec *ir,
		 bool bMDPformat)

{
  char *infbuf="inf";
  
  if (available(fp,ir,indent,title)) {
    if (!bMDPformat)
      indent=pr_title(fp,indent,title);
    PS("integrator",EI(ir->eI));
    PI("nsteps",ir->nsteps);
    PI("init_step",ir->init_step);
    PS("ns_type",ENS(ir->ns_type));
    PI("nstlist",ir->nstlist);
    PI("ndelta",ir->ndelta);
    PI("nstcomm",ir->nstcomm);
    PS("comm_mode",ECOM(ir->comm_mode));
    PI("nstlog",ir->nstlog);
    PI("nstxout",ir->nstxout);
    PI("nstvout",ir->nstvout);
    PI("nstfout",ir->nstfout);
    PI("nstenergy",ir->nstenergy);
    PI("nstxtcout",ir->nstxtcout);
    PR("init_t",ir->init_t);
    PR("delta_t",ir->delta_t);
    PR("xtcprec",ir->xtcprec);
    PI("nkx",ir->nkx);
    PI("nky",ir->nky);
    PI("nkz",ir->nkz);
    PI("pme_order",ir->pme_order);
    PR("ewald_rtol",ir->ewald_rtol);
    PR("ewald_geometry",ir->ewald_geometry);
    PR("epsilon_surface",ir->epsilon_surface);
    PS("optimize_fft",BOOL(ir->bOptFFT));
    PS("ePBC",EPBC(ir->ePBC));
    PS("bPeriodicMols",BOOL(ir->bPeriodicMols));
    PS("bContinuation",BOOL(ir->bContinuation));
    PS("bShakeSOR",BOOL(ir->bShakeSOR));
    PS("etc",ETCOUPLTYPE(ir->etc));
    PS("epc",EPCOUPLTYPE(ir->epc));
    PS("epctype",EPCOUPLTYPETYPE(ir->epct));
    PR("tau_p",ir->tau_p);
    pr_matrix(fp,indent,"ref_p",ir->ref_p,bMDPformat);
    pr_matrix(fp,indent,"compress",ir->compress,bMDPformat);
    PS("refcoord_scaling",EREFSCALINGTYPE(ir->refcoord_scaling));
    if (bMDPformat)
      fprintf(fp,"posres_com  = %g %g %g\n",ir->posres_com[XX],
	      ir->posres_com[YY],ir->posres_com[ZZ]);
    else
      pr_rvec(fp,indent,"posres_com",ir->posres_com,DIM,TRUE);
    if (bMDPformat)
      fprintf(fp,"posres_comB = %g %g %g\n",ir->posres_comB[XX],
	      ir->posres_comB[YY],ir->posres_comB[ZZ]);
    else
      pr_rvec(fp,indent,"posres_comB",ir->posres_comB,DIM,TRUE);
    PI("andersen_seed",ir->andersen_seed);
    PR("rlist",ir->rlist);
    PR("rtpi",ir->rtpi);
    PS("coulombtype",EELTYPE(ir->coulombtype));
    PR("rcoulomb_switch",ir->rcoulomb_switch);
    PR("rcoulomb",ir->rcoulomb);
    PS("vdwtype",EVDWTYPE(ir->vdwtype));
    PR("rvdw_switch",ir->rvdw_switch);
    PR("rvdw",ir->rvdw);
    if (ir->epsilon_r != 0)
      PR("epsilon_r",ir->epsilon_r);
    else
      PS("epsilon_r",infbuf);
    if (ir->epsilon_rf != 0)
      PR("epsilon_rf",ir->epsilon_rf);
    else
      PS("epsilon_rf",infbuf);
    PR("tabext",ir->tabext);
    PS("implicit_solvent",EIMPLICITSOL(ir->implicit_solvent));
    PS("gb_algorithm",EGBALGORITHM(ir->gb_algorithm));
    PR("gb_epsilon_solvent",ir->gb_epsilon_solvent);
    PI("nstgbradii",ir->nstgbradii);
    PR("rgbradii",ir->rgbradii);
    PR("gb_saltconc",ir->gb_saltconc);
    PR("gb_obc_alpha",ir->gb_obc_alpha);
    PR("gb_obc_beta",ir->gb_obc_beta);
    PR("gb_obc_gamma",ir->gb_obc_gamma);
    PR("sa_surface_tension",ir->sa_surface_tension);
	  
    PS("DispCorr",EDISPCORR(ir->eDispCorr));
    PS("free_energy",EFEPTYPE(ir->efep));
    PR("init_lambda",ir->init_lambda);
    PR("sc_alpha",ir->sc_alpha);
    PI("sc_power",ir->sc_power);
    PR("sc_sigma",ir->sc_sigma);
    PR("delta_lambda",ir->delta_lambda);
    
    PI("nwall",ir->nwall);
    PS("wall_type",EWALLTYPE(ir->wall_type));
    PI("wall_atomtype[0]",ir->wall_atomtype[0]);
    PI("wall_atomtype[1]",ir->wall_atomtype[1]);
    PR("wall_density[0]",ir->wall_density[0]);
    PR("wall_density[1]",ir->wall_density[1]);
    PR("wall_ewald_zfac",ir->wall_ewald_zfac);

    PS("pull",EPULLTYPE(ir->ePull));
    if (ir->ePull != epullNO)
      pr_pull(fp,indent,ir->pull);

    PS("disre",EDISRETYPE(ir->eDisre));
    PS("disre_weighting",EDISREWEIGHTING(ir->eDisreWeighting));
    PS("disre_mixed",BOOL(ir->bDisreMixed));
    PR("dr_fc",ir->dr_fc);
    PR("dr_tau",ir->dr_tau);
    PR("nstdisreout",ir->nstdisreout);
    PR("orires_fc",ir->orires_fc);
    PR("orires_tau",ir->orires_tau);
    PR("nstorireout",ir->nstorireout);

    PR("dihre-fc",ir->dihre_fc);
    
    PR("em_stepsize",ir->em_stepsize);
    PR("em_tol",ir->em_tol);
    PI("niter",ir->niter);
    PR("fc_stepsize",ir->fc_stepsize);
    PI("nstcgsteep",ir->nstcgsteep);
    PI("nbfgscorr",ir->nbfgscorr);

    PS("ConstAlg",ECONSTRTYPE(ir->eConstrAlg));
    PR("shake_tol",ir->shake_tol);
    PI("lincs_order",ir->nProjOrder);
    PR("lincs_warnangle",ir->LincsWarnAngle);
    PI("lincs_iter",ir->nLincsIter);
    PR("bd_fric",ir->bd_fric);
    PI("ld_seed",ir->ld_seed);
    PR("cos_accel",ir->cos_accel);
    pr_matrix(fp,indent,"deform",ir->deform,bMDPformat);
    PI("userint1",ir->userint1);
    PI("userint2",ir->userint2);
    PI("userint3",ir->userint3);
    PI("userint4",ir->userint4);
    PR("userreal1",ir->userreal1);
    PR("userreal2",ir->userreal2);
    PR("userreal3",ir->userreal3);
    PR("userreal4",ir->userreal4);
    pr_grp_opts(fp,indent,"grpopts",&(ir->opts),bMDPformat);
    pr_cosine(fp,indent,"efield-x",&(ir->ex[XX]),bMDPformat);
    pr_cosine(fp,indent,"efield-xt",&(ir->et[XX]),bMDPformat);
    pr_cosine(fp,indent,"efield-y",&(ir->ex[YY]),bMDPformat);
    pr_cosine(fp,indent,"efield-yt",&(ir->et[YY]),bMDPformat);
    pr_cosine(fp,indent,"efield-z",&(ir->ex[ZZ]),bMDPformat);
    pr_cosine(fp,indent,"efield-zt",&(ir->et[ZZ]),bMDPformat);
    PS("bQMMM",BOOL(ir->bQMMM));
    PI("QMconstraints",ir->QMconstraints);
    PI("QMMMscheme",ir->QMMMscheme);
    PR("scalefactor",ir->scalefactor);
    pr_qm_opts(fp,indent,"qm_opts",&(ir->opts));
  }
}