[petsc-users] VTKViewer with petsc4py

Blaise Bourdin bourdin at lsu.edu
Fri Jul 30 19:13:43 CDT 2010


Hi,

Is PetscViewerSetFormat implemented in petsc4py (I am using petsc-3.1-p3 and petsc4py-1.1)? I am trying to save a DA and Vec in vtk format, but can't figure out the python equivalent to 
PetscViewerSetFormat(VTKViewer,PETSC_VIEWER_ASCII_VTK).

My C code would be 
  ierr = PetscViewerCreate(PETSC_COMM_WORLD,&VTKViewer);CHKERRQ(ierr);
  ierr = PetscViewerSetType(VTKViewer,PETSC_VIEWER_ASCII);CHKERRQ(ierr);
  ierr = PetscViewerFileSetName(VTKViewer,filename);CHKERRQ(ierr);
  ierr = PetscViewerSetFormat(VTKViewer,PETSC_VIEWER_ASCII_VTK);CHKERRQ(ierr);

  ierr = DAView(da,VTKViewer);CHKERRQ(ierr);
  ierr = VecView(U,VTKViewer);CHKERRQ(ierr);

What would be the python equivalent?

Thanks
Blaise

-- 
Department of Mathematics and Center for Computation & Technology
Louisiana State University, Baton Rouge, LA 70803, USA
Tel. +1 (225) 578 1612, Fax  +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin









More information about the petsc-users mailing list