[vtkusers] vtkXMLPDataWriter cuts off more than the file extension
Mikael Öhman
micketeer at gmail.com
Sun Jan 15 18:52:13 EST 2012
Hi.
I'm having some issues using vtkXMLPUnstructuredGridWriter.
I have the following code;
vtkSmartPointer<vtkXMLPUnstructuredGridWriter> writer =
vtkSmartPointer<vtkXMLPUnstructuredGridWriter>::New();
writer->SetNumberOfPieces( emodel->giveNumberOfProcesses() );
writer->SetStartPiece( emodel->giveRank() );
writer->SetEndPiece( emodel->giveRank() );
which seems to work fine. Each process outputs only its own *.vtu
file, and a single *.pvtu is exported.
The problem is that
vtkXMLPDataWriter::SplitFileName()
is to greedy when cutting off the file name extension, taking the
first dot instead of the last.
This leaves me without time-step-number among other things, so the
files will be overwritten the next time step.
I think a minor change in vtkXMLPDataWriter.cxx:238 to
for(s=end; s != begin; --s) { if(*s == '.') { break; } }
would solve the problem.
More information about the vtkusers
mailing list