[gmx-developers] Code snippits for flat-bottomed harmonic potentials in gromacs 4.0.4

Chris Neale chris.neale at utoronto.ca
Wed Apr 29 01:39:44 CEST 2009


I have recently introduced simple flat-bottom potentials to the pull 
code in my local version of gromacs 4.0.4. This could be used for 
umbrella sampling or to create a cap of water around a protein in 
vacuum. It appears to work for me, but then again I don't do much 
gromacs source code modification.

Not being sure where to post this, I'm sticking it on this list.

$diff MODIFIED/include/types/inputrec.h ORIGINAL/include/types/inputrec.h
<   real       flat;     /* Extension of the flat bottom potential 
around init (only for distance pulling) */

$diff MODIFIED/src/gmxlib/tpxio.c ORIGINAL/src/gmxlib/tpxio.c
<   do_real(pgrp->flat);

$diff MODIFIED/src/gmxlib/txtdump.c ORIGINAL/src/gmxlib/txtdump.c
<   PR("flat",pg->flat);

$diff MODIFIED/src/kernel/readpull.c ORIGINAL/src/kernel/readpull.c
<       sprintf(buf,"pull_flat%d",i);
<       RTYPE(buf,              pgrp->flat, 0.0);

$diff MODIFIED/src/mdlib/pull.c ORIGINAL/src/mdlib/pull.c
<   double    dvb;
< /* fprintf(stderr,"INITIAL 
dev[0]=%f\tpgrp->flat=%f\t",dev[0],pgrp->flat); */
<         if(dev[0]>pgrp->flat){
<         dev[0]-=pgrp->flat;
<       }else if(dev[0]<-pgrp->flat){
<         dev[0]+=pgrp->flat;
<       }else{
<         dev[0]=0.0;
<       }
< /* fprintf(stderr,"NOW dev[0]=%f\n",dev[0]); */

More information about the gromacs.org_gmx-developers mailing list