<div dir="ltr"><div dir="ltr"><div dir="ltr"><p>Dear FLASH community,</p><p>Thank you for the replies and suggestions regarding visualization. While many suggested using VisIt or custom Python scripts, I would like to share a method for creating <b>XDMF outputs</b> directly from FLASH, making the data fully compatible with <b>ParaView</b>.</p><p>I have tested this method with <b>FLASH 4.8</b>. Below are the implementation steps.</p><h3>Part 1: Source Code Setup</h3><ol start="1"><li><p><b>Extract Grid_writeDomain Subroutines:</b>
Extract the attached <code>Grid_writeDomain_patch.zip</code> folder into your main FLASH directory. This will automatically place the new subroutine <code>Grid_writeDomain.F90</code> into the appropriate <code>paramesh</code> and <code>UG</code> directories.</p></li><li><p><b>Update Grid Makefile:</b>
Open <code>source/Grid/Makefile</code> and add <code>Grid_writeDomain.o</code> to the list of object files.</p></li><li><p><b>Update Grid Interface:</b>
Open <code>source/Grid/Grid_interface.F90</code> and add the following interface block:</p><span class="gmail-"><span class="gmail-ng-tns-c4170956601-68 gmail-ng-star-inserted"><div class="gmail-code-block gmail-ng-tns-c4170956601-68 gmail-ng-animate-disabled gmail-ng-trigger gmail-ng-trigger-codeBlockRevealAnimation"><div class="gmail-formatted-code-block-internal-container gmail-ng-tns-c4170956601-68"><div class="gmail-animated-opacity gmail-ng-tns-c4170956601-68"><pre class="gmail-ng-tns-c4170956601-68"><code role="text" class="gmail-code-container gmail-formatted gmail-ng-tns-c4170956601-68"><span class="gmail-hljs-keyword">interface</span> Grid_writeDomain
  <span class="gmail-hljs-function"><span class="gmail-hljs-keyword">subroutine</span></span> Grid_writeDomain(fileNumber)
    <span class="gmail-hljs-keyword">integer</span>, <span class="gmail-hljs-keyword">optional</span>, <span class="gmail-hljs-keyword">intent</span>(<span class="gmail-hljs-keyword">IN</span>) :: fileNumber
  <span class="gmail-hljs-keyword">end</span> <span class="gmail-hljs-function"><span class="gmail-hljs-keyword">subroutine</span></span> Grid_writeDomain
