<div dir="ltr"><div><div><div><div><div><div><div><div><div><div>Oops, I didn't notice you had sent this to flash-users when I replied to you yesterday.<br><br></div>The BHTree solver with bhtreeAcc=1 does indeed work perfectly (y gravitational acceleration attached, <br>all plots from this email come from debugging runs done with FLASH 4.4).<br><br></div>However, the "production" version of FLASH I'm working with (heavily modified) is a bit too old for me to be <br>able to use this fix. Moreover, old work used other solvers in which the acceleration is computed from the potential <br>in Gravity_accelOneRow (which is done the exact same way independent of the solver employed to compute<br></div>the potential, as I've verified), and I'm worried how this bug may affect that old work. Also, I just gotta know!!!<br></div>I had a dream about debugging this last night...<br><br></div>Any way, if I use BHTree without the "bhtreeAcc=1" then it computes the acceleration through the potential.<br></div>But, in this case Gravity_accelOneRow doesn't get called on the first time step. So, I made the<br></div>Driver_initFlash edits as described in my first email to get *accelOneRow called on the 1st time step.<br></div>And I get the attached y gravitational acceleration, which looks pretty nice but still has a weird jump on the<br></div>boundary.<br><br></div>Do you think the boundary jump is supposed to be there? Or is this a bug?<br><div><div><div><div><div><div><div><div><div><div><br><div><div class="gmail_extra">Best,<br clear="all"></div><div class="gmail_extra"><div><div class="m_1822373384628925401gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr">--------<div>Ryan</div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Mon, Feb 27, 2017 at 1:32 PM, Joshua Wall <span dir="ltr"><<a href="mailto:joshua.e.wall@gmail.com" target="_blank">joshua.e.wall@gmail.com</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"><div><div><div><div><div><div>Hello Ryan,<br><br></div>      I double checked this morning, and Richard Wunsch's BHTree gravity includes variables for storing the gravitation acceleration at each cell if you use his solver with the added option bhtreeAcc at setup like this (make sure you take out any references to other gravity solvers in the simulation Config file):<br><br></div>./setup DustCollapse +auto +3d --with-unit=physics/Gravity/Gr<wbr>avityMain/Poisson/BHTree bhtreeAcc=1<br><br></div>If you check in the code in source/physics/Gravity/Gravity<wbr>Main/Poisson/BHTree/Gravity_<wbr>accelOneRow.F90 you can see how the accelerations are calculated and stored exactly from both the grid and any sinks in the code. I've been using his potential solver for some time (in Flash 4.2.2, including getting the accelerations) and find it to be both robust and fast. Or perhaps you could use his implementation as an example of how to structure your own modifications to Gravity_accelOneRow.F90.<br><br></div>Note that if you do use his code it already includes the gravity accel variables in source/physics/Gravity/Gravity<wbr>Main/Poisson/BHTree/Config, which I encourage you to check out as it describes the other options for the code. The paper for this method is in prep still I believe.<br><br></div>Hope this helps!<br><br></div>Josh<br><div><div><div><div><div><div><div><br><div class="gmail_quote"><span><div dir="ltr">On Sat, Feb 25, 2017 at 10:03 PM Ryan Farber <<a href="mailto:rjfarber@umich.edu" target="_blank">rjfarber@umich.edu</a>> wrote:<br></div></span><div><div class="m_1822373384628925401h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="m_1822373384628925401m_4233117519383131479gmail_msg">Dear FLASH users,<div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">I decided to look at the components of the gravitational acceleration for the supplied </div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">DustCollapse problem (FLASH 4.3), and have noticed some weird artifacts on the block boundaries.</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">The issue seems somewhat similar to one Thomas Peters' <a href="http://flash.uchicago.edu/pipermail/flash-users/2014-May/001440.html" class="m_1822373384628925401m_4233117519383131479gmail_msg" target="_blank">refinement issue</a> (a plotting bug)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">but I chatted with ngoldbaum on the yt IRC channel and the conclusion was the artifacts </div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">are on the FLASH side of things.</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">The only edits I made to the DustCollapse problem supplied with FLASH 4.3 were:</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">* Config: added the following lines</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><div class="m_1822373384628925401m_4233117519383131479gmail_msg">VARIABLE grac</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">VARIABLE poix</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">VARIABLE poiy</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">VARIABLE poiz</div></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">* Driver_initFlash.F90: copied to problem directory and modified the original lines:</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  if(.not. dr_restart) then</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     call Grid_getListOfBlocks(LEAF,bloc<wbr>kList,blockCount)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     call Gravity_potentialListOfBlocks(<wbr>blockCount,blockList)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     call Particles_initForces()</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  end if<br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  ! If we want to free any arrays created during simulation</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  ! initialization that are no longer needed, do it here.</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  call Simulation_freeUserArrays()</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  call IO_outputInitial(  dr_nbegin, dr_initialSimTime)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  if(dr_globalMe==MASTER_PE)prin<wbr>t*,'Initial plotfile written'</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  if(dr_globalMe==MASTER_PE)prin<wbr>t*,'Driver init all done'</div></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">**to**</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  if(.not. dr_restart) then</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     call Grid_getListOfBlocks(LEAF,bloc<wbr>kList,blockCount)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     call Gravity_potentialListOfBlocks(<wbr>blockCount,blockList)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     call Particles_initForces()</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     call Gravity_accelListOfBlocks(bloc<wbr>kCount, blockList, IAXIS, GRAC_VAR)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     call Gravity_accelListOfBlocks(bloc<wbr>kCount, blockList, JAXIS, GRAC_VAR)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     call Gravity_accelListOfBlocks(bloc<wbr>kCount, blockList, KAXIS, GRAC_VAR)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  end if</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  ! If we want to free any arrays created during simulation</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  ! initialization that are no longer needed, do it here.</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  call Simulation_freeUserArrays()</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  call IO_outputInitial(  dr_nbegin, dr_initialSimTime)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  if(dr_globalMe==MASTER_PE)prin<wbr>t*,'Initial plotfile written'</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  STOP(99)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  if(dr_globalMe==MASTER_PE)prin<wbr>t*,'Driver init all done'</div></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">* Gravity_accelOneRow: modified the original lines:</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  do ii = iimin+1, iimax-1</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     grav(ii) = grav(ii) + delxinv * (gpot(ii-1) - gpot(ii+1))</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  enddo<br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  grav(iimin) = grav(iimin+1)     ! this is invalid data - must not be used</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  grav(iimax) = grav(iimax-1)</div></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">**to**</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  do ii = iimin+1, iimax-1</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     grav(ii) = grav(ii) + delxinv * (gpot(ii-1) - gpot(ii+1))</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     if (sweepDir .eq. SWEEP_X) then</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">       solnVec(POIX_VAR, ii, pos(1), pos(2)) = grav(ii)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     end if</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     if (sweepDir .eq. SWEEP_Y) then</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">       solnVec(POIY_VAR, pos(1), ii, pos(2)) = grav(ii)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     end if</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     if (sweepDir .eq. SWEEP_Z) then</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">       solnVec(POIZ_VAR, pos(1), pos(2), ii) = grav(ii)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">     end if</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  enddo</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  grav(iimin) = grav(iimin+1)     ! this is invalid data - must not be used</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  grav(iimax) = grav(iimax-1)</div></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  if (sweepDir .eq. SWEEP_X) then</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">    solnVec(POIX_VAR, iimin, pos(1), pos(2)) = grav(iimin+1)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">    solnVec(POIX_VAR, iimax, pos(1), pos(2)) = grav(iimax-1)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  end if</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  if (sweepDir .eq. SWEEP_Y) then</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">    solnVec(POIY_VAR, pos(1), iimin, pos(2)) = grav(iimin+1)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">    solnVec(POIY_VAR, pos(1), iimax, pos(2)) = grav(iimax-1)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  end if</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  if (sweepDir .eq. SWEEP_Z) then</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">    solnVec(POIZ_VAR, pos(1), pos(2), iimin) = grav(iimin+1)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">    solnVec(POIZ_VAR, pos(1), pos(2), iimax) = grav(iimax-1)</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">  end if</div></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">Slices were taken along the x-axis.</div><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><br class="m_1822373384628925401m_4233117519383131479gmail_msg"></div><div class="m_1822373384628925401m_4233117519383131479gmail_msg">Thanks for your help,<br class="m_1822373384628925401m_4233117519383131479gmail_msg" clear="all"><div class="m_1822373384628925401m_4233117519383131479gmail_msg"><div class="m_1822373384628925401m_4233117519383131479m_-4857368356063029674gmail_signature m_1822373384628925401m_4233117519383131479gmail_msg"><div dir="ltr" class="m_1822373384628925401m_4233117519383131479gmail_msg"><div dir="ltr" class="m_1822373384628925401m_4233117519383131479gmail_msg"><div dir="ltr" class="m_1822373384628925401m_4233117519383131479gmail_msg"><div class="m_1822373384628925401m_4233117519383131479gmail_msg">Ryan</div></div></div></div></div></div>
</div></div>
</blockquote></div></div></div></div></div></div></div></div></div></div></div><div dir="ltr">-- <br></div><div class="m_1822373384628925401HOEnZb"><div class="m_1822373384628925401h5"><div data-smartmail="gmail_signature"><div dir="ltr"><div><div><div><div><div>Joshua Wall<br></div>Doctoral Candidate<br></div>Department of Physics<br></div>Drexel University<br></div>3141 Chestnut Street<br></div>Philadelphia, PA 19104<br></div></div>
</div></div></blockquote></div><br></div></div></div></div></div></div></div></div></div></div></div></div></div>