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. <div>
<br></div><div>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. </div><div><br>
</div><div>I am trying to figure out how the distance is calculated in bonds(), but it is surprisingly fancy :</div><div><br></div><div><div><span style="font-family:monospace,fixed;font-size:13px;line-height:1;white-space:pre-wrap">ki   = pbc_rvec_sub(pbc,x[ai],x[aj],dx);   </span></div>
<div><div class="line" style="font-family:monospace,fixed;font-size:13px;line-height:1;min-height:13px;white-space:pre-wrap;word-wrap:break-word;padding-left:53px;padding-bottom:0px;margin:0px"><a name="l00340" style="color:rgb(61,87,140)"></a>dr2  = iprod(dx,dx);                      </div>
<div class="line" style="font-family:monospace,fixed;font-size:13px;line-height:1;min-height:13px;white-space:pre-wrap;word-wrap:break-word;padding-left:53px;padding-bottom:0px;margin:0px"><a name="l00341" style="color:rgb(61,87,140)"></a>dr   = dr2*gmx_invsqrt(dr2);      </div>
</div></div><div><br></div><div>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&#39;t find any comment as to what iprod() or gmx_invsqrt() does.</div>
<div>But never mind the details, I assume in the end dr is the distance between atoms ai and aj. <b>Is this correct?  </b></div><div><br></div><div>Then we skip to tab_angles() : </div><div><br></div><div><div class="line" style="font-family:monospace,fixed;font-size:13px;line-height:1;min-height:13px;white-space:pre-wrap;word-wrap:break-word;padding-left:53px;padding-bottom:0px;margin:0px">
*dvdlambda += bonded_tab(blabla , <span style="background-color:rgb(251,252,253)">&amp;va, &amp;dVdt</span><span style="line-height:1">);</span></div></div><div class="line" style="font-family:monospace,fixed;font-size:13px;line-height:1;min-height:13px;white-space:pre-wrap;word-wrap:break-word;padding-left:53px;padding-bottom:0px;margin:0px">
<span style="line-height:1"><br></span></div><div class="line" style="font-family:monospace,fixed;font-size:13px;line-height:1;min-height:13px;white-space:pre-wrap;word-wrap:break-word;padding-left:53px;padding-bottom:0px;margin:0px">
<span style="font-family:arial;font-size:small;line-height:normal;text-indent:0px;white-space:normal">So we get the potential and force from the table and put them into va and dVdT. </span></div><div class="line" style="font-family:monospace,fixed;font-size:13px;line-height:1;min-height:13px;white-space:pre-wrap;word-wrap:break-word;padding-left:53px;padding-bottom:0px;margin:0px">
<span style="font-family:arial;font-size:small;line-height:normal;text-indent:0px;white-space:normal"><br></span></div><div class="line" style="font-family:monospace,fixed;font-size:13px;line-height:1;min-height:13px;white-space:pre-wrap;word-wrap:break-word;padding-left:53px;padding-bottom:0px;margin:0px">
<span style="font-family:arial;font-size:small;line-height:normal;text-indent:0px;white-space:normal">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. <b>Is it that simple?</b></span></div>
<div class="line" style="font-family:monospace,fixed;font-size:13px;line-height:1;min-height:13px;white-space:pre-wrap;word-wrap:break-word;padding-left:53px;padding-bottom:0px;margin:0px"><span style="font-family:arial;font-size:small;line-height:normal;text-indent:0px;white-space:normal"><b><br>
</b></span></div><div class="line" style="font-family:monospace,fixed;font-size:13px;line-height:1;min-height:13px;white-space:pre-wrap;word-wrap:break-word;padding-left:53px;padding-bottom:0px;margin:0px"><span style="font-family:arial;font-size:small;line-height:normal;text-indent:0px;white-space:normal">And lastly, as a bonus question, what does dvdlambda keep? Do I even want to know? </span></div>
<div class="line" style="font-family:monospace,fixed;font-size:13px;line-height:1;min-height:13px;white-space:pre-wrap;word-wrap:break-word;padding-left:53px;padding-bottom:0px;margin:0px"><span style="font-family:arial;font-size:small;line-height:normal;text-indent:0px;white-space:normal"><br>
</span></div><div class="line" style="font-family:monospace,fixed;font-size:13px;line-height:1;min-height:13px;white-space:pre-wrap;word-wrap:break-word;padding-left:53px;padding-bottom:0px;margin:0px"><span style="font-family:arial;font-size:small;line-height:normal;text-indent:0px;white-space:normal">Thank you very much in advance, and thank you for encouraging me and pointing me in the right direction in the first place.</span></div>
<div class="line" style="font-family:monospace,fixed;font-size:13px;line-height:1;min-height:13px;white-space:pre-wrap;word-wrap:break-word;padding-left:53px;padding-bottom:0px;margin:0px"><span style="font-family:arial;font-size:small;line-height:normal;text-indent:0px;white-space:normal"><br>
</span></div><div class="line" style="font-family:monospace,fixed;font-size:13px;line-height:1;min-height:13px;white-space:pre-wrap;word-wrap:break-word;padding-left:53px;padding-bottom:0px;margin:0px"><span style="font-family:arial;font-size:small;line-height:normal;text-indent:0px;white-space:normal">Murat</span></div>