[petsc-users] DMPlexUniformRefine
Fande Kong
fande.kong at colorado.edu
Tue Apr 14 11:13:28 CDT 2015
Hi all,
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:
#undef __FUNCT__
#define __FUNCT__ "main"
int main(int argc, char **argv)
{
DM dm,pdm, refinedMesh; /* Problem specification */
AppCtx user; /* user-defined work context */
PetscErrorCode ierr;
ierr = PetscInitialize(&argc, &argv, NULL, help);CHKERRQ(ierr);
/*ierr = CreateMesh(PETSC_COMM_WORLD, &user, &dm);CHKERRQ(ierr);*/
ierr = DMPlexCreateExodusFromFile(PETSC_COMM_WORLD, "./Tet4.exo",
PETSC_FALSE, &dm);CHKERRQ(ierr);
ierr = DMPlexDistribute(dm, "metis", 0, NULL, &pdm);CHKERRQ(ierr);
ierr = DMDestroy(&dm);CHKERRQ(ierr);
ierr = DMPlexSetRefinementUniform(pdm, PETSC_TRUE);CHKERRQ(ierr);
ierr = DMRefine(pdm, PETSC_COMM_WORLD, &refinedMesh);CHKERRQ(ierr);
ierr = DMDestroy(&pdm);CHKERRQ(ierr);
ierr = DMDestroy(&refinedMesh);CHKERRQ(ierr);
ierr = PetscFinalize();
return 0;
}
The mesh file is also attached.
Fande,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150414/0e54d79a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Tet4.exo
Type: application/octet-stream
Size: 7556 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150414/0e54d79a/attachment.obj>
More information about the petsc-users
mailing list