[gmx-developers] Computing prot pot ener in the gmx code

pascal.baillod at epfl.ch pascal.baillod at epfl.ch
Thu Jan 12 18:08:47 CET 2006


Hello,

I thank you very much for your reply, David and Yang! May I ask you some more
details?


> Add one more item after F_NRE
> This is one trick so that you just need to change the memory allocation
> in md.c to snew(ener,F_NRE+x); x is 1 for this case. If you put new 
> energy part before F_NRE

2) ..would this new energy part be F-EPOTprot (as re-used in my new routine
sum_epotPROT below)? Should I first define it, as you suggest, in idef.h, as:

typedef atom_id t_iatom;

/* this MUST correspond to the 
   t_interaction_function[F_NRE] in gmxlib/ifunc.c */
enum {
  F_BONDS,
/*  ......... a list of other contributrions*/
  F_DVDL,
  F_DVDLKIN,
  F_NRE,             /* This number is for the total number of energies	*/
  F-EPOTprot         /* MY NEW CONTRIBUTION, after F_NRE */
};


3) Are the indexes in my proposed routine sum_epotPROT (copied here below)
correct? Is the final summing loop still correct?

4) Finally, do you know how I could include any missing PME terms? David was
mentioning some,  contained in another file and from which I should also derive
a protein specific contribution..

5) Are there any workshops on the gromacs code and development issues, or any
other way or reference to get familiar with the routines, data structures and
variables?

Thank you very much for your help!

Regards,

Pascal



---------- my adapted routine sum_epotPROT (added to tgroup.c) -----------


void sum_epotPROT(t_grpopts *opts,t_groups *grps,real epot[])
{
  int i;

  /* Accumulate energies */
  epot[F_COUL_SR][0]  = sum_v(grps->estat.nn,grps->estat.ee[egCOULSR][0]);
  epot[F_COUL_SR][1]  = sum_v(grps->estat.nn,grps->estat.ee[egCOULSR][1]);
  epot[F_COUL_SR][2]  = sum_v(grps->estat.nn,grps->estat.ee[egCOULSR][2]);
  epot[F_LJ][0]       = sum_v(grps->estat.nn,grps->estat.ee[egLJSR][0]);
  epot[F_LJ][1]       = sum_v(grps->estat.nn,grps->estat.ee[egLJSR][1]);
  epot[F_LJ][2]       = sum_v(grps->estat.nn,grps->estat.ee[egLJSR][2]);
  epot[F_LJ14][0]     = sum_v(grps->estat.nn,grps->estat.ee[egLJ14][0]);
  epot[F_LJ14][1]     = sum_v(grps->estat.nn,grps->estat.ee[egLJ14][1]);
  epot[F_LJ14][2]     = sum_v(grps->estat.nn,grps->estat.ee[egLJ14][2]);
  epot[F_COUL14][0]   = sum_v(grps->estat.nn,grps->estat.ee[egCOUL14][0]);
  epot[F_COUL14][1]   = sum_v(grps->estat.nn,grps->estat.ee[egCOUL14][1]);
  epot[F_COUL14][2]   = sum_v(grps->estat.nn,grps->estat.ee[egCOUL14][2]);
  epot[F_COUL_LR][0] += sum_v(grps->estat.nn,grps->estat.ee[egCOULLR][0]);
  epot[F_COUL_LR][1] += sum_v(grps->estat.nn,grps->estat.ee[egCOULLR][1]);
  epot[F_COUL_LR][2] += sum_v(grps->estat.nn,grps->estat.ee[egCOULLR][2]);
  epot[F_LJ_LR][0]   += sum_v(grps->estat.nn,grps->estat.ee[egLJLR][0]);
  epot[F_LJ_LR][1]   += sum_v(grps->estat.nn,grps->estat.ee[egLJLR][1]);
  epot[F_LJ_LR][2]   += sum_v(grps->estat.nn,grps->estat.ee[egLJLR][2]);
/* lattice part of LR doesnt belong to any group
 * and has been added earlier
 */
  epot[F_BHAM][0]     = sum_v(grps->estat.nn,grps->estat.ee[egBHAMSR][0]);
  epot[F_BHAM][1]     = sum_v(grps->estat.nn,grps->estat.ee[egBHAMSR][1]);
  epot[F_BHAM][2]     = sum_v(grps->estat.nn,grps->estat.ee[egBHAMSR][2]);
  epot[F_BHAM_LR][0]  = sum_v(grps->estat.nn,grps->estat.ee[egBHAMLR][0]);
  epot[F_BHAM_LR][1]  = sum_v(grps->estat.nn,grps->estat.ee[egBHAMLR][1]);
  epot[F_BHAM_LR][2]  = sum_v(grps->estat.nn,grps->estat.ee[egBHAMLR][2]);

  epot[F_EPOTprot] = 0;
  for(i=0; (i<F_EPOTprot); i++)
    if (i != F_DISRESVIOL && i != F_ORIRESDEV && i !=
F_DIHRESVIOL)
      epot[F_EPOTprot] += epot[i][0];
      epot[F_EPOTprot] += epot[i][1];
      epot[F_EPOTprot] += epot[i][2];
}

*******************************************************************************
Pascal Baillod (PhD student) 
*******************************************************************************
Swiss Federal Institute of Technology EPFL	        Tel: +41-(0)21-693-0322
Institute of Chemical Sciences and Engineering ,	Fax: +41-(0)21-693-0320
Laboratory of Computational Chemistry and Biochemistry	pascal.baillod at epfl.ch
Room BCH 4121, Avenue Forel,	                        http://lcbcpc21.epfl.ch
CH-1015 Lausanne	
*******************************************************************************



More information about the gromacs.org_gmx-developers mailing list