<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>
<div>
<div>Perhaps it is outputting a composite data set of some type? &nbsp;Try running GetClassName() to see what type of data object it really is.</div>
</div>
</div>
<div><br>
</div>
<div>-Ken</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Andrew Parker &lt;<a href="mailto:andy.john.parker@googlemail.com">andy.john.parker@googlemail.com</a>&gt;<br>
<span style="font-weight:bold">Date: </span>Tuesday, November 6, 2012 9:50 AM<br>
<span style="font-weight:bold">To: </span>Kenneth Moreland &lt;<a href="mailto:kmorel@sandia.gov">kmorel@sandia.gov</a>&gt;<br>
<span style="font-weight:bold">Cc: </span>&quot;<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>&quot; &lt;<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>&gt;, &quot;<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>&quot; &lt;<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>&gt;<br>
<span style="font-weight:bold">Subject: </span>[EXTERNAL] Re: [Paraview] vtkDistributedDataFilter and ghost cells<br>
</div>
<div><br>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;">
<div>
<div>Thanks on both accounts. &nbsp;Any thoughts why the downcast called after dd-&gt;Update() on distributedDataFilter is a null pointer? &nbsp;As in, dd is working perfectly properly, but I don't seem to be able to extract a valid unstructuredgrid. &nbsp;For a follow up question
 I assume getPointData()-&gt;GetGlobalIds() gives the local to global for the mesh nodes, and I should use getCellData()-&gt;GetGlobalIds() to get the local to global for the cells? &nbsp;Once I get a valid pointer that is....
<div><br>
</div>
<div>Cheers again,</div>
<div>Andy<br>
<br>
<div class="gmail_quote">On 6 November 2012 16:40, 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;font-family:Calibri,sans-serif;word-wrap:break-word">
<div>
<div>
<div>You should be able to do a vtkUnstructuredGrid::SafeDownCast() to the data to get the unstructured mesh (and access to the point data).</div>
</div>
</div>
<div><br>
</div>
<div>-Ken</div>
<div><br>
</div>
<span>
<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 9:32 AM<br>
<span style="font-weight:bold">To: </span>Kenneth Moreland &lt;<a href="mailto:kmorel@sandia.gov" target="_blank">kmorel@sandia.gov</a>&gt;<br>
<span style="font-weight:bold">Cc: </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] Re: [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>Another question which I'd forgotten, how do I get to a vtkUnstructuredGrid per processor from the&nbsp;<span style="font-size: 14px; font-family: Calibri, sans-serif; ">vtkDistributedDataFilter.</span>
<div><font face="Calibri,sans-serif"><span style="font-size:14px"><br>
</span></font></div>
<div><font face="Calibri,sans-serif"><span style="font-size:14px">For instance,&nbsp;</span></font><span style="font-size: 14px; font-family: Calibri, sans-serif; ">dd-&gt;GetOutput()-&gt;GetPointData(</span><span style="font-size: 14px; font-family: Calibri, sans-serif; ">)-&gt;GetGlobalIds()&nbsp;doesn't
 work as it's a vtkDataObject</span></div>
<div><font face="Calibri,sans-serif"><span style="font-size:14px"><br>
</span></font></div>
<div><font face="Calibri,sans-serif"><span style="font-size:14px">Stupid question I'm sure but the doxy notes say this type returns an unstructured mesh, but I can't seem to get it out? &nbsp;</span></font></div>
<div><font face="Calibri,sans-serif"><span style="font-size:14px"><br>
</span></font></div>
<div><font face="Calibri,sans-serif"><span style="font-size:14px">Also, why exactly do I need the vtkPieceScalars and&nbsp;</span></font><span style="font-size: 14px; font-family: Calibri, sans-serif; ">vtkDataSetSurfaceFilter</span><span style="font-size: 14px; font-family: Calibri, sans-serif; ">&nbsp;again?
 If the above can be made to work and return the mapping, what are they adding in terms of information?</span></div>
<div><font face="Calibri,sans-serif"><span style="font-size:14px"><br>
</span></font></div>
<div><font face="Calibri,sans-serif"><span style="font-size:14px">Thanks again,</span></font></div>
<div><font face="Calibri,sans-serif"><span style="font-size:14px">Andy<br>
</span></font><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. &nbsp;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. &nbsp;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. &nbsp;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">&nbsp; vtkInformation *vtkNotUsed(request),</font></div>
<div><font face="Consolas">&nbsp; vtkInformationVector **inputVector,</font></div>
<div><font face="Consolas">&nbsp; vtkInformationVector *outputVector)</font></div>
<div><font face="Consolas">{</font></div>
<div><font face="Consolas">&nbsp; // get the info objects</font></div>
<div><font face="Consolas">&nbsp; vtkInformation *inInfo = inputVector[0]-&gt;GetInformationObject(0);</font></div>
<div><font face="Consolas">&nbsp; vtkInformation *outInfo = outputVector-&gt;GetInformationObject(0);</font></div>
<div><font face="Consolas"><br>
</font></div>
<div><font face="Consolas">&nbsp; int piece, numPieces, ghostLevels;</font></div>
<div><font face="Consolas"><br>
</font></div>
<div><font face="Consolas">&nbsp; // We require an extra layer of ghost cells from upstream.</font></div>
<div><font face="Consolas"><br>
</font></div>
<div><font face="Consolas">&nbsp; piece = outInfo-&gt;Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER());</font></div>
<div><font face="Consolas">&nbsp; numPieces =</font></div>
<div><font face="Consolas">&nbsp; &nbsp; outInfo-&gt;Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES());</font></div>
<div><font face="Consolas">&nbsp; ghostLevels =&nbsp;</font></div>
<div><font face="Consolas">&nbsp; &nbsp; 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">&nbsp; inInfo-&gt;Set(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER(), piece);</font></div>
<div><font face="Consolas">&nbsp; inInfo-&gt;Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES(),</font></div>
<div><font face="Consolas">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; numPieces);</font></div>
<div><font face="Consolas">&nbsp; inInfo-&gt;Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS(),</font></div>
<div><font face="Consolas">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ghostLevels);</font></div>
<div><font face="Consolas"><br>
</font></div>
<div><font face="Consolas">&nbsp; 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. &nbsp;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'm not totally sure how to make that work. &nbsp;It'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>
<div><br>
</div>
<blockquote style="BORDER-LEFT:#b5c4df 5 solid;PADDING:0 0 0 5;MARGIN:0 0 0 5">
<div>
<div>
<div>Hi,&nbsp;</div>
<div><br>
</div>
<div>Hope you can help. &nbsp;I have some code running in parallel, that by other means I have&nbsp;constructed&nbsp;nprocs worth of vtkRectilinearGrids, one per process. &nbsp;Each of which is a valid nprocs-worth of the whole serial mesh, I've check this and I am happy with
 that i.e. it's partitioned properly and nothing is missing. &nbsp;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&nbsp;corresponding&nbsp;global single mesh.</div>
