[gmx-users] Two independent umbrellas in gromacs 3.3.1

chris.neale at utoronto.ca chris.neale at utoronto.ca
Tue Sep 23 06:24:41 CEST 2008


Here are some source code modifications that allow two reference  
groups for the pull code (umbrella option). It would be simple to mod  
this for more than two groups. It would be slightly more difficult to  
enable all pull options (e.g. constraints) with more than one  
reference group, as that may require modification to update() (and one  
other function whose name escapes me) in some cases.

For usage, on would have, in addition to x.ppa, a file called x.ppa2.  
I have only tested it when there is one pulled group per reference  
group.

I used gromacs 3.3.1 as my base code. Based on the .pdf manual  
recently made available for gromacs 4, this option does not appear to  
be currently available for gromacs 4, and I didn't invest any time to  
see how difficult it would be to add this.

Hope it is useful,
Chris.

###

$diff orig/src/kernel/md.c new/src/kernel/md.c
329c329
<   t_pull     pulldata; /* for pull code */
---
>   t_pull     pulldata,pulldata_refTwo; /* for pull code */
397a398,400
>    
> init_pull(log,nfile,fnm,&pulldata_refTwo,state->x,mdatoms,inputrec->opts.nFreeze,
>             state->box,START(nsb),HOMENR(nsb),cr);
>
693c696
<       (pulldata.runtype == eAfm || pulldata.runtype == eUmbrella))
---
>       (pulldata.runtype == eAfm || pulldata.runtype == eUmbrella)){
696a700,703
>       pull(&pulldata_refTwo,state->x,f,force_vir,state->box,
>            top,inputrec->delta_t,step,t,
>            mdatoms,START(nsb),HOMENR(nsb),cr);
>     }

###

$diff orig/src/mdlib/pullinit.c new/src/mdlib/pullinit.c
223a224
>   static int timesCalled=0;
230a232,235
>   char tempfnmpi[256],tempfnmpo[256],tempfnmpd[256]; /*part of the  
> double pull reference hack */
>
>
>   timesCalled++;
241c246,256
<   read_pullparams(pull, opt2fn("-pi",nfile,fnm), opt2fn("-po",nfile,fnm));
---
>   if(timesCalled==1){
>     sprintf(tempfnmpi,"%s",opt2fn("-pi",nfile,fnm));
>     sprintf(tempfnmpo,"%s",opt2fn("-po",nfile,fnm));
>     sprintf(tempfnmpd,"%s",opt2fn("-pd",nfile,fnm));
>   }else{
>     sprintf(tempfnmpi,"%s2",opt2fn("-pi",nfile,fnm));
>     sprintf(tempfnmpo,"%s2",opt2fn("-po",nfile,fnm));
>     sprintf(tempfnmpd,"%s2",opt2fn("-pd",nfile,fnm));
>   }
>
>   read_pullparams(pull, tempfnmpi, tempfnmpo);
248c263
<     char * filename = opt2fn("-pd", nfile, fnm);
---
>     char * filename = tempfnmpd;
250c265
<     pull->out = ffopen(opt2fn("-pd",nfile,fnm),"w");
---
>     pull->out = ffopen(tempfnmpd,"w");

###

Code changes finished.




More information about the gromacs.org_gmx-users mailing list