<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Hi Barry,<div><br></div><div>What I am after is to output one scalar per cell of DMDA (for example heat conduction on this cell or MPI partitioning of the computation domain). I hope that’s what is meant by PETSC_VTK_CELL_FIELD.</div><div><br></div><div>My understanding is that DMCreateGlobalVector will create a vector associated with the field/discretization/nodal unknowns/etc (that would be <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);">PETSC_VTK_POINT_FIELD?), </span>which is not what I would like to visualize.</div><div><br></div><div>Could you point me to the right direction to look at? </div><div><br></div><div>If this is not possible with VTK interface, I am fine to go for other viewer formats (maybe it’s coincidentally easier to visualize in MATLAB).</div><div><br><div dir="ltr">Sincerely,<div>Denis</div></div><div dir="ltr"><br><blockquote type="cite">Am 18.12.2020 um 10:03 schrieb Barry Smith <bsmith@petsc.dev>:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Dec 18, 2020, at 2:29 AM, Denis Davydov <<a href="mailto:davydden@gmail.com" class="">davydden@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="content-type" content="text/html; charset=utf-8" class=""><div dir="auto" class="">Hi Matt,<div class=""><br class=""></div><div class="">By global vector you mean one created with</div><div class=""><br class=""></div><div class="">VecCreateMPI(..., nel, PETSC_DETERMINE,...)</div><div class=""><br class=""></div><div class="">? If so, that gives segfault (even with 1 MPI process) in user write function, which is just </div><div class=""><br class=""></div><div class="">VecView((Vec)obj,viewer);</div><div class=""><br class=""></div><div class="">which clearly indicates that I misunderstand your comment.<br class=""><br class="">Would you please clarify what PETSc expect as a “global” vector in case of cell-based quantities as opposed to unknowns/fields associated with the DMDA discretization?</div><div class=""><br class=""></div></div></div></blockquote><div><br class=""></div> Denis,</div><div><br class=""> Not sure what you mean by cell-based but if your vector is associated with a DMDA you need to create DMCreateGlobalVector() to get the properly layout with respect to the DM. If you use VecCreateMPI() it just has a naive 1d layout not associated with the DMDA in any way so won't be compatible. (Of course we would hope the code would not "crash" with an incompatible vector but just produce a useful error message)</div><div><br class=""></div><div> Barry</div><div><br class=""></div><div><br class=""></div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="auto" class=""><div class=""><div dir="ltr" class="">Sincerely,<div class="">Denis</div></div><div dir="ltr" class=""><br class=""><blockquote type="cite" class="">Am 17.12.2020 um 18:58 schrieb Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>>:<br class=""><br class=""></blockquote></div><blockquote type="cite" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class="">On Thu, Dec 17, 2020 at 12:18 PM Denis Davydov <<a href="mailto:davydden@gmail.com" class="">davydden@gmail.com</a>> wrote:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear all,<br class="">
<br class="">
I would like to output cell data (eg conductivity coefficient) in VTK for DMDA setup.<br class="">
<br class="">
Given that I know how many elements/cells are owned locally, I hoped that PetscViewerVTKAddField with PETSC_VTK_CELL_FIELD would do the job.<br class="">
However I am not sure whether provided vector should be fully distributed (no ghosts)? If not, can I get the required ghosts from DMDA created with DMDACreate3D ?<br class=""></blockquote><div class=""><br class=""></div><div class="">I believe that it outputs global vectors, meaning that there are no ghosts.</div><div class=""><br class=""></div><div class=""> Thanks,</div><div class=""><br class=""></div><div class=""> Matt</div><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Ps. I saw just one relevant discussion on the mailing list.<br class="">
<br class="">
Sincerely,<br class="">
Denis</blockquote></div><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div dir="ltr" class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div><div class=""><br class=""></div><div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" class="">https://www.cse.buffalo.edu/~knepley/</a><br class=""></div></div></div></div></div></div></div></div>
</div></blockquote></div></div></div></blockquote></div><br class=""></div></blockquote></div></body></html>