<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
That's a good start indeed. Is there any way to save files defined on different DMDA (same grid but different number of dof). When I try to do that, I get the following error message:
<div>
<div>MacBook-Pro:VTK blaise$ ./TestVTK </div>
<div>[0]PETSC ERROR: --------------------- Error Message ------------------------------------</div>
<div>[0]PETSC ERROR: Arguments are incompatible!</div>
<div>[0]PETSC ERROR: Cannot write a field from more than one grid to the same VTK file!</div>
<div>[0]PETSC ERROR: ------------------------------------------------------------------------</div>
<div>[0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 5, unknown </div>
<div>[0]PETSC ERROR: See docs/changes/index.html for recent updates.</div>
<div>[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.</div>
<div>[0]PETSC ERROR: See docs/index.html for manual pages.</div>
<div>[0]PETSC ERROR: ------------------------------------------------------------------------</div>
<div>[0]PETSC ERROR: ./TestVTK on a Darwin-gc named MacBook-Pro.local by blaise Wed Jan 9 10:09:37 2013</div>
<div>[0]PETSC ERROR: Libraries linked from /opt/HPC/petsc-3.3/Darwin-gcc4.2-mef90-g/lib</div>
<div>[0]PETSC ERROR: Configure run at Thu Jan 3 15:42:04 2013</div>
<div>[0]PETSC ERROR: Configure options --download-boost=1 --download-chaco=1 --download-exodusii=/opt/HPC/src/tarball/exodusii-5.22b.tgz --download-hdf5=1 --download-metis=1 --download-netcdf=1 --download-parmetis=1 --download-sowing=1 --download-triangle=1
--download-yaml=1 --with-clanguage=C++ --with-cmake=cmake --with-debugging=1 --with-fortran-datatypes --with-gnu-compilers=1 --with-mpi-dir=/opt/HPC/mpich2-1.4.1p1-gcc4.2 --with-pic --with-shared-libraries=1 --with-sieve --with-sieve-memory-logging --with-x11=1
PETSC_ARCH=Darwin-gcc4.2-mef90-g</div>
<div>[0]PETSC ERROR: ------------------------------------------------------------------------</div>
<div>[0]PETSC ERROR: PetscViewerVTKAddField_VTK() line 126 in /opt/HPC/petsc-3.3/src/sys/viewer/impls/vtk/vtkv.c</div>
<div>[0]PETSC ERROR: PetscViewerVTKAddField() line 32 in /opt/HPC/petsc-3.3/src/sys/viewer/impls/vtk/vtkv.c</div>
<div>[0]PETSC ERROR: VecView_MPI_DA() line 531 in /opt/HPC/petsc-3.3/src/dm/impls/da/gr2.c</div>
<div>[0]PETSC ERROR: VecView() line 776 in /opt/HPC/petsc-3.3/src/vec/vec/interface/vector.c</div>
<div>[0]PETSC ERROR: main() line 46 in TestVTK.c</div>
<div>application called MPI_Abort(MPI_COMM_WORLD, 75) - process 0</div>
<div>[unset]: aborting job:</div>
<div>application called MPI_Abort(MPI_COMM_WORLD, 75) - process 0</div>
<div><br>
</div>
<div>Blaise</div>
<div><br>
</div>
<div>
<div>On Jan 9, 2013, at 9:51 AM, Jed Brown <<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>></div>
<div> wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div dir="ltr">None of that crazy "developer" nonsense is need for users. Just do this:
<div><br>
</div>
<div>
<div> PetscViewer viewer;</div>
<div style=""> /* file name extension sets format by default, see also PetscViewerSetFormat(viewer,PETSC_VIEWER_VTK_VTS) */</div>
<div> ierr = PetscViewerVTKOpen(comm,"yourfile.vts",FILE_MODE_WRITE,&viewer);CHKERRQ(ierr);</div>
<div> ierr = VecView(X,viewer);CHKERRQ(ierr);</div>
<div> ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);</div>
</div>
<div><br>
</div>
<div style="">When using TS, you can do -ts_monitor_draw_solution_vtk 'filename-%03D.vts' to save each time step to a numbered binary file (ready to animate in paraview or visit).</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Wed, Jan 9, 2013 at 9:37 AM, Blaise A Bourdin <span dir="ltr">
<<a href="mailto:bourdin@lsu.edu" target="_blank">bourdin@lsu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I am looking at the documentation and the examples looking for a simple illustration of how to use the new vtk binary viewers for structured data defined by a DMDA, but can't find any straightforward example. Is there a simple example that I am missing?<br>
<br>
When I try<br>
PetscViewerVTKAddField(VTKviewer,(PetscObject) dmda1,DMDAVTKWriteAll,PETSC_VTK_POINT_FIELD,(PetscObject) p);CHKERRQ(ierr);<br>
I get a compilation time error:<br>
TestVTK.c:53: error: ‘DMDAVTKWriteAll’ was not declared in this scope<br>
indeed, DMDAVTKWriteAll is defined in a private header. Is this the way it is supposed to be?<br>
<br>
Is the xml file describing the content of the binary files generated automatically or do I need to take care of it by myself?<br>
<br>
I am using petsc-3.3, latest changeset.<br>
<br>
Regards,<br>
Blaise<br>
<span class="HOEnZb"><font color="#888888">--<br>
Department of Mathematics and Center for Computation & Technology<br>
Louisiana State University, Baton Rouge, LA 70803, USA<br>
Tel. <a href="tel:%2B1%20%28225%29%20578%201612" value="+12255781612">+1 (225) 578 1612</a>, Fax <a href="tel:%2B1%20%28225%29%20578%204276" value="+12255784276">+1 (225) 578 4276</a>
<a href="http://www.math.lsu.edu/~bourdin" target="_blank">http://www.math.lsu.edu/~bourdin</a><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</font></span></blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
<div apple-content-edited="true"><span class="Apple-style-span" style="border-collapse: separate; font-size: 12px; border-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; ">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
-- </div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
Department of Mathematics and Center for Computation & Technology</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
Louisiana State University, Baton Rouge, LA 70803, USA</div>
<div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">
Tel. +1 (225) 578 1612, Fax +1 (225) 578 4276 <a href="http://www.math.lsu.edu/~bourdin">
http://www.math.lsu.edu/~bourdin</a></div>
<div><br class="khtml-block-placeholder">
</div>
<div><br class="khtml-block-placeholder">
</div>
<br class="Apple-interchange-newline">
</div>
</span></div>
</span><br class="Apple-interchange-newline">
</div>
</span><br class="Apple-interchange-newline">
</span><br class="Apple-interchange-newline">
</div>
<br>
</div>
</body>
</html>