<div class="gmail_quote">On Fri, Nov 26, 2010 at 06:36, khalid ashraf <span dir="ltr">&lt;<a href="mailto:khalid_eee@yahoo.com">khalid_eee@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><font size="3"><span style="font-size:13px"><font size="4"><span style="font-size:16px">Thanks Barry. I get the correct output when I use </span></font></span></font></div><div><font size="3"><span style="font-size:13px"><font size="4"><span style="font-size:16px">VecView(w,PETSC_VIEWER_STDOUT_WORLD)</span></font></span></font></div>
<div><br></div><div><font size="3"><span style="font-size:13px"><font size="4"><span style="font-size:16px">But if I use the VecView_VTK function from the
 file</span></font></span></font></div><div><font size="3"><span style="font-size:13px"><font size="4"><span style="font-size:16px"><span style="font-family:monospace, helvetica, sans-serif;font-size:medium;font-style:italic;white-space:pre-wrap">ksp/ksp/examples/tutorials/ex29.c</span></span></font></span></font></div>
<div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><div style="font-family:arial, helvetica, sans-serif;font-size:13px"><br>then I get different results.</div></div></blockquote></div><br><div>This is a crucial piece of information, if you stated this in the first email, you would have gotten a good answer to your first email.</div>
<div><br></div><div><div>The problem is that this function and the copy in ex50.c, never worked in parallel.  Clearly the person who wrote it misunderstood the VTK legacy format because nothing similar can work in parallel.  See src/snes/examples/tutorials/ex5.c for the correct way to do it:</div>
</div><div><br></div><div><div>    PetscViewer viewer;</div><div>    ierr = PetscViewerCreate(PETSC_COMM_WORLD, &amp;viewer);CHKERRQ(ierr);</div><div>    ierr = PetscViewerSetType(viewer, PETSCVIEWERASCII);CHKERRQ(ierr);</div>
<div>    ierr = PetscViewerFileSetName(viewer, &quot;ex5_sol.vtk&quot;);CHKERRQ(ierr);</div><div>    ierr = PetscViewerSetFormat(viewer, PETSC_VIEWER_ASCII_VTK);CHKERRQ(ierr);</div><div>    ierr = DAView(user.da, viewer);CHKERRQ(ierr);</div>
<div>    ierr = VecView(x, viewer);CHKERRQ(ierr);</div><div>    ierr = PetscViewerDestroy(viewer);CHKERRQ(ierr);</div></div><div><br></div><div>Jed</div>