<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? 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 <<a href="mailto:andy.john.parker@googlemail.com">andy.john.parker@googlemail.com</a>><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 <<a href="mailto:kmorel@sandia.gov">kmorel@sandia.gov</a>><br>
<span style="font-weight:bold">Cc: </span>"<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>" <<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>>, "<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>" <<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>><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. Any thoughts why the downcast called after dd->Update() on distributedDataFilter is a null pointer? As in, dd is working perfectly properly, but I don't seem to be able to extract a valid unstructuredgrid. For a follow up question
I assume getPointData()->GetGlobalIds() gives the local to global for the mesh nodes, and I should use getCellData()->GetGlobalIds() to get the local to global for the cells? 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">
<<a href="mailto:kmorel@sandia.gov" target="_blank">kmorel@sandia.gov</a>></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 <<a href="mailto:andy.john.parker@googlemail.com" target="_blank">andy.john.parker@googlemail.com</a>><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 <<a href="mailto:kmorel@sandia.gov" target="_blank">kmorel@sandia.gov</a>><br>
<span style="font-weight:bold">Cc: </span>"<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>" <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>>, "<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>"
<<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>><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 <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, </span></font><span style="font-size: 14px; font-family: Calibri, sans-serif; ">dd->GetOutput()->GetPointData(</span><span style="font-size: 14px; font-family: Calibri, sans-serif; ">)->GetGlobalIds() 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? </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 </span></font><span style="font-size: 14px; font-family: Calibri, sans-serif; ">vtkDataSetSurfaceFilter</span><span style="font-size: 14px; font-family: Calibri, sans-serif; "> 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">
<<a href="mailto:kmorel@sandia.gov" target="_blank">kmorel@sandia.gov</a>></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->GetOutput()->GetPointData()->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]->GetInformationObject(0);</font></div>
<div><font face="Consolas"> vtkInformation *outInfo = outputVector->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->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER());</font></div>
<div><font face="Consolas"> numPieces =</font></div>
<div><font face="Consolas"> outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES());</font></div>
<div><font face="Consolas"> ghostLevels = </font></div>
<div><font face="Consolas"> outInfo->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->Set(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER(), piece);</font></div>
<div><font face="Consolas"> inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES(),</font></div>
<div><font face="Consolas"> numPieces);</font></div>
<div><font face="Consolas"> inInfo->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'm not totally sure how to make that work. 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 <<a href="mailto:andy.john.parker@googlemail.com" target="_blank">andy.john.parker@googlemail.com</a>><br>
<span style="font-weight:bold">Date: </span>Tuesday, November 6, 2012 8:25 AM<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>" <<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>>, "<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>"
<<a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>><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, </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've check this and I am happy with
that i.e. it'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 -> 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 "expanded" 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. I do the following:</div>
<div><br>
</div>
<div><span style="white-space:pre-wrap"></span> vtkSmartPointer<vtkDistributedDataFilter> dd = vtkSmartPointer<vtkDistributedDataFilter>::New();</div>
<div><span style="white-space:pre-wrap"></span></div>
<div><span style="white-space:pre-wrap"></span> dd->SetInput(rgrid);</div>
<div><span style="white-space:pre-wrap"></span> </div>
<div><span style="white-space:pre-wrap"></span> dd->SetController(getVtkController());</div>
<div><span style="white-space:pre-wrap"></span></div>
<div><span style="white-space:pre-wrap"></span> dd->SetBoundaryModeToSplitBoundaryCells(); </div>
<div><span style="white-space:pre-wrap"></span> //dd->SetBoundaryModeToAssignToOneRegion();</div>
<div><span style="white-space:pre-wrap"></span> //dd->SetBoundaryModeToAssignToAllIntersectingRegions();</div>
<div><span style="white-space:pre-wrap"></span> dd->UseMinimalMemoryOff();</div>
<div><span style="white-space:pre-wrap"></span> dd->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->SetInputConnection(dd->GetOutputPort());</div>
<div><span style="white-space:pre-wrap"></span> ps->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->SetInputConnection(ps->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 "dd" regarding global cells as per the doxy notes so I assume it went away and computed it. I can'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 "real" 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>
</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>
</div>
</blockquote>
</span>
</body>
</html>