<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Nov 2, 2018 at 12:11 PM 陳宗興 via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,</div><div dir="ltr"><br><div>I have created a DMPlex using DMPlexCreateFromFile,</div><div>and I use PetscObjectSetName to create the name of DM.</div><div>I have occurred some problem when I try to use PetscViewerVTKGetDM.</div><div>This is what I write:</div><div><br></div><div> DM dm;</div><div> ...</div><div> PetscObjectSetName((PetscObject) dm, "Mesh");</div><div> ...</div><div> PetscViewerVTKGetDM(viewer, (PetscObject) dm);</div></div></div></div></div></div></div></div></div></blockquote><div><br></div><div>1) GetDM() returns a DM, so you would need PetscViewerVTKGetDM(viewer, (PetscObject *) &dm)</div><div><br></div><div>2) However, why are you trying to pull out a DM? It does not look like you want to do this.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>And here is the output of waring:</div><div> warning: passing argument 2 of ‘PetscViewerVTKGetDM’ from incompatible pointer type [-Wincompatible-pointer-types]</div><div> ierr = PetscViewerVTKGetDM(viewer, (PetscObject) dm);CHKERRQ(ierr);</div><div> ^</div><div> note: expected ‘struct _p_PetscObject **’ but argument is of type ‘struct _p_PetscObject *'</div><div> PETSC_EXTERN PetscErrorCode PetscViewerVTKGetDM(PetscViewer,PetscObject*);</div><div> ^~~~~~~~~~~~~~~~~~~</div><div><br></div><div>How can I fix it?</div><div><br></div><div>Thank you,</div><div><br></div><div>Barry</div><div><br></div><div><br></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>