<div dir="ltr"><div>I tried vtk format by modifying the line as follows.</div><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(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)">PETSCVIEWERVTK</span><span style="color:rgb(204,204,204)">);</span></div></div></div></div><div>The resulting vtk file can be loaded into Paraview.</div><div>But the mesh is different from the website. <br></div><div>With</div><div>./ex10 -init_dm_plex_dim 2 -init_dm_plex_box_faces 5,5 -dm_extrude 10, the mesh is ,<br></div><div><img src="cid:ii_m0tbjk393" alt="Screenshot from 2024-09-08 04-34-35.png" width="428" height="385"></div><div>WIth adapt, <br></div><div>./ex10 -init_dm_plex_dim 2 -init_dm_plex_box_faces 5,5 -adapt -volume_constraint_1 0.01 -volume_constraint_2 0.000625<br> -dm_extrude 10</div><div><img src="cid:ii_m0tbkh544" alt="Screenshot from 2024-09-08 04-35-45.png" width="428" height="386"><br></div><div>The refined mesh is quite different from the website,<br></div><div><img src="cid:ii_m0tblt2n5" alt="Screenshot from 2024-09-08 04-36-46.png" width="498" height="314"></div><div>Did I miss something?</div><div><br></div><div>Thanks a lot, <br></div><div><br></div><div>Xiaodong <br></div><div><br></div><div><br><br><br><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 7, 2024 at 10:28 PM neil liu <<a href="mailto:liufield@gmail.com">liufield@gmail.com</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"><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="m_3752436250964957725gmail-codecell1"><span><a href="https://urldefense.us/v3/__https://petsc.org/release/manualpages/DM/DM/__;!!G_uCfscf7eWS!fEB4awHydwk05afkf23E0BBU-hsKQ64jWyjFeLeutob8dtqAaoG5vm2YhFycJT68ayRrurMOqg6goMZ2LrMu6Q$" target="_blank">DM</a></span><span> </span><span>Object</span><span>:</span><span> </span><span>Mesh</span><span> </span><span>1</span><span> </span><span>MPI</span><span> </span><span>process</span>
<span> </span><span>type</span><span>:</span><span> </span><span>plex</span>
<span>Mesh</span><span> </span><span>in</span><span> </span><span>3</span><span> </span><span>dimensions</span><span>:</span>
<span> </span><span>Number</span><span> </span><span>of</span><span> </span><span>0</span><span>-</span><span>cells</span><span> </span><span>per</span><span> </span><span>rank</span><span>:</span><span> </span><span>8</span>
<span> </span><span>Number</span><span> </span><span>of</span><span> </span><span>1</span><span>-</span><span>cells</span><span> </span><span>per</span><span> </span><span>rank</span><span>:</span><span> </span><span>14</span><span> </span><span>(</span><span>4</span><span>)</span>
<span> </span><span>Number</span><span> </span><span>of</span><span> </span><span>2</span><span>-</span><span>cells</span><span> </span><span>per</span><span> </span><span>rank</span><span>:</span><span> </span><span>9</span><span> </span><span>(</span><span>5</span><span>)</span>
<span> </span><span>Number</span><span> </span><span>of</span><span> </span><span>3</span><span>-</span><span>cells</span><span> </span><span>per</span><span> </span><span>rank</span><span>:</span><span> </span><span>2</span>
<span>Labels</span><span>:</span>
<span> </span><span>celltype</span><span>:</span><span> </span><span>6</span><span> </span><span>strata</span><span> </span><span>with</span><span> </span><span>value</span><span>/</span><span>size</span><span> </span><span>(</span><span>3</span><span> </span><span>(</span><span>4</span><span>),</span><span> </span><span>9</span><span> </span><span>(</span><span>2</span><span>),</span><span> </span><span>0</span><span> </span><span>(</span><span>8</span><span>),</span><span> </span><span>2</span><span> </span><span>(</span><span>4</span><span>),</span><span> </span><span>1</span><span> </span><span>(</span><span>10</span><span>),</span><span> </span><span>5</span><span> </span><span>(</span><span>5</span><span>))</span>
<span> </span><span>depth</span><span>:</span><span> </span><span>4</span><span> </span><span>strata</span><span> </span><span>with</span><span> </span><span>value</span><span>/</span><span>size</span><span> </span><span>(</span><span>0</span><span> </span><span>(</span><span>8</span><span>),</span><span> </span><span>1</span><span> </span><span>(</span><span>14</span><span>),</span><span> </span><span>2</span><span> </span><span>(</span><span>9</span><span>),</span><span> </span><span>3</span><span> </span><span>(</span><span>2</span><span>))</span>
<span> </span><span>marker</span><span>:</span><span> </span><span>1</span><span> </span><span>strata</span><span> </span><span>with</span><span> </span><span>value</span><span>/</span><span>size</span><span> </span><span>(</span><span>1</span><span> </span><span>(</span><span>24</span><span>))</span>
<span> </span><span>Face</span><span> </span><span>Sets</span><span>:</span><span> </span><span>1</span><span> </span><span>strata</span><span> </span><span>with</span><span> </span><span>value</span><span>/</span><span>size</span><span> </span><span>(</span><span>1</span><span> </span><span>(</span><span>12</span><span>))</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-wrap"><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>
</blockquote></div>