Skip to content

DMGetStratumIS: return an empty IS when the label or stratum do not exist

Blaise Bourdin requested to merge bourdin/DMGetStratumIS-emptyIS into main

The behaviour of DMGetLabelIdIS and DMGetStratumIS are inconsistent when the label ID / stratum does not exist DMGetLabelIdIS returns an empty IS, returns NULL I argue that the former is superior, since it saves from having to add a test for NULL in a standard look

  PetscCall(DMGetStratumIS(dm,"label",ID,&is));
  PetscCall(ISGetIndices(is,&ids));
  /* do something with ids */
Edited by Blaise Bourdin

Merge request reports