<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi,</p>
<p>thank you all, now it works!</p>
<p>Best,</p>
<p>Petr</p>
<p>On 2020-05-18 18:12, Ryan Farber wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div dir="ltr">Just a quick follow up on Marissa's terrific explanation which briefly mentioned handling HDF5 outputs using VisIt, IDL, python, etc: I personally recommend the python package yt. It makes processing FLASH simulations as easy as
<div><br />
<div>1) import yt</div>
<div>2) ds = yt.load("YOUR_HDF5_FILE")</div>
<div>3) ad = ds.all_data() # or subset of data if you prefer, many options available</div>
<div><a href="https://yt-project.org/">https://yt-project.org/</a><br />
<div> </div>
<div>
<div>Best,<br clear="all" />
<div>
<div class="gmail_signature" dir="ltr">
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">--------
<div>Ryan</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br />
<div class="gmail_quote">
<div class="gmail_attr" dir="ltr">On Mon, May 18, 2020 at 9:16 AM Marissa B. P. Adams <<a href="mailto:marissa@flash.uchicago.edu">marissa@flash.uchicago.edu</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid #cccccc; padding-left: 1ex;">
<div style="overflow-wrap: break-word;">If you would like output information for each time step, you can use the routine <span style="font-family: Courier New;">Simulation_adjustEvolution.F90</span>.
<div> </div>
<div>If you open any old <span style="font-family: 'Courier New';">Simulation_adjustEvolution.F90 </span>from an object directory you will find that it is effectively empty. The routine takes in the number of blocks as an integer, the block list, current cycle number, time step, and current simulation time. From that you can tell that the purpose of this routine is to acquire or change block information for each time step, hence its name. </div>
<div> </div>
<div>Assuming your routine is empty, you may want to do the following:</div>
<div> </div>
<blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;">
<div>1. Loop through the number of blocks.</div>
</blockquote>
<blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;">
<blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;">
<div>2. Call <span style="font-family: Courier New;">Grid_getBlkIndexLimits</span>, <span style="font-family: Courier New;">Grid_getCellCoords</span>, <span style="font-family: Courier New;">Grid_getBlkPtr</span>, and <span style="font-family: Courier New;">Grid_getDeltas</span>. Some of these are crucial (<span style="font-family: 'Courier New';">Grid_getBlkIndexLimits, </span><span style="font-family: 'Courier New';">Grid_getBlkPtr</span>) if you want to a access the blkPtr, or, as Ryan said, the UNK. The other routines are helpful if you would like to a access the coordinates and their differences, in the case that you may want to preform an integration. If you want to get the coordinates make sure you allocate, initialize the arrays, and then deallocate after the step (3) series of loops.</div>
<div>3. Then you will want to loop over all three block limits for each i, j,k direction. </div>
</blockquote>
</blockquote>
<blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;">
<blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;">
<blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;">
<div>4. After this third step you can then assign your UNK to variables and preform calculations that may be grid based, or require special calculations.</div>
</blockquote>
</blockquote>
</blockquote>
<blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;">
<div>5. Don't forget to close the four essential loops, and deallocate allocated arrays, etc. </div>
</blockquote>
<div> </div>
<div>You can find examples of what I have just described in various parts of the code. I tried to provide the "shape" of the code, which can be helpful, in the formatting. If you want to create new UNK variables make sure you follow the appropriate procedure to do so... edit the configuration file, initialize it, etc. You can then access it in whatever routine.</div>
<div> </div>
<div>Around this whole operation you could then preform the standard methods of file I/O or whatever you please, or within it. Whether it is a .<em>dat</em> file or a .<em>txt</em> file, whatever you want.</div>
<div> </div>
<div>If you're looking to access <em>all</em> block to cell information for each UNK though I would really recommend just sticking to HDF5, using VisIt, IDL, or python's associated libraries.... Honestly the idea of any other format gives me nightmares for post processing purposes... and ASCII file for each output dump would probably eat your storage alive. </div>
<div> </div>
<div>I know that Flash also has chombo capabilities but I am pretty certain that part of the code is not maintained well.</div>
<div><br />
<div>
<div dir="auto" style="color: #000000; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; text-decoration: none;">
<div><span style="color: #000000; font-family: monospace; font-size: xx-small;">%———————————————————%</span>
<div><span style="color: #000000; font-family: monospace; font-size: xx-small;">Marissa B. P. Adams</span></div>
<div><span style="color: #000000; font-family: monospace; font-size: xx-small;">(she/her/hers)</span></div>
<div><span style="color: #000000; font-family: monospace; font-size: xx-small;">Phd Candidate, University of Rochester</span></div>
<div><strong style="font-family: monospace; font-size: x-small;">E-mail:</strong><span style="font-family: monospace; font-size: x-small;"> <a href="mailto:madams@pas.rochester.edu">madams@pas.rochester.edu</a></span></div>
<div><span style="color: #000000; font-family: monospace; font-size: xx-small;"><strong>Website:</strong> <a href="http://www.pas.rochester.edu/~madams">https://www.pas.rochester.edu/~madams</a></span></div>
<div><span style="color: #000000; font-family: monospace; font-size: xx-small;"><strong>Twitter:</strong> <a href="https://twitter.com/mbpadams">https://twitter.com/mbpadams</a></span></div>
<div><span style="color: #000000; font-family: monospace; font-size: xx-small;"><strong>Current Location:</strong></span></div>
<div><span style="font-family: monospace; font-size: xx-small;">My 400 sq. ft studio apartment</span></div>
<div><span style="color: #000000; font-family: monospace; font-size: xx-small;"><span style="text-decoration: line-through;">371 Bausch and Lomb Hall</span></span></div>
<div><span style="color: #000000; font-family: monospace; font-size: xx-small;"><span style="text-decoration: line-through;">University of Rochester</span></span></div>
<div><span style="color: #000000; font-family: monospace; font-size: xx-small;"><span style="text-decoration: line-through;">Rochester, NY 14627</span></span></div>
</div>
</div>
</div>
<div><br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div>On May 17, 2020, at 18:43, Ryan Farber <<a href="mailto:rjfarber@umich.edu">rjfarber@umich.edu</a>> wrote:</div>
<br />
<div>
<div dir="ltr">Hi Petr,
<div> </div>
<div>While I have not modified the dat file before, note that it should be easy to write to stdout.</div>
<div>For example, if you're debugging and want to know the minimum and maximum density before your code crashes you can do</div>
<div>==========</div>
<div>!! some flash file</div>
<div>use physicaldata, ONLY : unk</div>
<div>use Driver_data, ONLY : dr_globalMe ! or you can use pt_globalMe if you're in a Particle file and want to stay modular for example</div>
<div> </div>
<div>if (dr_globalMe == MASTER_PE) then</div>
<div> write(*,*) "max dens: ", maxval(unk(DENS_VAR,:,:,:,:)) ! unk has indices to variables, i, j, k, blocks</div>
<div> write(*,*) "min dens: ", minval(unk(DENS_VAR,:,:,:,:))</div>
<div>endif</div>
<div>=========</div>
<div>Note that it's probably safer (especially for getting the minimum values, I don't remember if the above will just yield zero) to loop over list of blocks to find the maximum, minimum. Or do an MPI_ALLREDUCE. Many options :)</div>
<div> </div>
<div>Best,<br clear="all" />
<div>
<div dir="ltr">
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">--------
<div>Ryan</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br />
<div class="gmail_quote">
<div class="gmail_attr" dir="ltr">On Sun, May 17, 2020 at 2:04 AM petrk <<a href="mailto:petrk@physics.muni.cz">petrk@physics.muni.cz</a>> wrote:</div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left: 1px solid #cccccc; padding-left: 1ex;">
<div style="font-size: 10pt; font-family: Verdana,Geneva,sans-serif;">
<p>Hello users,</p>
<p>Is there any possibility to write output data (for example for some particular quantities - density, pressure, etc.) explicitly to the ordinary .dat file and not to hdf?</p>
<p>Thanks a lot,</p>
<p>Petr</p>
<p><br /></p>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
<p><br /></p>
</body></html>