<div dir="ltr">Hi all, so Christoph had contacted me privately and shared a solution within his Sinks unit to accomplish what I had wanted. The modification is very similar to what Norbert and Anshu had suggested as the Sinks particles are already evolved separately in their own arrays.<div><br></div><div>The fix essentially amounts to deleting the particles from the main "particles" array while the code is running, and only re-writing them to the "particles" array when IO operations are performed. Usually, this operation is performed continuously throughout the simulation to ensure that the two arrays match one another, but this is not necessary if the particles are not utilized outside of the Sinks unit. By doing this, one avoids the checks on the "particles" array that would usually delete particles if they leave the domain. This also prevents particles from being moved to different home blocks, so this hack is definitely not generalizable to situations where the particles are mapped to the grid (which is not the case for the Sinks unit).</div><div><br></div><div>Thanks again for your suggestions everyone! And thanks very much to Christoph for helping me out with the Sinks code in particular.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Mar 29, 2015 at 11:49 AM, James Guillochon <span dir="ltr"><<a href="mailto:jfg@ucolick.org" target="_blank">jfg@ucolick.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Klaus, Norbert and Anshu,<div><br></div><div>Indeed I am relying upon "<span style="font-size:12.8000001907349px">gr_</span><span style="font-size:12.8000001907349px">ptKeepLostParticles" </span>being set to true, the logic in the two routines I modified above check the value of that option. So that is a bug that should be fixed. Removing that line, and using the two simple changes I proposed above, seem to lead to a crash, so clearly the solution is more along the lines of what Anshu and Norbert suggested.</div><div><div><br></div><div>Ideally I'd like a solution that uses the present machinery as much as possible, because I'd like to continue a rather expensive run that already used the existing machinery. Also, I'd like to continue using the sinks routines to apply gravity to the particles, rather than having to reinvent that code. At the present it looks like the sinks module only loops over the particles that are not marked as "lost," hence the approach where those particles are still included within the normal particles array. Since Christoph wrote the sinks module I've attempted to contact him directly.</div><div><br></div><div>In the future it would definitely be nice to have the ability to continue to evolve particles that leave the domain in the mainline code, there are many use cases I can think of where it would be valuable.</div></div><div><br></div><div>I'll let you guys know if I come up with a solution. Thanks for all your help!</div><span class="HOEnZb"><font color="#888888"><div>- James</div></font></span></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Sat, Mar 28, 2015 at 5:30 PM, Klaus Weide <span dir="ltr"><<a href="mailto:klaus@flash.uchicago.edu" target="_blank">klaus@flash.uchicago.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Fri, 27 Mar 2015, James Guillochon wrote:<br>
<br>
> Hi all, I'm using active particles in my calculation, and I would like to<br>
> continue to evolve the particle trajectories even once the particles have<br>
> left the domain. I see that particles that leave the domain can be saved<br>
> after they leave by enabling a flag, but it appears that their evolution at<br>
> this point is frozen. It looks like a few relatively simple changes in<br>
> Particles_advance may be able to continue their evolution, but I wasn't<br>
> sure if evolving these particles would cause issues.<br>
<br>
</span>James,<br>
<br>
Have you tried to set the keepLostParticles runtime parameter?<br>
<br>
I have just noticed an apparent bug in Grid/GridParticles/gr_ptInit.F90.<br>
That file contains the line<br>
<br>
call RuntimeParameters_get("keepLostParticles",gr_ptKeepLostParticles)<br>
<br>
but later on another line<br>
<br>
gr_ptKeepLostParticles=.false.<br>
<br>
that makes the runtime parameter ineffective.<br>
<br>
Does fixing this help with your problem?<br>
<span><font color="#888888"><br>
Klaus<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="">-- <br><div><div dir="ltr">James Guillochon<br><span style="font-family:arial;font-size:small">Einstein Fellow at the Harvard-Smithsonian CfA</span><br><a href="mailto:jguillochon@cfa.harvard.edu" target="_blank">jguillochon@cfa.harvard.edu</a></div></div>
</span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">James Guillochon<br><span style="font-family:arial;font-size:small">Einstein Fellow at the Harvard-Smithsonian CfA</span><br><a href="mailto:jguillochon@cfa.harvard.edu" target="_blank">jguillochon@cfa.harvard.edu</a></div></div>
</div>