<div dir="ltr"><div class=""><img class="" id=":1wm" src="https://mail.google.com/mail/u/0/images/cleardot.gif" alt=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

&gt; You should be able to use the force flags, I think. These encode what<br>
&gt; needs to be done every step (e.g. NS step or not, energy or<br>
&gt; force-only), it gets set in do_md and passed to do_force.<br>
That&#39;s only the easy part.<br>
Then you need to use a multiple timestep integrator. We have such an<br>
integrator, but it&#39;s currently linked to twin-range non-bonded<br>
interactions. You would need to modify some control code to make it work<br>
on your potential. The essential function is combine_forces in<br>
mdlib/update.c which combines the fast and slow forces for the integrator.<br></blockquote><div><br></div><div>So
 I set the flag in do_md (considering bTwinRange and do_per_step), then 
check it in do_force_lowlevel to decide whether or not to call my new 
code. And then I need to store the forces and use them in 
combine_forces. Is that the gist of it?<br>
<br></div>
<br>&gt;Cheers,<br>
&gt;<br>
&gt;Berk<br>
&gt;&gt;<br>
&gt;&gt; Cheers,<br>
&gt;&gt; --<br>
&gt;&gt; Szil?rd<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Feb 5, 2014 at 12:51 PM, Alexander Bj?rling<br>
&gt;&gt; &lt;<a href="mailto:alex.bjorling@gmail.com" target="_blank">alex.bjorling@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt; Hi,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Our new bonded interaction (at <a href="https://gerrit.gromacs.org/#/c/2659/" target="_blank">https://gerrit.gromacs.org/#/c/2659/</a>) is very<br>
&gt;&gt;&gt; expensive to evaluate and gives rise to a force which varies slowly in time.<br>
&gt;&gt;&gt; I&#39;d like these forces to only be updated every N steps and to remain<br>
&gt;&gt;&gt; constant in between. What is the proper way to achieve this?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Best,<br>
&gt;&gt;&gt; Alex<br>
&gt;&gt;&gt;</div>