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