[petsc-users] dmplex extrude in parallel

Bhargav Subramanya bhargav.subramanya at kaust.edu.sa
Tue Nov 9 08:47:52 CST 2021


Dear All,

I want to generate a prismatic mesh from a base spherical surface mesh. I
first refine the base icosahedron sequential mesh to some extent,
distribute the mesh, continue the refinement in parallel, project the mesh
to a unit sphere, and then finally extrude the mesh. The following is the
code I am using. As the extrusion is performed in parallel, the extruded
mesh seems to be broken as shown in the attached figure. May I know how to
get an intact extruded mesh in parallel? Also, is it possible to make mesh
refinement respect the spherical surface geometry, without having to
project it using a function as shown below?

Thanks,
Bhargav

/* refine the sequential mesh first */
for (int r = 0; r < numRefinePre; ++r) {
DM rdm = NULL;
DMRefine(dm, MPI_COMM_WORLD, &rdm);
DMDestroy(&dm);
dm = rdm;
 }

/* project to a unit sphere */
ierr = ProjectToUnitSphere(dm); CHKERRQ(ierr);

/* create and distribute DM */
ierr = DMPlexDistribute(dm, 0, NULL, &dmDist);CHKERRQ(ierr);
if (dmDist) {
DMDestroy(&dm);
dm   = dmDist;
}

/* refine the mesh in parallel */
for (int r = 0; r < numRefine; ++r) {
DM rdm = NULL;
DMRefine(dm, MPI_COMM_WORLD, &rdm);
DMDestroy(&dm);
dm = rdm;
 }

/* project to a unit sphere */
ierr = ProjectToUnitSphere(dm); CHKERRQ(ierr);

ierr = DMPlexExtrude(dm, numLayers-1, radialThickness, PETSC_FALSE, NULL,
PETSC_TRUE, &dm3D);CHKERRQ(ierr);

if (dm3D) {
DMDestroy(&dm);
dm = dm3D;
}

-- 

This message and its contents, including attachments are intended solely 
for the original recipient. If you are not the intended recipient or have 
received this message in error, please notify me immediately and delete 
this message from your computer system. Any unauthorized use or 
distribution is prohibited. Please consider the environment before printing 
this email.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20211109/9b6cc424/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extruded-mesh.pdf
Type: application/pdf
Size: 15372160 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20211109/9b6cc424/attachment-0001.pdf>


More information about the petsc-users mailing list