[gmx-developers] test particle insertion into the slab

hessb at mpip-mainz.mpg.de hessb at mpip-mainz.mpg.de
Tue Dec 16 15:15:28 CET 2008


Hi,

I implemented TPI with PME in the CVS head branch.
This is now by far the prefered method for TPI with
a charged molecule. Because the potential is only calculated
once per frame, you can use a very fine grid and a short cut-off.

Berk

> OK, I understand. If someone wants its here...
>
> Robert
> ps: the last change should have little bit different conditions:
> /* Generate a random position in the box */
>      /* slab modification*/
>         if ((inputrec->tpizmax < state->box[ZZ][ZZ])&&(inputrec->tpizmax
> >0))
>             zmax = inputrec->tpizmax;
>         else zmax = state->box[ZZ][ZZ];
>         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];*/
>
>
>> Hi,
>>
>> I see that this modification can be useful in certain cases.
>> But we can not put in all options users ask for, since then the total
>> amount
>> of mdp options would explode and the code would also become more bug
>> prone.
>> If there are several people that would use this option, I can put it in.
>>
>> I would like to have PME for test particle insertion,
>> but currently there is no potential (only force) interpolation for PME
>> in Gromacs.
>> If somebody (Erik?) can give me the formula for energy interpolation,
>> I can put it in immediately.
>>
>> Berk
>>
>> robert.vacha at marge.uochb.cas.cz wrote:
>>> 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];*/
>>>
>>>
>>>
>>> _______________________________________________
>>> gmx-developers mailing list
>>> gmx-developers at gromacs.org
>>> http://www.gromacs.org/mailman/listinfo/gmx-developers
>>> Please don't post (un)subscribe requests to the list. Use the
>>> www interface or send it to gmx-developers-request at gromacs.org.
>>>
>>>
>>
>> _______________________________________________
>> gmx-developers mailing list
>> gmx-developers at gromacs.org
>> http://www.gromacs.org/mailman/listinfo/gmx-developers
>> Please don't post (un)subscribe requests to the list. Use the
>> www interface or send it to gmx-developers-request at gromacs.org.
>>
>
> _______________________________________________
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://www.gromacs.org/mailman/listinfo/gmx-developers
> Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-developers-request at gromacs.org.
>





More information about the gromacs.org_gmx-developers mailing list