[gmx-developers] Bond-angle coupling
murozturk at ku.edu.tr
Thu Oct 4 21:10:12 CEST 2012
I took a look at the bondfree.c file. I think I have a very limited
understanding, but it might be just enough for such a simple hack. Comments
being sparse as they are (not complaining, just observing) I thought I
would try and steal some more of your time.
I have simplified my hack even further. I will hard-code a threshold into
tab_angles() function so that it will be turned off when the distance
between atoms ai and aj is above the threshold.
I am trying to figure out how the distance is calculated in bonds(), but it
is surprisingly fancy :
ki = pbc_rvec_sub(pbc,x[ai],x[aj],dx);
dr2 = iprod(dx,dx);
dr = dr2*gmx_invsqrt(dr2);
I have trouble understanding what is what here. pbc_rvec_sub takes care of
pbc, but how? dx is defined, but never initialized before, so what is it? I
can't find any comment as to what iprod() or gmx_invsqrt() does.
But never mind the details, I assume in the end dr is the distance between
atoms ai and aj. *Is this correct? *
Then we skip to tab_angles() :
*dvdlambda += bonded_tab(blabla , &va, &dVdt);
So we get the potential and force from the table and put them into va and
What if I calculate the distance just before this line, and put this line
within an if clause. Never call bonded_tab() if distance is above
threshold, and assign va=0 and dvDt=0. *Is it that simple?*
And lastly, as a bonus question, what does dvdlambda keep? Do I even want
Thank you very much in advance, and thank you for encouraging me and
pointing me in the right direction in the first place.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gromacs.org_gmx-developers