Many thanks for this.  <div><br></div><div>So I need to rethink my design such that I extend from a filter so I can obtain the ghost cells?  There is no way to obtain them just from dd? <div><br></div><div>I can&#39;t do dd-&gt;GetGhostCells(processorNumber)?  </div>
<div>or rgrid-&gt;AddGhostCells(dd)?</div><div><br></div><div>I know I can&#39;t do these last two, but that&#39;s kind of the thing I was after....</div><div><br></div><div>are there any other ways to do this?  Casting my current work in terms of a filter is not going to be straight forward, although equally I&#39;ll have to if this is the only way....so other ideas welcome.</div>
<div><br></div><div>Cheers again,</div><div>Andy<br><br><div class="gmail_quote">On 6 November 2012 16:00, Moreland, Kenneth <span dir="ltr">&lt;<a href="mailto:kmorel@sandia.gov" target="_blank">kmorel@sandia.gov</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="font-size:14px;word-wrap:break-word">
<div style="font-family:Calibri,sans-serif">
<div>
<div>I believe vtkDistributedDataFilter will always return with global point ids (a mapping from local point ids to global point ids), although it might pass them if they already exist.  So dd-&gt;GetOutput()-&gt;GetPointData()-&gt;GetGlobalIds() should return the array
 that gives this mapping.</div>
</div>
</div>
<div style="font-family:Calibri,sans-serif"><br>
</div>
<div style="font-family:Calibri,sans-serif">Ghost cells are only created on demand, and this is usually done by pipeline convention.  If you have a filter that needs a layer of ghost cells, it should override the RequestUpdateExtent method to increment
 the value of UPDATE_NUMBER_OF_GHOST_LEVELS from the output information to the input information.  This method would look something like this.</div>
<div style="font-family:Calibri,sans-serif"><br>
</div>
<blockquote style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:40px;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px">

<div>
<div><font face="Consolas">int vtkDistributedDataFilter::RequestUpdateExtent(</font></div>
<div><font face="Consolas">  vtkInformation *vtkNotUsed(request),</font></div>
<div><font face="Consolas">  vtkInformationVector **inputVector,</font></div>
<div><font face="Consolas">  vtkInformationVector *outputVector)</font></div>
<div><font face="Consolas">{</font></div>
<div><font face="Consolas">  // get the info objects</font></div>
<div><font face="Consolas">  vtkInformation *inInfo = inputVector[0]-&gt;GetInformationObject(0);</font></div>
<div><font face="Consolas">  vtkInformation *outInfo = outputVector-&gt;GetInformationObject(0);</font></div>
<div><font face="Consolas"><br>
</font></div>
<div><font face="Consolas">  int piece, numPieces, ghostLevels;</font></div>
<div><font face="Consolas"><br>
</font></div>
<div><font face="Consolas">  // We require an extra layer of ghost cells from upstream.</font></div>
<div><font face="Consolas"><br>
</font></div>
<div><font face="Consolas">  piece = outInfo-&gt;Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER());</font></div>
<div><font face="Consolas">  numPieces =</font></div>
<div><font face="Consolas">    outInfo-&gt;Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES());</font></div>
<div><font face="Consolas">  ghostLevels = </font></div>
<div><font face="Consolas">    outInfo-&gt;Get(</font><span style="font-family:Consolas">vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS());</span></div>
<div><font face="Consolas"><br>
</font></div>
<div><font face="Consolas">  inInfo-&gt;Set(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER(), piece);</font></div>
<div><font face="Consolas">  inInfo-&gt;Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES(),</font></div>
<div><font face="Consolas">              numPieces);</font></div>
<div><font face="Consolas">  inInfo-&gt;Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS(),</font></div>
<div><font face="Consolas">              ghostLevels);</font></div>
<div><font face="Consolas"><br>
</font></div>
<div><font face="Consolas">  return 1;</font></div>
<div><font face="Consolas">}</font></div>
</div>
</blockquote>
<div style="font-family:Calibri,sans-serif"><br>
</div>
<div style="font-family:Calibri,sans-serif">The operation of the RequestData method should also strip off this layer of ghost cells.  It might be possible to request a layer of ghost cells by setting UPDATE_NUMBER_OF_GHOST_LEVELS at the bottom of the pipeline,
 but I&#39;m not totally sure how to make that work.  It&#39;s probably easier (or at least cleaner) to do it from within a filter.</div>
<div style="font-family:Calibri,sans-serif"><br>
</div>
<div style="font-family:Calibri,sans-serif">-Ken</div>
<div style="font-family:Calibri,sans-serif"><br>
</div>
<span style="font-family:Calibri,sans-serif">
<div style="border-right:medium none;padding-right:0in;padding-left:0in;padding-top:3pt;text-align:left;font-size:11pt;border-bottom:medium none;font-family:Calibri;border-top:#b5c4df 1pt solid;padding-bottom:0in;border-left:medium none">

