<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">If you want ASCII VTK, try something like this:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div class="gmail_default">  PetscViewerASCIIOpen(PETSC_COMM_WORLD, "testing.vtk", &viewer);</div><div class="gmail_default">  PetscViewerSetFormat(viewer, PETSC_VIEWER_ASCII_VTK);</div><div class="gmail_default">  DMDASetUniformCoordinates(params.da, 0.0, params.Lx, 0.0, params.Ly, 0.0, 0.0);</div><div class="gmail_default">  DMView(params.da, viewer);</div><div class="gmail_default">  PetscObjectSetName((PetscObject) params.u_n, "u_n");</div><div class="gmail_default">  VecView(params.u_n, viewer);</div><div class="gmail_default">  PetscObjectSetName((PetscObject) params.u_np1, "u_np1");</div><div class="gmail_default">  VecView(params.u_np1, viewer);</div><div class="gmail_default">  PetscObjectSetName((PetscObject) params.cell_type, "cell_type");</div><div class="gmail_default">  VecView(params.cell_type, viewer);</div><div class="gmail_default">  PetscViewerDestroy(&viewer);</div><div><br></div></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 4, 2015 at 9:39 AM, Sanjay Kharche <span dir="ltr"><<a href="mailto:Sanjay.Kharche@manchester.ac.uk" target="_blank">Sanjay.Kharche@manchester.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
Dear All<br>
<br>
I am working through the various library dependencies to permit me to use the Petsc VTK output functions. Based on errors I saw (pasted below), I think I need a working VTK installation on my fedora 15 before the PetscVTK functions will work - is this correct? My preference is basic binary VTK in 2D and 3D, but ASCII will be good for manually checking also.<br>
<br>
Do I need to configure and build petsc  with vtk? How to do this? I tried the following, and the configure did not download VTK and it did not give any error messages either. The code for the petsc output I am trying to generate is follows the configure line.<br>
<br>
thanks<br>
Sanjay<br>
<br>
my configure:<br>
<br>
./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich --download-sundials --download-scalapack --download-vtk --with-c2html=0<br>
<br>
<br>
my VTK output code:<br>
<br>
PetscViewer viewer;<br>
PetscViewerVTKOpen(PETSC_COMM_WORLD, "sk.vtk",FILE_MODE_WRITE,&viewer);<br>
VecView(u,viewer);<br>
PetscViewerDestroy(&viewer);<br>
<br>
at which point I get errors (these are all the errors I got):<br>
<br>
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
[0]PETSC ERROR: No support for this operation for this object type<br>
[0]PETSC ERROR: No support for format 'ASCII_VTK'<br>
[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>
[0]PETSC ERROR: Petsc Release Version 3.5.3, unknown<br>
[0]PETSC ERROR: ./sk2d on a linux-gnu-c-debug named <a href="http://sanjayslaptop.maths.liv.ac.uk" target="_blank">sanjayslaptop.maths.liv.ac.uk</a> by sanjay Wed Feb  4 11:37:26 2015<br>
[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich --download-sundials --download-scalapack --download-vtk --with-c2html=0<br>
[0]PETSC ERROR: #1 DMDAVTKWriteAll() line 487 in /home/sanjay/petsc/src/dm/impls/da/grvtk.c<br>
[0]PETSC ERROR: #2 PetscViewerFlush_VTK() line 78 in /home/sanjay/petsc/src/sys/classes/viewer/impls/vtk/vtkv.c<br>
[0]PETSC ERROR: #3 PetscViewerFlush() line 30 in /home/sanjay/petsc/src/sys/classes/viewer/interface/flush.c<br>
[0]PETSC ERROR: #4 PetscViewerDestroy() line 100 in /home/sanjay/petsc/src/sys/classes/viewer/interface/view.c<br>
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
[0]PETSC ERROR: No support for this operation for this object type<br>
[0]PETSC ERROR: No support for format 'ASCII_VTK'<br>
[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>
[0]PETSC ERROR: Petsc Release Version 3.5.3, unknown<br>
[0]PETSC ERROR: ./sk2d on a linux-gnu-c-debug named <a href="http://sanjayslaptop.maths.liv.ac.uk" target="_blank">sanjayslaptop.maths.liv.ac.uk</a> by sanjay Wed Feb  4 11:37:26 2015<br>
[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich --download-sundials --download-scalapack --download-vtk --with-c2html=0<br>
[0]PETSC ERROR: #1 DMDAVTKWriteAll() line 487 in /home/sanjay/petsc/src/dm/impls/da/grvtk.c<br>
[0]PETSC ERROR: #2 PetscViewerFlush_VTK() line 78 in /home/sanjay/petsc/src/sys/classes/viewer/impls/vtk/vtkv.c<br>
[0]PETSC ERROR: #3 PetscViewerFlush() line 30 in /home/sanjay/petsc/src/sys/classes/viewer/interface/flush.c<br>
[0]PETSC ERROR: #4 PetscViewerDestroy() line 100 in /home/sanjay/petsc/src/sys/classes/viewer/interface/view.c<br>
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
[0]PETSC ERROR: No support for this operation for this object type<br>
[0]PETSC ERROR: No support for format 'ASCII_VTK'<br>
[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>
[0]PETSC ERROR: Petsc Release Version 3.5.3, unknown<br>
[0]PETSC ERROR: ./sk2d on a linux-gnu-c-debug named <a href="http://sanjayslaptop.maths.liv.ac.uk" target="_blank">sanjayslaptop.maths.liv.ac.uk</a> by sanjay Wed Feb  4 11:37:26 2015<br>
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
[0]PETSC ERROR: No support for this operation for this object type<br>
[0]PETSC ERROR: No support for format 'ASCII_VTK'<br>
[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>
[0]PETSC ERROR: Petsc Release Version 3.5.3, unknown<br>
[0]PETSC ERROR: ./sk2d on a linux-gnu-c-debug named <a href="http://sanjayslaptop.maths.liv.ac.uk" target="_blank">sanjayslaptop.maths.liv.ac.uk</a> by sanjay Wed Feb  4 11:37:26 2015<br>
[0]PETSC ERROR: [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich --download-sundials --download-scalapack --download-vtk --with-c2html=0<br>
[0]PETSC ERROR: #1 DMDAVTKWriteAll() line 487 in /home/sanjay/petsc/src/dm/impls/da/grvtk.c<br>
[0]PETSC ERROR: #2 PetscViewerFlush_VTK() line 78 in /home/sanjay/petsc/src/sys/classes/viewer/impls/vtk/vtkv.c<br>
[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich --download-sundials --download-scalapack --download-vtk --with-c2html=0<br>
[0]PETSC ERROR: #1 DMDAVTKWriteAll() line 487 in /home/sanjay/petsc/src/dm/impls/da/grvtk.c<br>
[0]PETSC ERROR: #2 PetscViewerFlush_VTK() line 78 in /home/sanjay/petsc/src/sys/classes/viewer/impls/vtk/vtkv.c<br>
[0]PETSC ERROR: #3 PetscViewerFlush() line 30 in /home/sanjay/petsc/src/sys/classes/viewer/interface/flush.c<br>
[0]PETSC ERROR: #4 PetscViewerDestroy() line 100 in /home/sanjay/petsc/src/sys/classes/viewer/interface/view.c<br>
#3 PetscViewerFlush() line 30 in /home/sanjay/petsc/src/sys/classes/viewer/interface/flush.c<br>
[0]PETSC ERROR: #4 PetscViewerDestroy() line 100 in /home/sanjay/petsc/src/sys/classes/viewer/interface/view.c<br>
<br>
<br>
</blockquote></div><br></div></div>