<div dir="ltr"><br clear="all"><div><span style="font-size:12.8px">All,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I am trying to integrate vtk xml files into a parallel code I am using for research. I am not the original developer, but I am introducing new functionality for post processing. I am able to write the *vts files locally on each processor, and set the grid's extent for each of these files. I am trying to write the *pvts file on rank 0, but I haven't figured out how to set the extent in this file so the defined pieces match the individual vts files. I am probably just missing a function call, so if someone could help me out that would be great. I have not been able to find any examples online thus far.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Here is a section of the c++ code with the writer objects is included below. I am calling this as a function from fortran (the main code is all fortran) and I am passing the MPI rank as nPartition. Right now I only get the extent of the grid stored on rank0 because that is where I am generating the *pvts file. The other files/pieces totally omit the extent parameter and it won't read into paraview unless they are correct. </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">///---------------CODE SNIPPET-----------------------<wbr>-------</div><div style="font-size:12.8px"><div><div> //Step 5: Setup writer object and write file</div><div> int ext[6]={7,14,0,31,0,7};</div><div> if(*nPartition==1)</div><div> sGrid->SetExtent(ext); //THIS WORKS FOR THE *VTS FILES</div><div> if(*nPartition!=0)</div><div> {</div><div> vtkSmartPointer<<wbr>vtkXMLStructuredGridWriter> writer =</div><div> vtkSmartPointer<<wbr>vtkXMLStructuredGridWriter>::<wbr>New();</div><div> writer->SetFileName(&<wbr>stFileName[0]);</div><div> writer->SetInputData(sGrid);</div><div> writer->Write();</div><div> }</div><div> //Step 6: If partition zero write pvts vile</div><div> if(*nPartition==0)</div><div> {</div><div> stPFileName+=".pvts";</div><div> vtkSmartPointer<<wbr>vtkXMLPStructuredGridWriter> pwriter =</div><div> vtkSmartPointer<<wbr>vtkXMLPStructuredGridWriter>::<wbr>New();</div><div> pwriter->SetFileName(&<wbr>stPFileName[0]);</div><div> pwriter->SetInputData(sGrid);</div><div> pwriter->SetNumberOfPieces(8);</div><div> //pwriter->SetUpdateExtent(1,<wbr>ext); //THIS DOESN'T SEEM TO DO ANYTHING, INHERITED FROM vtkAlgorthim</div><div> pwriter->Write();</div><div> }</div></div><div><br>///---------------CODE SNIPPET-----------------------<wbr>-------<br></div><div>///---------------PVTS FILE OUTPUT------------------------</div><div><?xml version="1.0"?></div><div><VTKFile type="PStructuredGrid" version="0.1" byte_order="LittleEndian" header_type="UInt32" compressor="<wbr>vtkZLibDataCompressor"></div><div> <PStructuredGrid WholeExtent="0 7 0 31 0 7" GhostLevel="0"> //NEED TO MODIFY WHOLE EXTENT TOO</div><div> <PPointData Scalars="temperature" Vectors="velocity"></div><div> <PDataArray type="Float64" Name="velocity" NumberOfComponents="3"/></div><div> <PDataArray type="Float64" Name="pressure"/></div><div> <PDataArray type="Float64" Name="temperature"/></div><div> </PPointData></div><div> <PPoints></div><div> <PDataArray type="Float32" Name="Points" NumberOfComponents="3"/></div><div> </PPoints></div><div> <Piece Extent="0 7 0 31 0 7" Source="test_0.vts"/></div><div> <Piece Source="test_1.vts"/></div><div> <Piece Source="test_2.vts"/> //MISSING EXTENT HERE!!!</div><div> <Piece Source="test_3.vts"/></div><div> <Piece Source="test_4.vts"/></div><div> <Piece Source="test_5.vts"/></div><div> <Piece Source="test_6.vts"/></div><div> <Piece Source="test_7.vts"/></div><div> </PStructuredGrid></div><div></VTKFile>-- <br></div><div>///---------------PVTS FILE OUTPUT------------------------<br></div><div><br></div><div>Thanks,</div><div><br></div><div><div dir="ltr"><div dir="ltr">Phil S.</div><div dir="ltr"><br></div><div>PS sorry if this is a duplicate, I'm new to the user list. I tired to post it before but never saw it sent to my inbox as part of the mailing list.</div></div></div></div></div><br>
</div>