[gmx-developers] Computing prot pot ener in the gmx code
pascal.baillod at epfl.ch
pascal.baillod at epfl.ch
Mon Jan 16 19:27:55 CET 2006
Dear David and Yang,
Thank you very much for your indications. I am having some trouble to understand
how the potential energy data structures are defined in the code.
I have defined the routine sum_epotPROT (see copy here below) in tgroup.c and
the index F_EPOTprot, used in this routine and defined in idef.h. Following
David's proposal, I have been trying to get the protein-protein and
protein-solvent energy terms with
sum_v(grps->estat.nn,grps->estat.ee[egCOULSR][x])
with indexes x = 0, 1 and 2.
1) There is the following compilation error message, shown for every line of the
subroutine sum_epotPROT with "...->estat.ee[egCOULSR][x]":
tgroup.c(317): error: argument of type "real={float}" is incompatible with
parameter of type "real={float} *"
2) It would help understanding how the epot and estat.ee[egLJ14][x] data
structures are organised. epot is a one dimensional array, what about estat?
3) Am I correct in invoking epot on the left of the "="? Or should I define a
new array? How dose the indexing work?
Thank you very much for any help!
Pascal
void sum_epotPROT(t_grpopts *opts,t_groups *grps,real epot[])
{
int i;
/* Accumulate energies */
epot[F_COUL_SR] = sum_v(grps->estat.nn,grps->estat.ee[egCOULSR][0]);
epot[F_COUL_SR] += sum_v(grps->estat.nn,grps->estat.ee[egCOULSR][1]);
epot[F_COUL_SR] += sum_v(grps->estat.nn,grps->estat.ee[egCOULSR][2]);
epot[F_LJ] = sum_v(grps->estat.nn,grps->estat.ee[egLJSR][0]);
epot[F_LJ] += sum_v(grps->estat.nn,grps->estat.ee[egLJSR][1]);
epot[F_LJ] += sum_v(grps->estat.nn,grps->estat.ee[egLJSR][2]);
epot[F_LJ14] = sum_v(grps->estat.nn,grps->estat.ee[egLJ14][0]);
epot[F_LJ14] += sum_v(grps->estat.nn,grps->estat.ee[egLJ14][1]);
epot[F_LJ14] += sum_v(grps->estat.nn,grps->estat.ee[egLJ14][2]);
epot[F_COUL14] = sum_v(grps->estat.nn,grps->estat.ee[egCOUL14][0]);
epot[F_COUL14] += sum_v(grps->estat.nn,grps->estat.ee[egCOUL14][1]);
epot[F_COUL14] += sum_v(grps->estat.nn,grps->estat.ee[egCOUL14][2]);
epot[F_COUL_LR] += sum_v(grps->estat.nn,grps->estat.ee[egCOULLR][0]);
epot[F_COUL_LR] += sum_v(grps->estat.nn,grps->estat.ee[egCOULLR][1]);
epot[F_COUL_LR] += sum_v(grps->estat.nn,grps->estat.ee[egCOULLR][2]);
epot[F_LJ_LR] += sum_v(grps->estat.nn,grps->estat.ee[egLJLR][0]);
epot[F_LJ_LR] += sum_v(grps->estat.nn,grps->estat.ee[egLJLR][1]);
epot[F_LJ_LR] += 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] = sum_v(grps->estat.nn,grps->estat.ee[egBHAMSR][0]);
epot[F_BHAM] += sum_v(grps->estat.nn,grps->estat.ee[egBHAMSR][1]);
epot[F_BHAM] += sum_v(grps->estat.nn,grps->estat.ee[egBHAMSR][2]);
epot[F_BHAM_LR] = sum_v(grps->estat.nn,grps->estat.ee[egBHAMLR][0]);
epot[F_BHAM_LR] += sum_v(grps->estat.nn,grps->estat.ee[egBHAMLR][1]);
epot[F_BHAM_LR] += 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];
}
*******************************************************************************
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