<HTML>
<HEAD>
<TITLE>Re: [Paraview] problems generating ghost cells, update on PKdTree questions</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>The UPDATE_NUMBER_OF_GHOST_LEVELS key is used to request the number of ghost levels a filter is supposed to produce. &nbsp;You set it on an algorithm&#8217;s output information. &nbsp;It is passed up the pipeline during the RequestUpdateExtent phase of execution and used during the computation in the RequestData phase. &nbsp;The DATA_NUMBER_OF_GHOST_LEVELS is attached to the data object itself and identifies how many levels were created.<BR>
<BR>
Most of the time the requested UPDATE_NUMBER_OF_GHOST_LEVELS is 0 until a filter needs a layer of ghost cells for proper operation, at which time it bumps up the UPDATE_NUMBER_OF_GHOST_LEVELS in its RequestUpdateExtent. &nbsp;Yours is an uncommon case where you want the result of the pipeline to have ghost levels.<BR>
<BR>
I think the trick is just to call something like<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>d3-&gt;GetOutputPortInformation(0)-&gt;Set(UPDATE_NUMBER_OF_GHOST_LEVELS, 1);<BR>
</SPAN></FONT></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
before calling Update should do the trick.<BR>
<BR>
-Ken<BR>
<BR>
<BR>
On 11/23/09 1:21 PM, &quot;Christine Corbett Moran&quot; &lt;<a href="corbett@physik.uzh.ch">corbett@physik.uzh.ch</a>&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi Ken,<BR>
<BR>
First of all thank you very much for your response.<BR>
<BR>
I see the DATA_NUMBER_OF_GHOST_LEVELS or UPDATE_NUMBER_OF_GHOST_LEVELS<BR>
sets operating on vtkInformation, which I don't call Update on. Should<BR>
I somehow be accessing the vtkDataObject of the vtkInformation (or<BR>
something else related to the pipeline as a whole) and call Update on<BR>
it? &nbsp;That sounds like it is very likely my problem.<BR>
<BR>
Right now<BR>
1. I run D3 within my data reader, I set the output to be D3-&gt;output,<BR>
then the _last thing_ I do is call:<BR>
&nbsp;output-&gt;GetInformation()-&gt;Set(vtkDataObject::DATA_NUMBER_OF_GHOST_LEVELS(), 1);<BR>
2. In a downstream filter which requires ghost cells, the _first<BR>
thing_ I do if running in parallel call:<BR>
&nbsp;&nbsp;inInfo-&gt;Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS(),1);<BR>
<BR>
The documentation I can find on this is pretty fluffy (&quot;filters can<BR>
request ghost cells&quot;), so if anyone points me to something better it<BR>
would help tremendously (or even a good nugget of example code that I<BR>
missed in my grepping).<BR>
<BR>
Cheers,<BR>
Christine<BR>
<BR>
On Mon, Nov 23, 2009 at 8:57 PM, Moreland, Kenneth &lt;<a href="kmorel@sandia.gov">kmorel@sandia.gov</a>&gt; wrote:<BR>
&gt; I think setting UPDATE_NUMBER_OF_GHOST_LEVELS on the output of the filter<BR>
&gt; before calling Update is the right thing to do.  However, in your example<BR>
&gt; code I do not see where that value is getting set.  I only see the update<BR>
&gt; extent being set, and that is not sufficient to produce ghost cells.<BR>
&gt;<BR>
&gt; -Ken<BR>
&gt;<BR>
&gt;<BR>
&gt; On 11/19/09 4:50 PM, &quot;Christine Corbett Moran&quot; &lt;<a href="corbett@physik.uzh.ch">corbett@physik.uzh.ch</a>&gt;<BR>
&gt; wrote:<BR>
&gt;<BR>
&gt; I'm having trouble with generating ghost cells, either on my own or<BR>
&gt; with D3 (via the duplicate boundary points mode). In neither case am I<BR>
&gt; able to see a single ghost level of value 1 for any of my points on a<BR>
&gt; test data set, which has 10,000 cells, one point per cell, distributed<BR>
&gt; on 4 processors. I try both generating ghost cells at level one within<BR>
&gt; my d3 call in my reader as follows:<BR>
&gt;                 vtkSmartPointer&lt;vtkDistributedDataFilter&gt; d3 = \<BR>
&gt;                     vtkSmartPointer&lt;vtkDistributedDataFilter&gt;::New();<BR>
&gt;                 d3-&gt;AddInput(tipsyReadInitialOutput);<BR>
&gt;                 d3-&gt;UpdateInformation();<BR>
&gt;                 vtkStreamingDemandDrivenPipeline* exec = \<BR>
&gt;                         static_cast&lt;vtkStreamingDemandDrivenPipeline*&gt;(d3-&gt;GetExecutive());<BR>
&gt;<BR>
&gt;                 // adds one ghostlevel<BR>
&gt;                 exec-&gt;SetUpdateExtent(exec-&gt;GetOutputInformation(0), piece,<BR>
&gt; numPieces, 1);<BR>
&gt;                 d3-&gt;Update();<BR>
&gt;                 // changing output to output of d3<BR>
&gt;                 output-&gt;ShallowCopy(d3-&gt;GetOutput());<BR>
&gt;                 output-&gt;GetInformation()-&gt;Set(<BR>
&gt;                         vtkDataObject::DATA_NUMBER_OF_GHOST_LEVELS(), 1);<BR>
&gt; And, as far as I can tell, the procedure for a filter requesting ghost<BR>
&gt; levels is:<BR>
&gt;                 // Requesting one level of ghost cells<BR>
&gt;                 vtkInformation* inInfo =<BR>
&gt; inputVector[0]-&gt;GetInformationObject(0);<BR>
&gt;                 inInfo-&gt;Set(<BR>
&gt;                         vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS(),1);<BR>
&gt; And my reader or D3 would then have to access the inInfo act on this<BR>
&gt; request. However neither my filter nor D3 are generating any ghost<BR>
&gt; cells, as is verified by examining:<BR>
&gt;                  output-&gt;GetPointData()-&gt;GetArray(&quot;vtkGhostLevels&quot;)-&gt;GetTuple(<BR>
&gt;                                 nextHaloId)[0]<BR>
&gt; Can any one see what's going on? I've read a chunk of vtk source<BR>
&gt; referencing vtkGhostLevels or using UPDATE_NUMBER_OF_GHOST_LEVELS but<BR>
&gt; haven't found the clue yet.<BR>
&gt;<BR>
&gt; An update on my D3/PKd tree question: I decided to run D3<BR>
&gt; automatically if the user checks a button in my readers and strongly<BR>
&gt; recommend they run D3 if they don't use my readers. I found that<BR>
&gt; BuildLocator() or BuildLocatorFromPoints(points) never worked as I had<BR>
&gt; hoped from the documentation (I wanted to call it once/or on all<BR>
&gt; processes on the PkD tree generated by D3 and have it build a locator<BR>
&gt; which works across all processes, i.e. can also find points belonging<BR>
&gt; to a neighbor process), so instead I build a KdTree locator local to<BR>
&gt; each process, separate from the PKdTree generated by D3, and<BR>
&gt; coordinate a search if necessary, I can still make this highly data<BR>
&gt; parallel for my applications, e.g. finding the mass of all points<BR>
&gt; within a given radius by doing local searches/consolidation and just<BR>
&gt; sending the results for a final consolidation to the root.<BR>
&gt;<BR>
&gt; Christine<BR>
&gt; _______________________________________________<BR>
&gt; Powered by www.kitware.com<BR>
&gt;<BR>
&gt; Visit other Kitware open-source projects at<BR>
&gt; <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><BR>
&gt;<BR>
&gt; Please keep messages on-topic and check the ParaView Wiki at:<BR>
&gt; <a href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a><BR>
&gt;<BR>
&gt; Follow this link to subscribe/unsubscribe:<BR>
&gt; <a href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a><BR>
&gt;<BR>
&gt;<BR>
&gt;<BR>
&gt;<BR>
&gt;    ****      Kenneth Moreland<BR>
&gt;     ***      Sandia National Laboratories<BR>
&gt; ***********<BR>
&gt; *** *** ***  email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
&gt; **  ***  **  phone: (505) 844-8919<BR>
&gt;     ***      web:   <a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
&gt;<BR>
&gt;<BR>
<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT SIZE="1"><FONT FACE="Monaco, Courier New"><SPAN STYLE='font-size:7.5pt'><BR>
&nbsp;&nbsp;&nbsp;**** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Kenneth Moreland<BR>
&nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sandia National Laboratories<BR>
*********** &nbsp;<BR>
*** *** *** &nbsp;email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** &nbsp;*** &nbsp;** &nbsp;phone: (505) 844-8919<BR>
&nbsp;&nbsp;&nbsp;&nbsp;*** &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;web: &nbsp;&nbsp;<a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>