[Paraview] vtkXMLPRectilinearGridWriter

Jean Favre jfavre at cscs.ch
Fri Mar 27 09:15:18 EDT 2009


Rakesh Hammond wrote:
> Hi
>
> I have a vtkRectilinearGrid - I would like to use the
> vtkXMLPRectilinearGridWriter to write the output of data into several
> pieces.  In order to do this, I do the following
>
> writer->SetInput(grid);
> writer->SetNumberOfPieces(5);
> writer->Write();
>
> What this seems to be doing is writing a myfile.pvtr correctly and
> defines extents of 5 files and even writes out the names of all
> pieces, for example myfile_0.vtr ... myfile_4.vtr.
>
> Howerver, there is only one vtr file actually gets written out
> (myfile_0.vtr) which contains the other 4 files as piece extents
> within this file, rather than in 5 separate files as specified in the
> .pvtr file.  Do I need to use MPI to write the 5 files? or am I doing
> this incorrectly?

By default, your vtkXMLPRectilinearGridWriter sets the EndPiece to 0
(because it does not know any better on initialization). Here is what
you need to do to achieve fully distributed writing.

int N = 5;
vtkXMLPRectilinearGridWriter piw = vtkXMLPRectilinearGridWriter::New();
piw->SetInput(grid);
piw->SetFileName("/pathtofilename/file.pvti");
piw->SetNumberOfPieces(N);
piw->SetStartPiece(0);
piw->SetEndPiece(N-1);
piw->WriteSummaryFileOn();
piw->Write()

-- 
Jean
Swiss National Supercomputing Center


More information about the ParaView mailing list