[vtkusers] vtk.vtkExodusIIReader: information in GetOutput()?

Thompson, David C dcthomp at sandia.gov
Sat Dec 11 21:02:15 EST 2010


Hi Nico,

>> Reading the source for its RequestData()
>> method illustrates how to iterate over all the edges yourself if you don't
>> want to use the filter.
> The filter? I'm not familiar with this concept (though it seems to appear within VTK a lot).

In VTK, most of the C++ classes either serve mainly as
+ storage (anything inheriting vtkDataObject)
+ algorithms that take storage as input or produce storage as output or both.
The second set are known as filters, because most take an input dataset
and filter the data in some way to produce an output. For example,
the vtkGeometryFilter takes a mesh as input and produces polygonal
output describing some kind of boundary of the mesh (its bounding points,
edges, or faces).

> If that something that help in iterating over the edges, I'd be more
> than happy to use it of course! Are there examples?

I was suggesting that you look at the C++ source code:
http://vtk.org/gitweb?p=VTK.git;a=blob;f=Graphics/vtkExtractEdges.cxx;h=901e9f968d4510ec4c50a39621dd6dc6e68cbfd5;hb=HEAD
for the vtkExtractEdges class (lines 50--209 in the version above) since I don't
know of any other examples of how to traverse the edges of a mesh. Most of
the C++ methods also exist in the Python wrappings, so you should
be able to translate it into Python if need be.

    David

On Tue, Dec 7, 2010 at 2:43 AM, David Thompson <dcthomp at sandia.gov> wrote:
>> ... I tried the snippet your provided and got
>>
>> ============ *snip* ============
>> Element Blocks
>>  block_5
>> ...
>> ============ *snap* ============
>>
>> I guess that tells me I got one element block, and that'd be it. I
>> guess Exodus is minimalistic in the sense that it contains exactly
>> what was put into the file once, and even though there are egdes in
>> the mesh naturally, they are not stored in the file.
>
> True.
>
>> Do you happen to know if it's possible to iterate over the edges
>> and/or faces of a vtkUnstructuredGrid?
>
> You can use vtkExtractEdges to get a vtkPolyData that contains all the edges
> of the input vtkUnstructuredGrid. Reading the source for its RequestData()
> method illustrates how to iterate over all the edges yourself if you don't
> want to use the filter.
>
>        David
>
>
>





More information about the vtkusers mailing list