<div class="gmail_quote">On Thu, Mar 8, 2012 at 16:19, Max Rudolph <span dir="ltr"><<a href="mailto:maxwellr@gmail.com">maxwellr@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is it expected behavior for field names not to be included in the .vts file produced using this viewer?</blockquote><div><br></div><div>Did you use DMDASetFieldNames()?</div><div><br></div><div>$ mpiexec -n 2 ./ex50 -da_refine 4 -snes_monitor -snes_view_solution_vtk foo.vts</div>
<div><br></div><div>now foo.vts contains</div><div><br></div><div><div><?xml version="1.0"?></div><div><VTKFile type="StructuredGrid" version="0.1" byte_order="LittleEndian"></div>
<div> <StructuredGrid WholeExtent="0 48 0 48 0 0"></div><div> <Piece Extent="0 48 0 24 0 0"></div><div> <Points></div><div> <DataArray type="Float64" Name="Position" NumberOfComponents="3" format="appended" offset="0" /></div>
<div> </Points></div><div> <PointData Scalars="ScalarPointData"></div><div> <DataArray type="Float64" Name="x-velocity" NumberOfComponents="1" format="appended" offset="29404" /></div>
<div> <DataArray type="Float64" Name="y-velocity" NumberOfComponents="1" format="appended" offset="39208" /></div><div> <DataArray type="Float64" Name="Omega" NumberOfComponents="1" format="appended" offset="49012" /></div>
<div> <DataArray type="Float64" Name="temperature" NumberOfComponents="1" format="appended" offset="58816" /></div><div> </PointData></div><div> </Piece></div>
<div> <Piece Extent="0 48 25 48 0 0"></div><div> <Points></div><div> <DataArray type="Float64" Name="Position" NumberOfComponents="3" format="appended" offset="68620" /></div>
<div> </Points></div><div> <PointData Scalars="ScalarPointData"></div><div> <DataArray type="Float64" Name="x-velocity" NumberOfComponents="1" format="appended" offset="96848" /></div>
<div> <DataArray type="Float64" Name="y-velocity" NumberOfComponents="1" format="appended" offset="106260" /></div><div> <DataArray type="Float64" Name="Omega" NumberOfComponents="1" format="appended" offset="115672" /></div>
<div> <DataArray type="Float64" Name="temperature" NumberOfComponents="1" format="appended" offset="125084" /></div><div> </PointData></div><div> </Piece></div>
<div> </StructuredGrid></div><div> <AppendedData encoding="raw"></div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br></div><div><font color="#888888">Max<br><br></font><div class="gmail_quote"><div class="im">On Thu, Mar 8, 2012 at 11:21 AM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br>
</div><div><div></div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="gmail_quote">On Thu, Mar 8, 2012 at 13:10, Max Rudolph <span dir="ltr"><<a href="mailto:maxwellr@gmail.com" target="_blank">maxwellr@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>I get an implicit declaration warning when compiling with a call to DMDAVTKWriteAll:<div><br></div><div><div>io.c:209: warning: implicit declaration of function 'DMDAVTKWriteAll'</div><div><br></div><div>Should the prototype be in petscdmda.h ? I do not see it there. Code still compiles successfully.</div>
<div></div></div></div></blockquote></div><br></div><div>That is a developer-level function that you should not be calling, it's declared in private/daimpl.h. I didn't hack together some funky new API when I added the VTK viewer. You use it like any other viewer, by calling VecView(). Here's some sample code.</div>
<div><br></div><div><div> ierr = PetscOptionsGetString(((PetscObject)snes)->prefix,"-snes_view_solution_vtk",filename,PETSC_MAX_PATH_LEN,&flg);CHKERRQ(ierr);</div><div> if (flg) {</div><div> PetscViewer viewer;</div>
<div> ierr = PetscViewerCreate(((PetscObject)snes)->comm,&viewer);CHKERRQ(ierr);</div><div> ierr = PetscViewerSetType(viewer,PETSCVIEWERVTK);CHKERRQ(ierr);</div><div> ierr = PetscViewerFileSetName(viewer,filename);CHKERRQ(ierr);</div>
<div> ierr = VecView(snes->vec_sol,viewer);CHKERRQ(ierr);</div><div> ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);</div><div> }</div></div><div><br></div>
</blockquote></div></div></div><br></div>
</blockquote></div><br>