[vtkusers] "manually" specify extents for vtkXMLPRectilinearGridWriter

Andy Bauer andy.bauer at kitware.com
Tue Jul 24 16:20:18 EDT 2012


The problem is that only process 0 writes out the meta-data file (i.e. the
pvtr file). It doesn't do communication to get those values from the other
processes and instead tries to get it through an extent translator. You'll
probably need to pass that information in through vtkInformation keys. My
suggestion was to do that with the vtkPVTrivialProducer but you can try it
by just getting the executive and trying to fill it in there but it may
override your information.

On Mon, Jul 23, 2012 at 4:28 PM, Crni Gorac <cgorac at gmail.com> wrote:

> On Mon, Jul 23, 2012 at 6:50 PM, Andy Bauer <andy.bauer at kitware.com>
> wrote:
> > You'll probably need to set the vtkInformation for the whole extent and
> the
> > extent translator in your pipeline. The easiest way to do this may be by
> > using a vtkTrivialProducer or the vtkPVTrivialProducer in Paraview.
> >
>
> Thanks for your reply.  But I already have vtkRectilinearGrid set as
> input to the vtkXMLPRectilinearGridWriter.  Here follows relevant
> snippets of my code (this code is called from corresponding MPI
> processes dong the calculations):
>
> // piece represented by this rectilinear grid is starting at point
> (px0,py0,pz0),
> // and its size is (pnx,pny,pnz), while the size of the whole computation
> // domain is (nx,ny,nz)
>     vtkRectilinearGrid *grid = vtkRectilinearGrid::New();
>     grid->SetXCoordinates(x);
>     grid->SetYCoordinates(y);
>     grid->SetZCoordinates(z);
>     grid->SetWholeExtent(0, nx, 0, ny, 0, nz);
>     grid->SetExtent(px0, px0 + pnx, py0, py0 + pny, pz0, pz0 + pnz);
>     grid->GetCellData()->SetScalars(p);
>
> // here, npieces is total number of pieces, and piece is index of current
> piece
> // that get written
>     vtkXMLPRectilinearGridWriter *writer =
> vtkXMLPRectilinearGridWriter::New();
>     writer->SetNumberOfPieces(npieces);
>     writer->SetStartPiece(piece);
>     writer->SetEndPiece(piece);
>     writer->SetInput(grid);
>     writer->SetFileName(filename);
>     writer->Write();
>
> My problem is that each individual .vtr file has correct WholeExtent
> and Extent values (these are as I set them through SetWholeExtent()
> and SetExtent() calls above.  However, master .pvtr file has both
> WholeExtent and Extent set wrong.  It seems to me that these get
> calculated from this piece information specified through
> SetNumberOfPieces()( and SetStartPiece()/SetEndPiece() calls.  I need
> these calls as .vtr files get corresponding suffixes in its basename
> (0, 1, etc.) only if I leave these calls, but I don't know how to tell
> VTK to not calculate extents in the master file from these, but to use
> WholeExtent/Extent info that I specified for each vtkRectilinearGrid
> object.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120724/31b37b4e/attachment.htm>


More information about the vtkusers mailing list