<span class="gmail-hljs-keyword">end</span> <span class="gmail-hljs-keyword">interface</span>
</code></pre></div></div></div></span></span></li></ol><h3>Part 2: Simulation Directory Setup</h3><ol start="4"><li><p><b>Copy Driver Files:</b>
Copy the following files from <code>source/Driver/</code> to your specific simulation directory (if they aren't there already):</p><ul><li><p><code>Driver_initFlash.F90</code></p></li><li><p><code>Driver_evolveFlash.F90</code></p></li></ul></li><li><p><b>Modify Driver_initFlash.F90:</b></p><ul><li><p>Add <code>Grid_writeDomain</code> to the <code>use</code> statement:</p><span class="gmail-"><span class="gmail-ng-tns-c4170956601-69 gmail-ng-star-inserted"><div class="gmail-code-block gmail-ng-tns-c4170956601-69 gmail-ng-animate-disabled gmail-ng-trigger gmail-ng-trigger-codeBlockRevealAnimation"><div class="gmail-formatted-code-block-internal-container gmail-ng-tns-c4170956601-69"><div class="gmail-animated-opacity gmail-ng-tns-c4170956601-69"><pre class="gmail-ng-tns-c4170956601-69"><code role="text" class="gmail-code-container gmail-formatted gmail-ng-tns-c4170956601-69"><span class="gmail-hljs-keyword">use</span> Grid_interface, <span class="gmail-hljs-keyword">ONLY</span> : ..., Grid_writeDomain
</code></pre></div></div></div></span></span></li><li><p>Add the call after <code>call IO_outputInitial(dr_nbegin, dr_initialSimTime)</code>:</p><span class="gmail-"><span class="gmail-ng-tns-c4170956601-70 gmail-ng-star-inserted"><div class="gmail-code-block gmail-ng-tns-c4170956601-70 gmail-ng-animate-disabled gmail-ng-trigger gmail-ng-trigger-codeBlockRevealAnimation"><div class="gmail-formatted-code-block-internal-container gmail-ng-tns-c4170956601-70"><div class="gmail-animated-opacity gmail-ng-tns-c4170956601-70"><pre class="gmail-ng-tns-c4170956601-70"><code role="text" class="gmail-code-container gmail-formatted gmail-ng-tns-c4170956601-70"><span class="gmail-hljs-keyword">call</span> Grid_writeDomain()
</code></pre></div></div></div></span></span></li></ul></li><li><p><b>Modify Driver_evolveFlash.F90:</b></p><ul><li><p>Add <code>Grid_writeDomain</code> to the <code>use</code> statement:</p><span class="gmail-"><span class="gmail-ng-tns-c4170956601-71 gmail-ng-star-inserted"><div class="gmail-code-block gmail-ng-tns-c4170956601-71 gmail-ng-animate-disabled gmail-ng-trigger gmail-ng-trigger-codeBlockRevealAnimation"><div class="gmail-formatted-code-block-internal-container gmail-ng-tns-c4170956601-71"><div class="gmail-animated-opacity gmail-ng-tns-c4170956601-71"><pre class="gmail-ng-tns-c4170956601-71"><code role="text" class="gmail-code-container gmail-formatted gmail-ng-tns-c4170956601-71"><span class="gmail-hljs-keyword">use</span> Grid_interface, <span class="gmail-hljs-keyword">ONLY</span> : ..., Grid_writeDomain
</code></pre></div></div></div></span></span></li><li><p>Add the call before <code>call Timers_stop("io")</code>:</p><span class="gmail-"><span class="gmail-ng-tns-c4170956601-72 gmail-ng-star-inserted"><div class="gmail-code-block gmail-ng-tns-c4170956601-72 gmail-ng-animate-disabled gmail-ng-trigger gmail-ng-trigger-codeBlockRevealAnimation"><div class="gmail-formatted-code-block-internal-container gmail-ng-tns-c4170956601-72"><div class="gmail-animated-opacity gmail-ng-tns-c4170956601-72"><pre class="gmail-ng-tns-c4170956601-72"><code role="text" class="gmail-code-container gmail-formatted gmail-ng-tns-c4170956601-72">#ifdef FLASH_GRID_PARAMESH
  <span class="gmail-hljs-keyword">call</span> Grid_writeDomain()
#<span class="gmail-hljs-keyword">endif</span>
</code></pre></div></div></div></span></span></li></ul></li></ol><h3>Part 3: Compilation and Post-Processing</h3><ol start="7"><li><p><b>Update Makefile.h:</b>
Open the <code>Makefile.h</code> used for your site and modify the HDF5 paths:</p><ul><li><p><b>Add</b> the API flag below <code>CCFLAGS_HDF5</code>:</p><span class="gmail-"><span class="gmail-ng-tns-c4170956601-73 gmail-ng-star-inserted"><div class="gmail-code-block gmail-ng-tns-c4170956601-73 gmail-ng-animate-disabled gmail-ng-trigger gmail-ng-trigger-codeBlockRevealAnimation"><div class="gmail-formatted-code-block-internal-container gmail-ng-tns-c4170956601-73"><div class="gmail-animated-opacity gmail-ng-tns-c4170956601-73"><pre class="gmail-ng-tns-c4170956601-73"><code role="text" class="gmail-code-container gmail-formatted gmail-ng-tns-c4170956601-73">FFLAGS_HDF5 = -I${HDF5_PATH}/<span class="gmail-hljs-keyword">include</span> -DH5_USE_16_API
</code></pre></div></div></div></span></span></li><li><p><b>Change</b> <code>LIB_HDF5</code> to:</p><span class="gmail-"><span class="gmail-ng-tns-c4170956601-74 gmail-ng-star-inserted"><div class="gmail-code-block gmail-ng-tns-c4170956601-74 gmail-ng-animate-disabled gmail-ng-trigger gmail-ng-trigger-codeBlockRevealAnimation"><div class="gmail-formatted-code-block-internal-container gmail-ng-tns-c4170956601-74"><div class="gmail-animated-opacity gmail-ng-tns-c4170956601-74"><pre class="gmail-ng-tns-c4170956601-74"><code role="text" class="gmail-code-container gmail-formatted gmail-ng-tns-c4170956601-74">LIB_HDF5 = -L${HDF5_PATH}/lib -lhdf5_fortran -lhdf5 -lz
</code></pre></div></div></div></span></span></li></ul></li><li><p><b>Run Simulation:</b>
Compile and run your simulation. You will see new grid files generated in your run directory with the naming convention <code>_hdf5_grd_xxxx</code> (or <code>_hdf5_grd_0000</code> if using UG).</p></li><li><p><b>Generate XDMF:</b></p><ul><li><p>Install <b>FlashKit</b> (instructions <a href="https://flashkit.readthedocs.io/en/main/tutorial/introduction.html#let-s-get-started">here</a>).</p></li><li><p>Run the following command in your output directory:</p><span class="gmail-"><span class="gmail-ng-tns-c4170956601-75 gmail-ng-star-inserted"><div class="gmail-code-block gmail-ng-tns-c4170956601-75 gmail-ng-animate-disabled gmail-ng-trigger gmail-ng-trigger-codeBlockRevealAnimation"><div class="gmail-formatted-code-block-internal-container gmail-ng-tns-c4170956601-75"><div class="gmail-animated-opacity gmail-ng-tns-c4170956601-75"><pre class="gmail-ng-tns-c4170956601-75"><code role="text" class="gmail-code-container gmail-formatted gmail-ng-tns-c4170956601-75">flashkit create xdmf --auto
</code></pre></div></div></div></span></span></li><li><p>This generates an <code>.xmf</code> file linking your <code>.plt</code> and <code>.grd</code> files.</p></li></ul></li><li><p><b>Visualize:</b>
Ensure the generated XDMF, <code>.plt</code>, and <code>.grd</code> files are in the same directory, then open the XDMF file in <b>ParaView</b>.</p></li></ol><p>If you run into any issues implementing this, feel free to email me.</p><p>Best regards,</p><p>Seyed</p><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 5, 2026 at 11:16 AM Seyed Mohammadamin Taleghani <<a href="mailto:mtalegha@umd.edu" target="_blank">mtalegha@umd.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p>Dear FLASH Users,</p><p>I am running an AMR simulation with FLASH 4.8 (PARAMESH) and would like to visualize the results in ParaView.</p><p>I would like to ask the community about the recommended or supported workflows for using ParaView with FLASH AMR output. If there is existing documentation, example scripts, or recommended approaches, I would greatly appreciate pointers.</p><p>Thank you very much for your time and help.</p><p>Best regards,</p><p>Seyed</p></div>
</blockquote></div></div>
</div>