<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Nov 2, 2018 at 1:06 PM 陳宗興 <<a href="mailto:barrydog505@gmail.com">barrydog505@gmail.com</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">I want to create a VTK file with DMPlex and Vec, and I found these function:<div>PetscViewerVTKOpen,</div></div></blockquote><div><br></div><div>Call VTKOpen() to get a PetscViewer object</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> PetscViewerVTKGetDM, and PetscViewerVTKWriteFunction</div></div></blockquote><div><br></div><div>Forget these.</div><div><br></div><div>Call VecView(v, viewer) with your Vec and VTK Viewer.</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>Are these what I needed, or maybe something else?</div><div><br></div><div>thank you,</div><div><br></div><div>Barry</div></div><br><div class="gmail_quote"><div dir="ltr">Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> 於 2018年11月3日 週六 上午12:14寫道:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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" target="_blank">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="m_-1048932903723789432m_-6378879631233370824gmail_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>
</blockquote></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>