[petsc-dev] DMPlexCreate* and DMPlexInterpolate
Vaclav Hapla
vaclav.hapla at erdw.ethz.ch
Fri Dec 1 10:10:18 CST 2017
Hello
I noticed DMPlexCreateFromFile ignores the interpolate flag for HDF5. It's the only format for which PetscViewer API is used for loading, and this API has no means to specify interpolation. I guess there should be at least
if (interpolate) {
DM idm = NULL;
ierr = DMPlexInterpolate(*dm, &idm);CHKERRQ(ierr);
ierr = DMPlexCopyCoordinates(*dm, idm);CHKERRQ(ierr);
ierr = DMCopyLabels(*dm, idm);CHKERRQ(ierr);
ierr = DMDestroy(dm);CHKERRQ(ierr);
*dm = idm;
}
in DMPlexCreateFromFile after the DMLoad call.
This brings me to more general thing to discuss. The behavior of different mesh constructors for interpolate=PETSC_TRUE is not unified. The most elaborate behavior is in DMPlexCreateDoublet which after DMPlexInterpolate also copies the DM name, coordinates and labels. So I suggest all this stuff is done in DMPlexInterpolate.
BTW I think it's kind of weird the output DM passed to DMPlexInterpolate must me nullified - cf. MatReuse.
Vaclav
More information about the petsc-dev
mailing list