Hello, I'm running into the issue of not being able to handle boundary conditions properly in a distributed DM(Plex).
The DMPlex is built from a mesh file and distributed: DMCreate(PETSC_COMM_WORLD, &dm) DMSetType(&dm, DMPLEX) DMSetFromOptinos(...) ... DMPlexDistribute(dm, 0, NULL, %dm_d) ... This DM also contains some user-defined labels, used for applying BC. These labels are also distributed, so they exist in some rank(s) but not in other(s). Then a section is created with DMPlexCreateSection, where the IS input arguments bcComps, bcPoints are built with ISCreateGeneral(PETSC_COMM_SELF, ...), somewhat following the tutorial plex/tutorials/ex1f90.F90. Finally boundary condition values are written to different Vecs by getting an array VecGetArray() and writing into the appropriate entry (DoF) which is computed based on the DoFs and offsets (PetscSectionGetFieldDof(), PetscSectionGetFieldOffset()): loop through labels loop through points in labels compute entry with dof/offset write value A vertex belonging to more than one MPI rank gets, from the loop above, the right BC value from some rank(s), but not other(s); understandably, I believe, given that the labels and sections are local. Is there a way to address this issue? - Build the sections differently? ISCreateGeneral does not work with PETSC_COMM_WORLD. - Perform some rank communication after setting up each rank's section? - Distribute labels to all ranks? Seems redundant, various ranks building the same Vec entries; but it could be a solution. - Update Vecs after building from the loop above (LocalToGlobal or similar)? Cannot use ADD_VALUES (vertex can belong to more than one rank); does INSERT_VALUES work when ranks have different values? Thank you, --- N.
