<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>
<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><div><br></div><div>Fande,</div><div><br></div></div>