[visit-developers] corrupt "links" in vtk unstructured grid?

Meredith, Jeremy S. jsmeredith at ornl.gov
Thu Oct 16 17:51:12 EDT 2008


We don't have any control over that, do we?  E.g., the recentering
filter (vtkVisItCellDataToPointData) just calls GetPointCells, and
GetPointCells is the one that calls BuildLinks if Links is NULL.  We'd
have to know which filters use Links even indirectly.  And ShallowCopy
is the one doing the copying of the links.....

So let's turn this around into the safety of my current solution:

Option #1: In this case, MIR needs to simply return the input data set,
but with a new array added ("avtSubsets").  So I have to add the
avtSubsets to the input data set.  That seems a little weird to modify
the input dataset....

Option #2: But if I make a shallow or deep copy (to which I add the
avtSubsets array), I have to test if it's an unstructured grid, and if
so, cast vtkDataSet to vtkUnstructuredGrid and call BuildLinks to force
it to rebuild them.

Neither one of these seems like a particularly elegant solution.  Any
advice on the Right Way to do this?

(BTW, valgrind shows no errors until the point at which this gets to the
recentering filter, so I don't think I'm doing anything blatantly
wrong.)

--
Jeremy Meredith
Oak Ridge National Laboratory


> -----Original Message-----
> From: visit-developers-bounces at email.ornl.gov
[mailto:visit-developers-
> bounces at email.ornl.gov] On Behalf Of Kathleen Bonnell
> Sent: Thursday, October 16, 2008 5:42 PM
> To: VisIt Developers
> Subject: Re: [visit-developers] corrupt "links" in vtk unstructured
> grid?
> 
> Sounds like another filter modified the data before contour received
> it,
> but neglected to update the links ...
> 
> begs the question ... should we be passing around the links or should
> it
> be the case that any filter that requires them should build them on
the
> fly?
> 
> Kathleen
> 
> On Thursday 16 October 2008 14:34, Meredith, Jeremy S. wrote:
> > Excellent question -- not exactly. Let me give you the 5-second
> summary:
> > - I've added code to allow datasets to pass through MIR *untouched*
> > - It technically returns a shallow copy of the dataset (though
> returning
> > a deep copy, or even the original, doesn't appear to fix the
problem)
> > - I'm making a contour plot of a material-selected dataset
> > - And by the time the contour filter wants to recenter the data set,
> it
> > appears to have an unstructured grid with a corrupt Links
> >
> > The problem is that Links isn't empty -- if it were, then
> GetPointCells
> > would create it for me -- it's actually pointing to something that's
> > either been freed, or something.
> >
> > (Speaking of which, vtkUnstructuredGrid::Reset() looks like a good
> > alternative here, but it also resets the Connectivity, which I
> believe
> > is somewhat critical, right?)
> >
> > --
> > Jeremy Meredith
> > Oak Ridge National Laboratory
> >
> > > -----Original Message-----
> > > From: Kathleen Bonnell [mailto:kbonnell at llnl.gov]
> > > Sent: Thursday, October 16, 2008 5:02 PM
> > > To: VisIt Developers; Meredith, Jeremy S.
> > > Subject: Re: [visit-developers] corrupt "links" in vtk
unstructured
> > > grid?
> > >
> > > Jeremy,
> > >
> > > I believe this is needed in order to extract connectivity
> information,
> > > it is used in several filters in VisIt.
> > >
> > > Is your use case a newly constructed grid?
> > >
> > > Kathleen
> > >
> > > On Thursday 16 October 2008 13:48, Meredith, Jeremy S. wrote:
> > > > Has anyone ever come across this before?
> > > >
> > > >
> > > >
> > > > I've gotten into a situation where I need to add a call to
> > >
> > > "BuildLinks"
> > >
> > > > before calling "GetPointCells"  (this is in the cell data to
> point
> > >
> > > data
> > >
> > > > recentering filter).  If I don't, it appears to just be reading
> > >
> > > random
> > >
> > > > uninitialized point ID's for this case.
> > > >
> > > >
> > > >
> > > > (I recall something similar to this, but I'm thinking it's about
> > > > "InitTraversal", not BuildLinks.)
> > > >
> > > >
> > > >
> > > > --
> > > >
> > > > Jeremy Meredith
> > > >
> > > > Oak Ridge National Laboratory



More information about the visit-developers mailing list