[vtkusers] pvtu
STYLIANOS DOSOPOULOS
dosopoulos.1 at osu.edu
Mon Apr 12 19:53:53 EDT 2010
Hi, all,
I have implemented an MPI code and I want to use VTK's parallel file format(pvtu). The computational domain is already partition using METIS.
What I want to do is:
for i=1:1:N
A) Each MPI has its own data to file
(data_i_0.vtu, data_i_1.vtu, ... data_i_MPI_Size-1.vtu).
B) Then combine all the files to create data_i.pvtu file to visualoze the
whole domain.
end
So far I have,
vtkUnstructuredGrid* mesh = vtkUnstructuredGrid::New();
addNodes(mesh, nodeNum, nodeArray);
addCells(mesh, tetNum, tetArray);
addCellMaterial(mesh, tetNum, tetArray);
addPointScalars(mesh, nodeNum, eField, "E");
addPointScalars(mesh, nodeNum, hField, "H");
// Parallel
string outputFile(outFilePrefix);
outputFile.append(".pvtu");
vtkXMLPUnstructuredGridWriter *pwriter = vtkXMLPUnstructuredGridWriter::New();
pwriter->SetInput( mesh );
pwriter->SetFileName(outputFile.c_str());
// pwriter->SetDataModeToBinary();
pwriter->SetDataModeToAscii();
if (MPI_RankID == 0)
{
pwriter->SetNumberOfPieces( MPI_Size );
pwriter->Write();
}
else
{
pwriter->SetNumberOfPieces(1);
pwriter->SetStartPiece(MPI_RankID);
pwriter->SetEndPiece(MPI_RankID);
pwriter->Write();
}
mesh->Delete();
pwriter->Delete();
I get the files that I want but when tryig to visualize the pvtu ifiles in VisIt
I get an error
If anyone has an idea on how to do this I would appreciate it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100412/ad344c32/attachment.htm>
More information about the vtkusers
mailing list