[vtkusers] GetEdge() on a vtkUnstructuredGrid?

Nico Schlömer nico.schloemer at gmail.com
Sat Oct 30 19:33:58 EDT 2010


Hm well, I'm thinking that I may want to reorganize my code then a bit actually.
I think the problem occurs quite often in computation that on an
unstructured grid, one particular variable is given at the nodes, and
another one on the (midpoints of the) edges connecting the nodes. This
is often true for vector fields (such as velocities or vector
potentials) which are projected onto the edges.

What's the common scheme to represent them in the VTK data structures?




On Thu, Oct 28, 2010 at 9:46 PM, David Doria <daviddoria at gmail.com> wrote:
> On Thu, Oct 28, 2010 at 3:35 PM, Nico Schlömer <nico.schloemer at gmail.com>
> wrote:
>>
>> Hi,
>>
>> I'm importing VTK files with unstructured grids into and I noticed one
>> particular oddity about it: there is GetCell() and GetPoint() on vtk
>> meshes, but no such thing as GetEdge(). As a matter of fact, it'd be
>> terribly useful to have a notion of an edge as well. Right now I get
>> edges on a cell level which works alright, but duplicates the
>> information as each edge belongs to two cells (2D mesh).
>>
>> Anyone with more insight here?
>>
>> Cheers,
>> Nic
>
> The IsEdge function (in vtkPolyData) will tell you if there is an edge
> between two points:
> http://www.vtk.org/doc/nightly/html/classvtkPolyData.html#ab53e657c8db698aa88109ada1762dff8
> Is this what you are looking for? Or do you somehow want to get an "edge"
> object? It doesn't seem to exist for an vtkUnstructuredGrid. It shouldn't be
> too hard to add using the logic from the function in vtkPolyData or
> something like the GetConnectedVertices function here:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/VertexConnectivity
> David



More information about the vtkusers mailing list