<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><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><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Cheers,<br>
<br>
Berk<br>
&gt;<br>
&gt; Cheers,<br>
&gt; --<br>
&gt; Szil?rd<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Feb 5, 2014 at 12:51 PM, Alexander Bj?rling<br>
&gt; &lt;<a href="mailto:alex.bjorling@gmail.com">alex.bjorling@gmail.com</a>&gt; wrote:<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&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; expensive to evaluate and gives rise to a force which varies slowly in time.<br>
&gt;&gt; I&#39;d like these forces to only be updated every N steps and to remain<br>
&gt;&gt; constant in between. What is the proper way to achieve this?<br>
&gt;&gt;<br>
&gt;&gt; Best,<br>
&gt;&gt; Alex<br>
&gt;&gt;<br></blockquote></div><br></div></div>