[petsc-dev] Get DMLabel "name" from DMLabel Object

Brandon Denton bldenton at buffalo.edu
Thu May 25 08:42:35 CDT 2023

Good Morning,

Is there a way to get the given "name" of a label if you have the DMLabel

For instance, in my code I have a DM with a set of labels with given names
(i.e. "boundary", "top", "bottom", etc.).  I've gotten the DMLabel Object
by calling:

PetscCall(DMGetLabel(dm, "boundary", &boundLabel));

I've passed this object to a function. In the function, I would like to
perform an if statement based on the name of the label. Is there a way to
get the STRING name of the DMLabel from its object?

I'm looking to update the DMLabelPermuteValues() within PETSc to handle a
special case associated with attached CAD objects. In this case, the IDs of
the CAD use a 1-basis but the DMLabelPermuteValues() function uses the
0-basis for arrays. Since the CAD architecture is PETSc native, I think it
would be best to incorporate this special case into DMLabelPermuteValues().

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20230525/162b6666/attachment.html>

More information about the petsc-dev mailing list