[petsc-dev] DMPlexCreate* and DMPlexInterpolate

Vaclav Hapla vaclav.hapla at erdw.ethz.ch
Tue Dec 5 05:33:44 CST 2017



> 5. 12. 2017 v 12:29, Matthew Knepley <knepley at gmail.com>:
> 
> On Mon, Dec 4, 2017 at 1:06 PM, Matthew Knepley <knepley at gmail.com <mailto:knepley at gmail.com>> wrote:
> On Fri, Dec 1, 2017 at 11:10 AM, Vaclav Hapla <vaclav.hapla at erdw.ethz.ch <mailto:vaclav.hapla at erdw.ethz.ch>> wrote:
> 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.
> 
> Yes.
>  
> 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.
> 
> Yes.
>  
> BTW I think it's kind of weird the output DM passed to DMPlexInterpolate must me nullified - cf. MatReuse.
> 
> Yes. My original motivation turned out to be not important. I will get rid of it.
> 
> I will make all changes in a branch and push to next.
> 
> It is here.
> 
>   https://bitbucket.org/petsc/petsc/branch/knepley/fix-plex-interpolation-consistency <https://bitbucket.org/petsc/petsc/branch/knepley/fix-plex-interpolation-consistency>
> 
>    Matt

It looks good, thanks!

Vaclav

>  
>   Thanks,
> 
>      Matt
>  
> 
> Vaclav
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener
> 
> https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>
> 
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener
> 
> https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20171205/836260ed/attachment.html>


More information about the petsc-dev mailing list