<div dir="ltr">Thanks. It does work now.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 14, 2015 at 10:27 AM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@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 class="gmail_extra"><div class="gmail_quote"><span class="">On Tue, Apr 14, 2015 at 11:13 AM, Fande Kong <span dir="ltr"><<a href="mailto:fande.kong@colorado.edu" target="_blank">fande.kong@colorado.edu</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">Hi all,<div><br></div><div>I have several lines of code to read a mesh and uniformly refine it. DMPlex can not uniformly refine it. I am using PETSc-3.5.3. The code is very simple like follows:</div><div><br></div><div><p style="margin:0px;font-size:11px;font-family:Monaco"><span style="color:rgb(147,26,104)">#undef</span> __FUNCT__</p>
<p style="margin:0px;font-size:11px;font-family:Monaco"><span style="color:rgb(147,26,104)">#define</span> __FUNCT__ <span style="color:rgb(57,51,255)">"main"</span></p>
<p style="margin:0px;font-size:11px;font-family:Monaco"><span style="color:rgb(147,26,104)">int</span> main(<span style="color:rgb(147,26,104)">int</span> argc, <span style="color:rgb(147,26,104)">char</span> **argv)</p>
<p style="margin:0px;font-size:11px;font-family:Monaco">{</p>
<p style="margin:0px;font-size:11px;font-family:Monaco">  <span style="text-decoration:underline">DM</span>             dm,pdm, refinedMesh;          <span style="color:rgb(78,144,114)">/* Problem specification */</span></p>
<p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(78,144,114)"><span style="color:rgb(0,0,0)">  </span><span style="color:rgb(0,97,65)">AppCtx</span><span style="color:rgb(0,0,0)">         user;        </span>/* user-defined work context */</p>
<p style="margin:0px;font-size:11px;font-family:Monaco">  <span style="text-decoration:underline">PetscErrorCode</span> ierr;</p>
<p style="margin:0px;font-size:11px;font-family:Monaco;min-height:15px"><br></p>
<p style="margin:0px;font-size:11px;font-family:Monaco">  ierr = PetscInitialize(&argc, &argv, <span style="text-decoration:underline">NULL</span>, help);CHKERRQ(ierr);</p>
<p style="margin:0px;font-size:11px;font-family:Monaco;min-height:15px"><br></p>
<p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(78,144,114)"><span style="color:rgb(0,0,0)">  </span>/*<span style="text-decoration:underline">ierr</span> = CreateMesh(PETSC_COMM_WORLD, &user, <span style="text-decoration:underline">&dm</span>);CHKERRQ(<span style="text-decoration:underline">ierr</span>);*/</p>
<p style="margin:0px;font-size:11px;font-family:Monaco;min-height:15px"><br></p>
<p style="margin:0px;font-size:11px;font-family:Monaco">  ierr = DMPlexCreateExodusFromFile(<span style="text-decoration:underline">PETSC_COMM_WORLD</span>, <span style="color:rgb(57,51,255)">"./Tet4.</span><span style="text-decoration:underline;color:rgb(57,51,255)">exo</span><span style="color:rgb(57,51,255)">"</span>, <span style="text-decoration:underline">PETSC_FALSE</span>, &dm);CHKERRQ(ierr);</p></div></div></blockquote></span><div>                                                                                                                                ^^^^^^^^^^^^ Use PETSC_TRUE</div><div><br></div><div>   Matt</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>
<p style="margin:0px;font-size:11px;font-family:Monaco">  ierr = DMPlexDistribute(dm, <span style="color:rgb(57,51,255)">"</span><span style="text-decoration:underline;color:rgb(57,51,255)">metis</span><span style="color:rgb(57,51,255)">"</span>, 0, <span style="text-decoration:underline">NULL</span>, &pdm);CHKERRQ(ierr);</p>
<p style="margin:0px;font-size:11px;font-family:Monaco">  ierr = DMDestroy(&dm);CHKERRQ(ierr);</p>
<p style="margin:0px;font-size:11px;font-family:Monaco">  ierr = DMPlexSetRefinementUniform(pdm, <span style="text-decoration:underline">PETSC_TRUE</span>);CHKERRQ(ierr);</p>
<p style="margin:0px;font-size:11px;font-family:Monaco">  ierr = DMRefine(pdm, <span style="text-decoration:underline">PETSC_COMM_WORLD</span>, &refinedMesh);CHKERRQ(ierr);</p>
<p style="margin:0px;font-size:11px;font-family:Monaco">  ierr = DMDestroy(&pdm);CHKERRQ(ierr);</p>
<p style="margin:0px;font-size:11px;font-family:Monaco">  ierr = DMDestroy(&refinedMesh);CHKERRQ(ierr);</p>
<p style="margin:0px;font-size:11px;font-family:Monaco;min-height:15px"><br></p>
<p style="margin:0px;font-size:11px;font-family:Monaco">  ierr = PetscFinalize();</p>
<p style="margin:0px;font-size:11px;font-family:Monaco;min-height:15px"><br></p>
<p style="margin:0px;font-size:11px;font-family:Monaco;color:rgb(147,26,104)"><span style="color:rgb(0,0,0)">  </span>return<span style="color:rgb(0,0,0)"> 0;</span></p>
<p style="margin:0px;font-size:11px;font-family:Monaco">}</p></div><div><br></div><div><br></div><div>The mesh file is also attached.</div><span><font color="#888888"><div><br></div><div>Fande,</div><div><br></div></font></span></div>
</blockquote></span></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</font></span></div></div>
</blockquote></div><br></div>