<div dir="ltr">Dear PETSc developer team,<br><br>Hi, this is a follow-up question regarding generating sub-dm for surface from the original volumetric dm (<a href="https://lists.mcs.anl.gov/pipermail/petsc-users/2023-March/048263.html">https://lists.mcs.anl.gov/pipermail/petsc-users/2023-March/048263.html</a>).<br><br>I have created a short code as written below as a piece of it to create a sub-dm on the surface, extracted from the original volume dmplex:<br><br>-------------------------------------<br> call DMClone(dm_origin, dm_wall, ierr);CHKERRA(ierr)<br><br> ! label for face sets<br> call DMGetLabel(dm_wall, "Face Sets", label_facesets, ierr);CHKERRA(ierr)<br> call DMPlexLabelComplete(dm_wall, label_facesets, ierr);CHKERRA(ierr)<br><br> ! label for vertex on surface<br> call DMCreateLabel(dm_wall, "Wall", ierr);CHKERRA(ierr)<br> call DMGetLabel(dm_wall, "Wall", label_surf, ierr);CHKERRA(ierr)<br> call DMPlexGetChart(dm_wall, ist, iend, ierr);CHKERRA(ierr)<br> do i=ist,iend<br> call DMLabelGetValue(label_facesets, i, val, ierr);CHKERRA(ierr)<br> if(val .eq. ID_wall) then<br> call DMLabelSetValue(label_surf, i, ID_wall, ierr);CHKERRA(ierr)<br> endif<br> enddo<br> call DMPlexLabelComplete(dm_wall, label_surf, ierr);CHKERRA(ierr)<br><br> ! create submesh<br> call DMPlexCreateSubmesh(dm_wall, label_surf, ID_wall, PETSC_TRUE, dm_sub, ierr);CHKERRA(ierr)<br> call DMPlexGetSubpointMap(dm_sub, label_sub, ierr);CHKERRA(ierr)<br>-------------------------------------<br><br>Now I can define a vector on dm_sub and view it via PETSc_Viewer. However, it is unclear how to map a vector defined on the volumetric dm (dm_wall) into a vector defined on the surface dm (dm_sub). I guess label_sub created via DMPlexGetSubpointMap() can help with it, but it is difficult to get a solid picture without an example. Could I get a comment for it? <br><br>Thanks,<br>Mike<br></div>