DMClone does not correctly handle coordinates for isoperiodic face SF
DMPlexSetIsoperiodicFaceSF
currently has this bit of logic that causes coordinates to know about the affine map, but it's only triggered when coordinates are set. It currently gets called in DMClone_Plex
, before DMClone
handles coordinates. Since it's Plex-specific, we'd rather not call it in DMClone
, but that might be the right approach.
DM cdm = dm->coordinates[0].dm; // Can't DMGetCoordinateDM because it automatically creates one
if (cdm) {
PetscCall(DMPlexSetIsoperiodicFaceSF(cdm, face_sf));
if (face_sf) cdm->periodic.setup = DMPeriodicCoordinateSetUp_Internal;
}
@knepley Do you have a preference?
Edited by Jed Brown