[gmx-developers] calc_bonds() does forces wether I like it or not

Erik Marklund erikm at xray.bmc.uu.se
Tue Feb 15 22:35:26 CET 2011


Hi developers,

I want to calculate the potential energy of my system at various times 
throughout the trajectory to make a sort of MC-like trial moves. But 
when I call do_force() with the GMX_FORCE_BONDED flag set, but not the 
GMX_FORCE_FORCES flag, I run into a segfault because calc_bonds() always 
seem to calculate forces but gets a NULL pointer as the f[] argument. I 
would think that do_force() should refrain from any force calculations, 
or at least trying to store forces, when called without GMX_FORCE_FORCES 
set. I can easily circumvent this problem myself, but the behaviour is 
counterintuitive for not-so-senior developers. Should I add a bunch of 
"if (f != NULL)" to the bonded functions, commit and push to 
release-4-5-branches, or should I leave it the way it is?

Cheers,

-- 
-----------------------------------------------
Erik Marklund, PhD student
Dept. of Cell and Molecular Biology, Uppsala University.
Husargatan 3, Box 596,    75124 Uppsala, Sweden
phone:    +46 18 471 4537        fax: +46 18 511 755
erikm at xray.bmc.uu.se    http://folding.bmc.uu.se/




More information about the gromacs.org_gmx-developers mailing list