<div dir="ltr"><div>Dear Petsc developers,</div><div><br></div><div>I am trying to learn about the mesh refinement part. <br></div><div>I tried to follow the instructions from the website, "Meshing for Subsurface Flows in PETSc,</div><div>make -f ./gmakefile test globsearch="dm_impls_plex_tutorials-ex10_0",</div><div>but it will run many tests and will not deliver "</div><div><pre id="gmail-codecell1"><span class="gmail-n"><a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DM/DM/__;!!G_uCfscf7eWS!aTuEZNwxZ2ve5zOYEu5SDetjZlPcfc2PSiSmVCUcExxOERlForddvBHJQsxjVbpj-Nj9CGeSJ_mMEQGBDsVPPQ$">DM</a></span><span class="gmail-w"> </span><span class="gmail-n">Object</span><span class="gmail-o">:</span><span class="gmail-w"> </span><span class="gmail-n">Mesh</span><span class="gmail-w"> </span><span class="gmail-mi">1</span><span class="gmail-w"> </span><span class="gmail-n">MPI</span><span class="gmail-w"> </span><span class="gmail-n">process</span>
<span class="gmail-w"> </span><span class="gmail-nl">type</span><span class="gmail-p">:</span><span class="gmail-w"> </span><span class="gmail-n">plex</span>
<span class="gmail-n">Mesh</span><span class="gmail-w"> </span><span class="gmail-n">in</span><span class="gmail-w"> </span><span class="gmail-mi">3</span><span class="gmail-w"> </span><span class="gmail-n">dimensions</span><span class="gmail-o">:</span>
<span class="gmail-w"> </span><span class="gmail-n">Number</span><span class="gmail-w"> </span><span class="gmail-n">of</span><span class="gmail-w"> </span><span class="gmail-mi">0</span><span class="gmail-o">-</span><span class="gmail-n">cells</span><span class="gmail-w"> </span><span class="gmail-n">per</span><span class="gmail-w"> </span><span class="gmail-n">rank</span><span class="gmail-o">:</span><span class="gmail-w"> </span><span class="gmail-mi">8</span>
<span class="gmail-w"> </span><span class="gmail-n">Number</span><span class="gmail-w"> </span><span class="gmail-n">of</span><span class="gmail-w"> </span><span class="gmail-mi">1</span><span class="gmail-o">-</span><span class="gmail-n">cells</span><span class="gmail-w"> </span><span class="gmail-n">per</span><span class="gmail-w"> </span><span class="gmail-n">rank</span><span class="gmail-o">:</span><span class="gmail-w"> </span><span class="gmail-mi">14</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">4</span><span class="gmail-p">)</span>
<span class="gmail-w"> </span><span class="gmail-n">Number</span><span class="gmail-w"> </span><span class="gmail-n">of</span><span class="gmail-w"> </span><span class="gmail-mi">2</span><span class="gmail-o">-</span><span class="gmail-n">cells</span><span class="gmail-w"> </span><span class="gmail-n">per</span><span class="gmail-w"> </span><span class="gmail-n">rank</span><span class="gmail-o">:</span><span class="gmail-w"> </span><span class="gmail-mi">9</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">5</span><span class="gmail-p">)</span>
<span class="gmail-w"> </span><span class="gmail-n">Number</span><span class="gmail-w"> </span><span class="gmail-n">of</span><span class="gmail-w"> </span><span class="gmail-mi">3</span><span class="gmail-o">-</span><span class="gmail-n">cells</span><span class="gmail-w"> </span><span class="gmail-n">per</span><span class="gmail-w"> </span><span class="gmail-n">rank</span><span class="gmail-o">:</span><span class="gmail-w"> </span><span class="gmail-mi">2</span>
<span class="gmail-nl">Labels</span><span class="gmail-p">:</span>
<span class="gmail-w"> </span><span class="gmail-nl">celltype</span><span class="gmail-p">:</span><span class="gmail-w"> </span><span class="gmail-mi">6</span><span class="gmail-w"> </span><span class="gmail-n">strata</span><span class="gmail-w"> </span><span class="gmail-n">with</span><span class="gmail-w"> </span><span class="gmail-n">value</span><span class="gmail-o">/</span><span class="gmail-n">size</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">3</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">4</span><span class="gmail-p">),</span><span class="gmail-w"> </span><span class="gmail-mi">9</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">2</span><span class="gmail-p">),</span><span class="gmail-w"> </span><span class="gmail-mi">0</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">8</span><span class="gmail-p">),</span><span class="gmail-w"> </span><span class="gmail-mi">2</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">4</span><span class="gmail-p">),</span><span class="gmail-w"> </span><span class="gmail-mi">1</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">10</span><span class="gmail-p">),</span><span class="gmail-w"> </span><span class="gmail-mi">5</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">5</span><span class="gmail-p">))</span>
<span class="gmail-w"> </span><span class="gmail-nl">depth</span><span class="gmail-p">:</span><span class="gmail-w"> </span><span class="gmail-mi">4</span><span class="gmail-w"> </span><span class="gmail-n">strata</span><span class="gmail-w"> </span><span class="gmail-n">with</span><span class="gmail-w"> </span><span class="gmail-n">value</span><span class="gmail-o">/</span><span class="gmail-n">size</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">0</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">8</span><span class="gmail-p">),</span><span class="gmail-w"> </span><span class="gmail-mi">1</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">14</span><span class="gmail-p">),</span><span class="gmail-w"> </span><span class="gmail-mi">2</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">9</span><span class="gmail-p">),</span><span class="gmail-w"> </span><span class="gmail-mi">3</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">2</span><span class="gmail-p">))</span>
<span class="gmail-w"> </span><span class="gmail-nl">marker</span><span class="gmail-p">:</span><span class="gmail-w"> </span><span class="gmail-mi">1</span><span class="gmail-w"> </span><span class="gmail-n">strata</span><span class="gmail-w"> </span><span class="gmail-n">with</span><span class="gmail-w"> </span><span class="gmail-n">value</span><span class="gmail-o">/</span><span class="gmail-n">size</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">1</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">24</span><span class="gmail-p">))</span>
<span class="gmail-w"> </span><span class="gmail-n">Face</span><span class="gmail-w"> </span><span class="gmail-n">Sets</span><span class="gmail-o">:</span><span class="gmail-w"> </span><span class="gmail-mi">1</span><span class="gmail-w"> </span><span class="gmail-n">strata</span><span class="gmail-w"> </span><span class="gmail-n">with</span><span class="gmail-w"> </span><span class="gmail-n">value</span><span class="gmail-o">/</span><span class="gmail-n">size</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">1</span><span class="gmail-w"> </span><span class="gmail-p">(</span><span class="gmail-mi">12</span><span class="gmail-p">))</span></pre></div><div>"</div><div>While it is successful if I go to the directory for ex10 and make ex10 there and run with options there. DId I miss something? <br></div><div><br></div><div>In addition, in order t view the mesh, I added the following lines to ex10.c, <br></div><div><br></div><div><div style="color:rgb(204,204,204);background-color:rgb(31,31,31);font-family:"Droid Sans Mono","monospace",monospace;font-weight:normal;font-size:14px;line-height:19px;white-space:pre"><div><span style="color:rgb(106,153,85)">// Create HDF5 viewer</span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(86,156,214)">PetscViewer</span><span style="color:rgb(204,204,204)"> viewer;</span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(86,156,214)">const</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(86,156,214)">char</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(212,212,212)">*</span><span style="color:rgb(156,220,254)">filename</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(206,145,120)">"mesh.h5"</span><span style="color:rgb(204,204,204)">;</span><span style="color:rgb(106,153,85)"> // Output file</span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(220,220,170)">PetscViewerCreate</span><span style="color:rgb(204,204,204)">(PETSC_COMM_WORLD, </span><span style="color:rgb(212,212,212)">&</span><span style="color:rgb(204,204,204)">viewer);</span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(220,220,170)">PetscViewerSetType</span><span style="color:rgb(204,204,204)">(viewer, </span><span style="color:rgb(86,156,214)">PETSCVIEWERHDF5</span><span style="color:rgb(204,204,204)">);</span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(220,220,170)">PetscViewerFileSetMode</span><span style="color:rgb(204,204,204)">(viewer, FILE_MODE_WRITE);</span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(220,220,170)">PetscViewerFileSetName</span><span style="color:rgb(204,204,204)">(viewer, </span><span style="color:rgb(156,220,254)">filename</span><span style="color:rgb(204,204,204)">);</span></div><br><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(106,153,85)">// Optionally set the name of the DM object if you are saving multiple meshes</span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(220,220,170)">PetscObjectSetName</span><span style="color:rgb(204,204,204)">((</span><span style="color:rgb(86,156,214)">PetscObject</span><span style="color:rgb(204,204,204)">)dm, </span><span style="color:rgb(206,145,120)">"MyMeshName"</span><span style="color:rgb(204,204,204)">);</span></div><br><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(106,153,85)">// Save DM to HDF5 file</span></div><div><span style="color:rgb(204,204,204)"> </span><span style="color:rgb(220,220,170)">DMView</span><span style="color:rgb(204,204,204)">(</span><span style="color:rgb(156,220,254)">dm</span><span style="color:rgb(204,204,204)">, viewer);</span></div></div></div><div><br></div><div>This wil genearte a .h5 file. Then I run <br></div><div>petsc-with-docs-3.21.1/petsc-3.21.1/lib/petsc/bin/petsc_gen_xdmf.py mesh.h5 <br></div><div><br></div><div>This gave a .xml file. I tried to load this xml file into paraview using xdmf reader. But it was not successful. Did I miss something ?</div><div><br></div><div>Thanks a lot,</div><div><br></div><div>Xiaodong<br></div><div><br></div></div>