[petsc-users] VTK output

bichinhoverde bichinhoverde at spwinternet.com.br
Wed Feb 4 13:11:54 CST 2015


If you want ASCII VTK, try something like this:

  PetscViewerASCIIOpen(PETSC_COMM_WORLD, "testing.vtk", &viewer);
  PetscViewerSetFormat(viewer, PETSC_VIEWER_ASCII_VTK);
  DMDASetUniformCoordinates(params.da, 0.0, params.Lx, 0.0, params.Ly, 0.0,
0.0);
  DMView(params.da, viewer);
  PetscObjectSetName((PetscObject) params.u_n, "u_n");
  VecView(params.u_n, viewer);
  PetscObjectSetName((PetscObject) params.u_np1, "u_np1");
  VecView(params.u_np1, viewer);
  PetscObjectSetName((PetscObject) params.cell_type, "cell_type");
  VecView(params.cell_type, viewer);
  PetscViewerDestroy(&viewer);








On Wed, Feb 4, 2015 at 9:39 AM, Sanjay Kharche <
Sanjay.Kharche at manchester.ac.uk> wrote:

>
> Dear All
>
> 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.
>
> 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.
>
> thanks
> Sanjay
>
> my configure:
>
> ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran
> --download-fblaslapack --download-mpich --download-sundials
> --download-scalapack --download-vtk --with-c2html=0
>
>
> my VTK output code:
>
> PetscViewer viewer;
> PetscViewerVTKOpen(PETSC_COMM_WORLD, "sk.vtk",FILE_MODE_WRITE,&viewer);
> VecView(u,viewer);
> PetscViewerDestroy(&viewer);
>
> at which point I get errors (these are all the errors I got):
>
> [0]PETSC ERROR: --------------------- Error Message
> --------------------------------------------------------------
> [0]PETSC ERROR: No support for this operation for this object type
> [0]PETSC ERROR: No support for format 'ASCII_VTK'
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
> for trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.5.3, unknown
> [0]PETSC ERROR: ./sk2d on a linux-gnu-c-debug named
> sanjayslaptop.maths.liv.ac.uk by sanjay Wed Feb  4 11:37:26 2015
> [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
> [0]PETSC ERROR: #1 DMDAVTKWriteAll() line 487 in
> /home/sanjay/petsc/src/dm/impls/da/grvtk.c
> [0]PETSC ERROR: #2 PetscViewerFlush_VTK() line 78 in
> /home/sanjay/petsc/src/sys/classes/viewer/impls/vtk/vtkv.c
> [0]PETSC ERROR: #3 PetscViewerFlush() line 30 in
> /home/sanjay/petsc/src/sys/classes/viewer/interface/flush.c
> [0]PETSC ERROR: #4 PetscViewerDestroy() line 100 in
> /home/sanjay/petsc/src/sys/classes/viewer/interface/view.c
> [0]PETSC ERROR: --------------------- Error Message
> --------------------------------------------------------------
> [0]PETSC ERROR: No support for this operation for this object type
> [0]PETSC ERROR: No support for format 'ASCII_VTK'
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
> for trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.5.3, unknown
> [0]PETSC ERROR: ./sk2d on a linux-gnu-c-debug named
> sanjayslaptop.maths.liv.ac.uk by sanjay Wed Feb  4 11:37:26 2015
> [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
> [0]PETSC ERROR: #1 DMDAVTKWriteAll() line 487 in
> /home/sanjay/petsc/src/dm/impls/da/grvtk.c
> [0]PETSC ERROR: #2 PetscViewerFlush_VTK() line 78 in
> /home/sanjay/petsc/src/sys/classes/viewer/impls/vtk/vtkv.c
> [0]PETSC ERROR: #3 PetscViewerFlush() line 30 in
> /home/sanjay/petsc/src/sys/classes/viewer/interface/flush.c
> [0]PETSC ERROR: #4 PetscViewerDestroy() line 100 in
> /home/sanjay/petsc/src/sys/classes/viewer/interface/view.c
> [0]PETSC ERROR: --------------------- Error Message
> --------------------------------------------------------------
> [0]PETSC ERROR: No support for this operation for this object type
> [0]PETSC ERROR: No support for format 'ASCII_VTK'
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
> for trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.5.3, unknown
> [0]PETSC ERROR: ./sk2d on a linux-gnu-c-debug named
> sanjayslaptop.maths.liv.ac.uk by sanjay Wed Feb  4 11:37:26 2015
> [0]PETSC ERROR: --------------------- Error Message
> --------------------------------------------------------------
> [0]PETSC ERROR: No support for this operation for this object type
> [0]PETSC ERROR: No support for format 'ASCII_VTK'
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
> for trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.5.3, unknown
> [0]PETSC ERROR: ./sk2d on a linux-gnu-c-debug named
> sanjayslaptop.maths.liv.ac.uk by sanjay Wed Feb  4 11:37:26 2015
> [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
> [0]PETSC ERROR: #1 DMDAVTKWriteAll() line 487 in
> /home/sanjay/petsc/src/dm/impls/da/grvtk.c
> [0]PETSC ERROR: #2 PetscViewerFlush_VTK() line 78 in
> /home/sanjay/petsc/src/sys/classes/viewer/impls/vtk/vtkv.c
> [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
> [0]PETSC ERROR: #1 DMDAVTKWriteAll() line 487 in
> /home/sanjay/petsc/src/dm/impls/da/grvtk.c
> [0]PETSC ERROR: #2 PetscViewerFlush_VTK() line 78 in
> /home/sanjay/petsc/src/sys/classes/viewer/impls/vtk/vtkv.c
> [0]PETSC ERROR: #3 PetscViewerFlush() line 30 in
> /home/sanjay/petsc/src/sys/classes/viewer/interface/flush.c
> [0]PETSC ERROR: #4 PetscViewerDestroy() line 100 in
> /home/sanjay/petsc/src/sys/classes/viewer/interface/view.c
> #3 PetscViewerFlush() line 30 in
> /home/sanjay/petsc/src/sys/classes/viewer/interface/flush.c
> [0]PETSC ERROR: #4 PetscViewerDestroy() line 100 in
> /home/sanjay/petsc/src/sys/classes/viewer/interface/view.c
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150204/4093e6da/attachment.html>


More information about the petsc-users mailing list