[vtkusers] vtkXMLPUnstructuredGridWriter::SetFileName - do not include "."

Mitchell, John A jamitch at sandia.gov
Thu Dec 23 15:43:33 EST 2010


Hello,

I have an application code that runs parallel calculations (multiple parts) and writes a vtk file(s) for each time step.

There appears to be an issue with having a period "."  within the name of the file given to the writer vtkXMLPUnstructuredGridWriter --  See below.      A work around for us has been to replace the "." with "_".

       vtkSmartPointer<vtkXMLPUnstructuredGridWriter > w = vtkSmartPointer<vtkXMLPUnstructuredGridWriter>::New();
       w->SetNumberOfPieces(numProcs);
        w->SetStartPiece(rank);
        w->SetEndPiece(rank);
        w->SetFileName(_fileName);  // where  _filename = "Compression_2x1x1.gold".

Then, this code was called once for each timestep:

       vtkSmartPointer<vtkUnstructuredGrid> g = ...
        writer->SetFileName(name.c_str()); // where name = "Compression_2x1x1.gold_t0.pvtu", "Compression_2x1x1.gold_t1.pvtu", etc
        writer ->SetInput(g);
        writer ->Write();

The result was the creation of the following files:
Compression_2x1x1_0.vtu
Compression_2x1x1.gold_t0.pvtu
Compression_2x1x1.gold_t1.pvtu
Compression_2x1x1.gold_t2.pvtu
Compression_2x1x1.gold_t3.pvtu
Compression_2x1x1.gold_t4.pvtu
Compression_2x1x1.gold_t5.pvtu

The single vtu file contained only the data from the last call to write(). Each pvtu file pointed to the same vtu file (e.g., each pvtu file contained "<Piece Source="Compression_2x1x1_0.vtu"/>").

Regards,
john


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101223/132ab79b/attachment.htm>


More information about the vtkusers mailing list