<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'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'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's Guide to get a better idea of the grid data structures inside of VTK (p. 334 & 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 <<a href="mailto:noo134@googlemail.com">noo134@googlemail.com</a>><br>
Subject: [vtkusers] Fwd: problems with GetCellNeighbors<br>
To: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Message-ID:<br>
<<a href="mailto:1668c8ff1001210006g76bbe198ve5ed73c75addfc3e@mail.gmail.com">1668c8ff1001210006g76bbe198ve5ed73c75addfc3e@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
*GetCellNeighbors* ( vtkIdType *cellId*, vtkIdList * *ptIds*,<br>
vtkIdList * *cellIds* )<br>
<br>
1) cellid is the cell i want its neighbors. As "cell" is a e.g. tetrahedron<br>
cell or one of its faces?<br>
2) ptids are cell's points or one of its faces' points?<br>
3) cellids are cells (e.g. neighboring tetrahedra) or faces (neighboring<br>
faces)?<br>
<br>
I'm a little confused!<br>
<br>
<br>
2010/1/20 Dominik Szczerba <<a href="mailto:domi@vision.ee.ethz.ch">domi@vision.ee.ethz.ch</a>><br>
<br>
-----BEGIN PGP SIGNED MESSAGE-----<br>
> Hash: SHA1<br>
><br>
> Yes, GetCellNeighbours is the way to go. AFAIR it expect cell FACE ids<br>
> and will return all cells containing all given points.<br>
><br>
> Dominik<br>
><br>
> Bill Chivas wrote:<br>
> > It is an old post (/Tue Jun 27 04:01:59 EDT 2006/).<br>
> > Is it correct?<br>
> > How can i get all neighbors (for cell NOT cell face)?<br>
> ><br>
> >>OK just for others in future - I figured it out.<br>
> >>It is nowhere clearlystated but GetCellNeighbours needs<br>
> >>cell face points and not cell points.<br>
> >>It returns cell face neighbours and not all neighbours.<br>
> >>Dominik<br>
><br>
> -----BEGIN PGP SIGNATURE-----<br>
> Version: GnuPG v1.4.9 (GNU/Linux)<br>
><br>
> iEYEARECAAYFAktW+JsACgkQ/EBMh9bUuzJuMwCgpx0v8VEqJNbkg2v14dyFUaHC<br>
> 5wcAoNJRWwdua2vxF4mzM+NgTqtyrejP<br>
> =Uo3b<br>
> -----END PGP SIGNATURE-----<br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<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>><br>
<br>
</blockquote></div><br>