[gmx-developers] Small hack regarding dihedrals
MURAT OZTURK
murozturk at ku.edu.tr
Thu Sep 26 08:04:40 CEST 2013
Thank you very much. I need to build a toy system to test it, but sounds
just about right. I might even hard-code the square of threshold to save
another flop, following your philosophy. A flop is a flop :)
Again, thank you.
Murat
On Thu, Sep 26, 2013 at 12:10 AM, Bogdan Costescu <bcostescu at gmail.com>wrote:
> On Wed, Sep 25, 2013 at 5:29 PM, MURAT OZTURK <murozturk at ku.edu.tr> wrote:
> > Is it OK to intorduce the conditional into pdihs(), and bypass even
> calling
> > dopdihs() if r_kj ( as reported by calling dih_angle() ) is less then
> > threshold?
>
> Yes. It makes sense to abort calculating as soon as you have enough
> information to make the decision. You can place your test immediately
> after calling dih_angle(), as it gives you r_jk. The code could look
> like (based on your own proposal):
>
> /* outside of the loop */
> threshold2 = threshold * threshold;
>
> for (i = 0; (i < nbonds); )
> {
> ...
> phi = dih_angle(...)
> midDist2 = iprod(r_jk, r_jk);
> if (midDist2 > threshold2)
> continue;
> ...
> }
>
> Please note the comparison done on the squares of distances instead of
> distances, saving some CPU cycles.
>
> Good luck!
> Bogdan
> --
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-developers
> Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-developers-request at gromacs.org.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20130926/e22b37d8/attachment.html>
More information about the gromacs.org_gmx-developers
mailing list