<div dir="ltr"><div><br></div>Greetings<div>I am try to use DMRefine to refine a dm I create with DMPlexCreateBoxMesh with tonight's checkout. A quick glance at the DMView output from the DM's shows that the refinedMesh looks a lot like the original dm. DMGetRefineLevel returns 1 though. I must be missing something elementary here. Can someone please confirm if there are any glaring mistakes I made? Also if I want to refine and distribute, should I refine on a single processor then distribute or can I refine a couple of times, distribute, and refine some more?</div>
<div><br></div><div>The test code looks as follows:</div><div><br></div><div><div> program testRefine</div><div> implicit none</div><div>#include "finclude/petsc.h90"</div><div> DM :: dm</div><div>
DM :: refinedMesh</div><div> PetscInt :: r</div><div><br></div><div> PetscInt :: dim</div><div> PetscBool :: interpolate</div><div> PetscErrorCode :: ierr</div><div><br></div><div> call PetscInitialize(PETSC_NULL_CHARACTER, ierr)</div>
<div> CHKERRQ(ierr)</div><div> dim = 2</div><div> interpolate = PETSC_TRUE</div><div>! Create a mesh</div><div> call DMPlexCreateBoxMesh(PETSC_COMM_WORLD, dim, interpolate, dm,</div><div> $ ierr)</div>
<div> CHKERRQ(ierr)</div><div><br></div><div> call DMView(dm, PETSC_VIEWER_STDOUT_WORLD, ierr)</div><div> CHKERRQ(ierr)</div><div><br></div><div><br></div><div> call DMRefine(dm, PETSC_COMM_WORLD, refinedMesh, ierr)</div>
<div> CHKERRQ(ierr)</div><div><br></div><div> call DMView(refinedMesh, PETSC_VIEWER_STDOUT_WORLD, ierr)</div><div> CHKERRQ(ierr)</div><div><br></div><div> call DMGetRefineLevel(refinedMesh, r, ierr)</div>
<div> write (*,*) "The value of r is:", r</div><div><br></div><div> call DMDestroy(dm, ierr)</div><div> call DMDestroy(refinedMesh, ierr)</div><div> CHKERRQ(ierr)</div><div><br></div><div> call PetscFinalize(ierr)</div>
<div> end program testRefine</div><div><br></div><div><br clear="all"><div><br></div><div>And the output:</div><div><div>DM_0x1122bb0_0 in 2 dimensions:</div><div> 0-cells: 9</div><div> 1-cells: 16</div><div> 2-cells: 8</div>
<div>Labels:</div><div> marker: 2 strata of sizes (16, 5)</div><div> depth: 3 strata of sizes (9, 16, 8)</div><div>DM_0x1122bb0_1 in 2 dimensions:</div><div> 0-cells: 9</div><div> 1-cells: 16</div><div> 2-cells: 8</div>
<div>Labels:</div><div> marker: 2 strata of sizes (16, 1)</div><div> depth: 3 strata of sizes (9, 16, 8)</div><div> The value of r is: 1</div></div><div><br></div><div><br></div><div><br></div><div><br></div>
<div>
<br></div><div><br></div><div><br>Regards<br>Yaakoub El Khamra<br></div>
</div>
</div></div>