<div dir="ltr">Andy and community,<div><br></div><div>I have read about the concept of whole extent vs extent, but the one thing I don't seem to be able to determine is how to set the  whole extent to be different.  I tried using vtkStructuredGrid.Crop() but nothing is happening.</div><div><br></div><div>In the code snippet below, I have previously declared points local to each processor.  I now want to populate a structured grid and write a *pvts that ties them all together.  When I run this code the pvts writes itself and the files, but they all have the same whole extent and extent.  Nothing is cropped to the desired local extent.  What am I doing wrong?  How do I specify a whole extent that is uniform across all processors, and a local extent that is specific to each one? </div><div><br></div><div><div>#create grid and filter for processing to writer</div><div>pf=vtk.vtkProgrammableFilter()</div><div>sg=vtk.vtkStructuredGrid()</div><div><br></div><div>#set extent global</div><div>sg.SetExtent(0,15,0,32,0,15)</div><div><br></div><div>#set extent local</div><div>if rank==0:</div><div>   lE=np.array([0,8,0,32,0,8],dtype=int)</div><div>   sg.Crop(lE)</div><div>if rank==1:</div><div>   lE=np.array([0,8,0,32,7,15],dtype=int)</div><div>   sg.Crop(lE)</div><div>if rank==2:</div><div>   lE=np.array([7,15,0,32,0,8],dtype=int)</div><div>   sg.Crop(lE)</div><div>if rank==3:</div><div>   lE=np.array([7,15,0,32,7,15],dtype=int)</div><div>   sg.Crop(lE)</div><div><br></div><div>sg.SetPoints(pnts)</div><div>pf.SetInputData(sg)</div><div><br></div><div>writer=vtk.vtkXMLPStructuredGridWriter()</div><div>writer.SetInputConnection(pf.GetOutputPort())</div><div>writer.SetController(contr)</div><div>writer.SetDataModeToAscii()</div><div>writer.SetFileName('testgrid.pvts')</div><div>writer.SetNumberOfPieces(nranks)</div><div>writer.SetStartPiece(rank)</div><div>writer.SetEndPiece(rank)</div><div>writer.Write()</div></div><div><br></div><div>Thanks,</div><div><br></div><div>Phil</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 13, 2016 at 7:31 AM, Andy Bauer <span dir="ltr"><<a href="mailto:andy.bauer@kitware.com" target="_blank">andy.bauer@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi,<br><br></div>I would recommend using the pvts format since that is the best format for storing structured grids. If you read it back in it will know how to properly partition the data set for different amounts of processes as well as do things like ghost cells, extract surfaces, etc.<br><br></div>For topologically structured grids like vtkStructuredGrid there are two types of extents, "whole extent" describes the beginning and ending node (inclusive) in each direction for the entire grid while "extent" refers to each process's (or pieces if you're serial but doing streaming) partition of the grid. I believe this should be explained in the VTK User's Guide which is now available for free as a pdf download. <br><br></div>Cheers,<br></div>Andy<br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Dec 13, 2016 at 10:21 AM, Philip Sakievich <span dir="ltr"><<a href="mailto:psakievich@gmail.com" target="_blank">psakievich@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><div>Greetings,</div><div><br></div><div>I am reasonably new to vtk and I am mainly using it to manage datasets on structured grids.</div><div><br></div>I am trying to write data for a structured grid in parallel python via MPI.  Each process has a separate portion of the grid, and I'm trying to figure out how to set up the write process. I was following this example:<div><br></div><div><a href="http://www.vtk.org/gitweb?p=VTK.git;a=blob;f=IO/ParallelXML/Testing/Python/testParallelXMLWriters.py" target="_blank">http://www.vtk.org/gitweb?p=VT<wbr>K.git;a=blob;f=IO/ParallelXML/<wbr>Testing/Python/testParallelXML<wbr>Writers.py</a></div><div><br></div><div>But then I realized that in this case each process has the entire grid, and each processor is just writing a portion of the data it contains.  So do I need to use a multiblock data set?  Can someone please provide a simple example of how to write a structured grid in parallel provided each process has the local extent correctly specified? </div><div><br></div><div>Thanks<span class="m_3999332338089669960HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><div class="m_3999332338089669960m_3902007003167008255gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Phil Sakievich</div><div><br></div><div><div>PhD Candidate - Mechanical Engineering</div><div>Arizona State University - Ira A. Fulton School for Engineering of Matter Transport and Energy<br>Tempe, Arizona</div></div></div></div></div></div>
</font></span></div></div>
<br></div></div>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Phil Sakievich</div><div><br></div><div><div>PhD Candidate - Mechanical Engineering</div><div>Arizona State University - Ira A. Fulton School for Engineering of Matter Transport and Energy<br>Tempe, Arizona</div></div></div></div></div></div>
</div>