<div>2) I would like to know which cells are on processor boundaries for parallel exchange&nbsp;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's own local rgrid as I said. &nbsp;I do the following:</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"></span>&nbsp;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>&nbsp;dd-&gt;SetInput(rgrid);</div>
<div><span style="white-space:pre-wrap"></span>&nbsp;</div>
<div><span style="white-space:pre-wrap"></span>&nbsp;dd-&gt;SetController(getVtkController());</div>
<div><span style="white-space:pre-wrap"></span></div>
<div><span style="white-space:pre-wrap"></span>&nbsp;dd-&gt;SetBoundaryModeToSplitBoundaryCells(); &nbsp;</div>
<div><span style="white-space:pre-wrap"></span>&nbsp;//dd-&gt;SetBoundaryModeToAssignToOneRegion();</div>
<div><span style="white-space:pre-wrap"></span>&nbsp;//dd-&gt;SetBoundaryModeToAssignToAllIntersectingRegions();</div>
<div><span style="white-space:pre-wrap"></span>&nbsp;dd-&gt;UseMinimalMemoryOff();</div>
<div><span style="white-space:pre-wrap"></span>&nbsp;dd-&gt;Update();</div>
<div><span style="white-space:pre-wrap"></span></div>
<div><span style="white-space:pre-wrap"></span>&nbsp;vtkPieceScalars *ps = vtkPieceScalars::New();</div>
<div><span style="white-space:pre-wrap"></span>&nbsp;ps-&gt;SetInputConnection(dd-&gt;GetOutputPort());</div>
<div><span style="white-space:pre-wrap"></span>&nbsp;ps-&gt;SetScalarModeToCellData();</div>
<div><span style="white-space:pre-wrap"></span></div>
<div><span style="white-space:pre-wrap"></span>&nbsp;vtkDataSetSurfaceFilter *dss = vtkDataSetSurfaceFilter::New();</div>
<div><span style="white-space:pre-wrap"></span>&nbsp;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've partitioned them up, but sum to the same serial mesh so I am happy with that working correctly.
 But I can'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. &nbsp;I can't figure out how to extract it however. &nbsp;I also have no idea how to modify each local processor rgrid
 to include the ghost cells for that processor. &nbsp;Finally given that info, I could exchange between&nbsp;processors&nbsp;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>&nbsp;&nbsp; Dr Andrew Parker</p>
<p>&nbsp;&nbsp; <a href="mailto:Em@il" target="_blank">Em@il</a>:&nbsp; <a href="mailto:andrew.parker@cantab.net" target="_blank">
andrew.parker@cantab.net</a></p>
<br>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</span></div>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<p>__________________________________</p>
<p>&nbsp;&nbsp; Dr Andrew Parker</p>
<p>&nbsp;&nbsp; <a href="mailto:Em@il" target="_blank">Em@il</a>:&nbsp; <a href="mailto:andrew.parker@cantab.net" target="_blank">
andrew.parker@cantab.net</a></p>
<br>
</div>
</div>
</div>
</blockquote>
</span>
</body>
</html>