<div class="gmail_quote"><div>To clear up some confusion, the only topological grid structures that vtkUnstructuredGrid has are points and cells.  For vtkUnstructuredGrid though there are a bunch of cell types (e.g. lines, quads, tris, vertices, tets, hexes, etc.).  So neighbors/adjacency is really only determined through cells that share the same points (if two points have the same coordinate location this still does not count in the neighbor calculation).<br>
<br>Also, you may want to clarify your concept of neighbors.  It looks like when you say face neighbors of a tet you mean another 3D cell that shares 3 points with that tet (could be another tet, a prism, or a pyramid).  Of course it&#39;s possible that someone specified a tri cell in the grid that also uses those same 3 points and then according to VTK this cell would also be considered a neighbor of that tet.  Other people may consider a neighbor any cell that shares at least one point with the specified cell.  <br>
<br>So to hopefully finally answer your question (assuming I can infer the specifics of your question), an algorithm to get the 3D neighbor cells of a tet you&#39;d have to call GetCellNeighbors() 4 times where the cellId is the vtkIdType of the cell you want the neighbors of, the ptIds list for each call would be {cell point 0, cell point 1, cell point 2}, {cell point 0, cell point 1, cell point 3}, {cell point 0, cell point 2, cell point 3}, and {cell point 1, cell point 2, cell point 3}.  Assuming you have no 2D cells in your mesh that use any of the list of points and you have a valid topological grid, the cellIds list returned would either have size 0 (no neighbor for the given list of points) or 1 (the cell Id of the 3D cell that also uses the given list of points).<br>
<br>You may want to get the VTK User&#39;s Guide to get a better idea of the grid data structures inside of VTK (p. 334 &amp; 335 have the cell definitions in UG #5).<br><br>Andy<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Date: Thu, 21 Jan 2010 10:06:04 +0200<br>
From: Bill Chivas &lt;<a href="mailto:noo134@googlemail.com">noo134@googlemail.com</a>&gt;<br>
Subject: [vtkusers] Fwd: problems with GetCellNeighbors<br>
To: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Message-ID:<br>
        &lt;<a href="mailto:1668c8ff1001210006g76bbe198ve5ed73c75addfc3e@mail.gmail.com">1668c8ff1001210006g76bbe198ve5ed73c75addfc3e@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
 *GetCellNeighbors*   (  vtkIdType  *cellId*,    vtkIdList *  *ptIds*,<br>
vtkIdList *  *cellIds*   )<br>
<br>
1) cellid is the cell i want its neighbors. As &quot;cell&quot; is a e.g. tetrahedron<br>
cell or one of its faces?<br>
2) ptids are cell&#39;s points or one of its faces&#39; points?<br>
3) cellids are cells (e.g. neighboring tetrahedra) or faces (neighboring<br>
faces)?<br>
<br>
I&#39;m a little confused!<br>
<br>
<br>
2010/1/20 Dominik Szczerba &lt;<a href="mailto:domi@vision.ee.ethz.ch">domi@vision.ee.ethz.ch</a>&gt;<br>
<br>
-----BEGIN PGP SIGNED MESSAGE-----<br>
&gt; Hash: SHA1<br>
&gt;<br>
&gt; Yes, GetCellNeighbours is the way to go. AFAIR it expect cell FACE ids<br>
&gt; and will return all cells containing all given points.<br>
&gt;<br>
&gt; Dominik<br>
&gt;<br>
&gt; Bill Chivas wrote:<br>
&gt; &gt; It is an old post (/Tue Jun 27 04:01:59 EDT 2006/).<br>
&gt; &gt; Is it correct?<br>
&gt; &gt; How can i get all neighbors (for cell NOT cell face)?<br>
&gt; &gt;<br>
&gt; &gt;&gt;OK just for others in future - I figured it out.<br>
&gt; &gt;&gt;It is nowhere clearlystated but GetCellNeighbours needs<br>
&gt; &gt;&gt;cell face points and not cell points.<br>
&gt; &gt;&gt;It returns cell face neighbours and not all neighbours.<br>
&gt; &gt;&gt;Dominik<br>
&gt;<br>
&gt; -----BEGIN PGP SIGNATURE-----<br>
&gt; Version: GnuPG v1.4.9 (GNU/Linux)<br>
&gt;<br>
&gt; iEYEARECAAYFAktW+JsACgkQ/EBMh9bUuzJuMwCgpx0v8VEqJNbkg2v14dyFUaHC<br>
&gt; 5wcAoNJRWwdua2vxF4mzM+NgTqtyrejP<br>
&gt; =Uo3b<br>
&gt; -----END PGP SIGNATURE-----<br>
&gt;<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://www.vtk.org/pipermail/vtkusers/attachments/20100121/b44c1be8/attachment-0001.htm" target="_blank">http://www.vtk.org/pipermail/vtkusers/attachments/20100121/b44c1be8/attachment-0001.htm</a>&gt;<br>

<br>
</blockquote></div><br>