<span style="font-weight:bold">From: </span>Andrew Parker &lt;<a href="mailto:andy.john.parker@googlemail.com" target="_blank">andy.john.parker@googlemail.com</a>&gt;<br>
<span style="font-weight:bold">Date: </span>Tuesday, November 6, 2012 8:25 AM<br>
<span style="font-weight:bold">To: </span>&quot;<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>&quot; &lt;<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>&gt;, &quot;<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>&quot; &lt;<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>&gt;<br>

<span style="font-weight:bold">Subject: </span>[EXTERNAL] [Paraview] vtkDistributedDataFilter and ghost cells<br>
</div><div><div class="h5">
<div><br>
</div>
<blockquote style="BORDER-LEFT:#b5c4df 5 solid;PADDING:0 0 0 5;MARGIN:0 0 0 5">
<div>
<div>
<div>Hi, </div>
<div><br>
</div>
<div>Hope you can help.  I have some code running in parallel, that by other means I have constructed nprocs worth of vtkRectilinearGrids, one per process.  Each of which is a valid nprocs-worth of the whole serial mesh, I&#39;ve check this and I am happy with
 that i.e. it&#39;s partitioned properly and nothing is missing.  I need the following information to process my data in parallel:</div>
<div><br>
</div>
<div>1) I would like the local -&gt; global cell mapping between the local rgrid and the corresponding global single mesh.</div>
<div>2) I would like to know which cells are on processor boundaries for parallel exchange purposes.</div>
<div>3) I would like all the double arrays per processor to be &quot;expanded&quot; by the amount of (1 level of) ghost cells such that I can properly do the computations I want with the ability to exchange only those additional cells given the local to global mapping.</div>

<div><br>
</div>
<div>I have tried from the examples to use the following code, which I call on every process, each of which has it&#39;s own local rgrid as I said.  I do the following:</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"></span> vtkSmartPointer&lt;vtkDistributedDataFilter&gt; dd = vtkSmartPointer&lt;vtkDistributedDataFilter&gt;::New();</div>
<div><span style="white-space:pre-wrap"></span></div>
<div><span style="white-space:pre-wrap"></span> dd-&gt;SetInput(rgrid);</div>
<div><span style="white-space:pre-wrap"></span> </div>
<div><span style="white-space:pre-wrap"></span> dd-&gt;SetController(getVtkController());</div>
<div><span style="white-space:pre-wrap"></span></div>
<div><span style="white-space:pre-wrap"></span> dd-&gt;SetBoundaryModeToSplitBoundaryCells();  </div>
<div><span style="white-space:pre-wrap"></span> //dd-&gt;SetBoundaryModeToAssignToOneRegion();</div>
<div><span style="white-space:pre-wrap"></span> //dd-&gt;SetBoundaryModeToAssignToAllIntersectingRegions();</div>
<div><span style="white-space:pre-wrap"></span> dd-&gt;UseMinimalMemoryOff();</div>
<div><span style="white-space:pre-wrap"></span> dd-&gt;Update();</div>
<div><span style="white-space:pre-wrap"></span></div>
<div><span style="white-space:pre-wrap"></span> vtkPieceScalars *ps = vtkPieceScalars::New();</div>
<div><span style="white-space:pre-wrap"></span> ps-&gt;SetInputConnection(dd-&gt;GetOutputPort());</div>
<div><span style="white-space:pre-wrap"></span> ps-&gt;SetScalarModeToCellData();</div>
<div><span style="white-space:pre-wrap"></span></div>
<div><span style="white-space:pre-wrap"></span> vtkDataSetSurfaceFilter *dss = vtkDataSetSurfaceFilter::New();</div>
<div><span style="white-space:pre-wrap"></span> dss-&gt;SetInputConnection(ps-&gt;GetOutputPort());</div>
<div><br>
</div>
<div>The dd object works fine and writing its contents out on each processor gives nprocs worth of meshes, each of which look slightly different to the way I&#39;ve partitioned them up, but sum to the same serial mesh so I am happy with that working correctly.
 But I can&#39;t for the life of me figure out how to obtain local to global cell mappings, allocate ghost cells, or work out how to exchange data given the above partition info and comms....</div>
<div><br>
</div>
<div>Note I have not provided any additional information to &quot;dd&quot; regarding global cells as per the doxy notes so I assume it went away and computed it.  I can&#39;t figure out how to extract it however.  I also have no idea how to modify each local processor rgrid
 to include the ghost cells for that processor.  Finally given that info, I could exchange between processors to write to each local processors ghost cells the corresponding &quot;real&quot; cell data from the neighbouring meshes and continue the code.</div>

<div><br>
</div>
<div>Any help really appreciated!</div>
<div><br>
Cheers,</div>
<div>Andy</div>
<div><br>
</div>
</div>
</div>
</blockquote>
</div></div></span>
</div>

</blockquote></div><br><br clear="all"><div><br></div>-- <br><p>__________________________________</p><p>   Dr Andrew Parker</p><p>   <a href="mailto:Em@il" target="_blank">Em@il</a>:  <a href="mailto:andrew.parker@cantab.net" target="_blank">andrew.parker@cantab.net</a></p>
<br>
</div></div>