[gmx-developers] test particle insertion into the slab

robert.vacha at marge.uochb.cas.cz robert.vacha at marge.uochb.cas.cz
Mon Dec 15 15:30:36 CET 2008


Dear developers,

I have found it useful to use the test particle insertion selectively into
the slab in z-coordinate (set z-min and z-max for insertion). It requires
only few modifications that are attached below (lines correspond to 4.0
release). Note that it is not be combined with cavity insertion.

Btw do you plan to include PME into the test particle insertion in future?
and if so is it possible to estimate when? :)

Thanks & best,
Robert


include/types/inputrec.h
178: real tpizmin;         /* Z-min value for test particle insertion     */
     real tpizmax;         /* Z-max value for test particle insertion     */

src/gmxlib/tpxio.c
302:
    do_real(ir->tpizmin);
    do_real(ir->tpizmax);

src/gmxlib/txtdump.c
566:
    PR("tpizmin",ir->tpizmin);
    PR("tpizmax",ir->tpizmax);

src/kernel/readir.c
559: in void get_ir(
    CTYPE ("Insertion in slab from zmin to zmax, when 0 full box is used");
    RTYPE ("tpizmin",        ir->tpizmin,    0.0);
    RTYPE ("tpizmax",        ir->tpizmax,    0.0);

962:
  if (ir->tpizmin < 0.0) {
      fprintf(stderr,"ERROR: Minimum z coordinate for insertion must be
larger than zero\n");
      (*nerror)++;
  }
  if (ir->tpizmax < 0.0) {
      fprintf(stderr,"ERROR: Maximum z coordinate for insertion must be
larger than zero\n");
      (*nerror)++;
  }
  if (ir->tpizmax < ir->tpizmin ) {
      fprintf(stderr,"ERROR: Minimum z coordinate for insertion cannot be
larger than maximum\n");
      (*nerror)++;
  }

src/mdlib/minimize.c

2493:
 /*insertion in slab from zmin to zmax*/
  if (!bCavity) {
     double zmin=0,zmax=state->box[ZZ][ZZ];
     if (inputrec->tpizmin > 0) zmin = inputrec->tpizmin;
     if ((inputrec->tpizmax > 0)&& (inputrec->tpizmax < state->box[ZZ][ZZ]))
          zmax = inputrec->tpizmax;
     if (zmin > zmax) gmx_fatal(FARGS,"Cannot insert from %f to
%f\n",zmin,zmax);
     else fprintf(stderr, "Insertion from zmin: %f to zmax:
%f\n",tpizmin,tpizmax);
  }
  /*slab modification end*/

2689:
/* Generate a random position in the box */
    /* slab modification*/
      if (inputrec->tpizmax > state->box[ZZ][ZZ])
          zmax = state->box[ZZ][ZZ];
      else zmax = inputrec->tpizmax;
      if (zmin > zmax) gmx_fatal(FARGS,"Cannot insert from %f to
%f\n",zmin,zmax);

      x_init[ZZ] = zmin + gmx_rng_uniform_real(tpi_rand)*(zmax-zmin);
    /*end slab modification*/
      x_init[XX] = gmx_rng_uniform_real(tpi_rand)*state->box[XX][XX];
      x_init[YY] = gmx_rng_uniform_real(tpi_rand)*state->box[YY][YY];
   /*old-no slab   x_init[ZZ] =
gmx_rng_uniform_real(tpi_rand)*state->box[ZZ][ZZ];*/






More information about the gromacs.org_gmx-developers mailing list