[vtkusers] vtkStreamTracer

Berk Geveci berklist at nycap.rr.com
Mon Apr 26 10:42:28 EDT 2004


> Looking at the code, if the filter executes without seeds (no Source or
> StartPosition) then the ReasonForTermination array isn't allocated...
> The allocation is done in ::Integrate() rather than ::Execute() as Jim
> points out.
> 
> 3 changes could be make to the class:
> 
> 1. Instantiate and add the ReasonForTermination array to the output in
> ::Execute()

I disagree. If the output is empty, there is no reason to create the
array. The application should check for this.

> 2. Define the ReasonForTermination array in the class definition along
> with a vtkGetObjectMacro(ReasonForTermination, vtkIntArray) and allocate
> in the constructor

I don't understand why it is so difficult to get the array from the
output. It belongs to the output after all. It is not a "property" of
the filter.

> 3. Put a caveat in the documentation.

This I agree with :-)

By the way, a warning: I have been running into some strange behavior
when using RK 45. I didn't have time to track this yet. I would
appreciate any bug reports.

Also, Jeff has quite a few bug fixes he hasn't committed yet. If you
guys pressure him, he might commit them :-) I have been trying...

> 
> Just my thoughts,
> 
> Goodwin
> -----Original Message-----
> From: James C. Robinson [mailto:j.robinson at kepler-systems.com] 
> Sent: 26 April 2004 13:19
> To: goodwin.lawlor at ucd.ie; Jeff Lee
> Cc: Vtk Users
> Subject: RE: [vtkusers] vtkStreamTracer
> 
> 
> Gents,
> 
> Many thanks for the continued interest. Goodwin, I am using the adaptive
> integrator. I will try the other two types as an experiment, but a big
> part of going to the vtkStreamTracer is to avail of the adaptive
> integrator, so it may indicate whether or not it is the issue, but will
> not resolve it.
> 
> Jeff, the issue of being able to generate a set of streamtracers from a
> rake doesn't negate the possibility of having a method to interrogate it
> directly. The argument could point the vtkSTreamTracer to the seed
> particle for which one wants to determine the reason for termination -
> e.g. vtkStreamTracer::ReasonForTermination(int particlenumber).
> 
> Now, more information: I have discovered that the crash was due to the
> fact that
> vtkIntArray* ReasonForTermination =
> (vtkIntArray*)pStreamLine->GetOutput()->GetCellData()->GetArray("ReasonF
> orTe
> rmination") ;
> 
> was returning a NULL pointer (sometimes) and I was trying (naughty me)
> to use that pointer without checking for this condition. However, the
> question is now, why is the pointer coming back as NULL. I assume that
> it is because some condition is not met before it gets to the
> vtkStreamTracer::Integrate method (which is where "ReasonForTermination"
> is set up). The seed particle points that cause trouble are generally in
> zones where the flow rate is very low. In other areas the two
> ReasonForTermination messages that I am getting are either the stream
> tracer "generated and unexpected value" or exceeded the "max propagation
> time".
> 
> Again many thanks.
> 
> Regards,
> 
> Jim
> 
> ______________________
> 
> James C. Robinson, PhD,
> Chartered Engineer,
> Kepler Simulation Systems Ltd.,
> 42 Rivergrove,
> Glanmire, Co. Cork,
> Eire
> 
> Tel:         +353-21-4822028
> Tel:         +353-87-2393010
> Fax:        +353-21-4822028
> E-mail:     j.robinson at kepler-systems.com
> ______________________
> 
> -----Original Message-----
> From: Goodwin Lawlor [mailto:goodwin.lawlor at ucd.ie]
> Sent: 26 April 2004 12:00
> To: j.robinson at kepler-systems.com
> Subject: RE: [vtkusers] vtkStreamTracer
> 
> Hi Jim,
> 
> Which integrator are you using? If its vtkRungeKutta45 try using
> vtkRungeKutta4 and see if vtkStreamTracer still crashes where the flow
> rate is close to zero. If this solves the problem then it's the adaptive
> time step causing the problem...
> 
> Regards,
> 
> Goodwin
> 
> Ps Actually try each of the integrators and see if they make a
> difference.
> 
> -----Original Message-----
> From: James C. Robinson [mailto:j.robinson at kepler-systems.com]
> Sent: 26 April 2004 10:07
> To: goodwin.lawlor at ucd.ie; Jeff Lee
> Cc: Vtk Users
> Subject: RE: [vtkusers] vtkStreamTracer
> 
> 
> Gents,
> 
> Thanks for your efforts. You have confirmed what I did myself is
> reasonable (Note, for all those harping on about the manual.... Where is
> the syntax for accessing that array explicitly stated in the manual? One
> would think that, since the reason for termination is a kernel part of
> the object, there would be a simple method to interrogate the object
> such as a vtkStreamTracer::ReasonForTermination()).
> 
> You may have more contributions to make. I am finding two main problems
> (and a crash) with the vtkStreamTracer object:
> 1) The streamtube generated is not as long as the one attained using
> vtkStreamLine,
> 2)  There is a crash when I use a source point where the flow rate is
> close to (or equal to) zero.
> 
> Any ideas?
> 
> Regards,
> 
> Jim
> PS: Again, for those saying "give us some example code...". My programme
> is written as an MFC View/Doc with a very structured list of methods for
> newing, creating (setting up) and deleting all the objects that I use.
> It would be an arduous (though perhaps fruitful and worthwhile)
> procedure to extract all the objects and use them in the same way as I
> use them in the overall programme.
> 
> 
> ______________________
> 
> James C. Robinson, PhD,
> Chartered Engineer,
> Kepler Simulation Systems Ltd.,
> 42 Rivergrove,
> Glanmire, Co. Cork,
> Eire
> 
> Tel:         +353-21-4822028
> Tel:         +353-87-2393010
> Fax:        +353-21-4822028
> E-mail:     j.robinson at kepler-systems.com
> ______________________
> 
> -----Original Message-----
> From: Goodwin Lawlor [mailto:goodwin.lawlor at ucd.ie]
> Sent: 25 April 2004 13:05
> To: vtkusers at vtk.org
> Cc: j.robinson at kepler-systems.com
> Subject: RE: [vtkusers] vtkStreamTracer
> 
> Hi Jim
> 
> Tracer->GetOutput()->GetCellData()->GetArray("ReasonForTermination");
> 
> Hth,
> 
> Goodwin
> 
> Message: 3
> Reply-To: <j.robinson at kepler-systems.com>
> From: "James C. Robinson" <j.robinson at kepler-systems.com>
> To: "Vtk Users" <vtkusers at vtk.org>
> Date: Sat, 24 Apr 2004 20:50:06 +0100
> Subject: [vtkusers] vtkStreamTracer
> 
> Dear All,
> 
> In vtkStreamTracer:
> 
> The reason for the termination is stored in a cell array named
> ReasonForTermination.
> 
> How do I access it? (I am probably tired and slow at the moment).
> 
> Thanks,
> 
> Jim
> 
> ______________________
> 
> James C. Robinson, PhD,
> Chartered Engineer,
> Kepler Simulation Systems Ltd.,
> 42 Rivergrove,
> Glanmire, Co. Cork,
> Eire
> 
> Tel:         +353-21-4822028
> Tel:         +353-87-2393010
> Fax:        +353-21-4822028
> E-mail:     j.robinson at kepler-systems.com
> ______________________
> 
> 
> 
> 
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
-- 
Berk Geveci <berklist at nycap.rr.com>




More information about the vtkusers mailing list