[vtkusers] vtkStreamTracer does not fill area

Berk Geveci berk.geveci at kitware.com
Wed Dec 16 12:24:48 EST 2009


Hi Jim,

I finally managed to look at this. In the cvs version of VTK, you can
get pretty good results using Runge-Kutta 4 and using an
InitialStepLength of 0.1 (cell length). I am attaching a screenshot. I
believe that the issue with Runge Kutta 45 is that the gradient of
velocity is very low near the boundary. Therefore, the integrator is
taking large steps. Unfortunately, we don't have the extra necessary
code that adjusts the step or truncates a step to fill the gap at the
boundary. I would suggest submitting a feature request for it at
vtk.org/Bug.

-berk


On Fri, Oct 16, 2009 at 9:19 AM, Jim Shain <jimshain at hotmail.com> wrote:
>
> I've enclosed an image.
>
> The SampleRate is   igrid->SetSampleRate(4, 1, 4);
>
> A smaller SampleRate has more Streamlines but the skip over the pieces is
> still there (it's just a bit harder to see).  Larger SampleRates obviously
> have fewer lines but the skip is still there.
>
> I do not see how to get the dataset out of vtkStreamTracer (which is
> streamer down below).   PrintSelf?  Print?  I have tried several different
> ways and could not get that to work.  How can I do that?
>
> Thanks!
>
> Jim
>
>
>
>
>> Date: Fri, 16 Oct 2009 08:52:41 -0400
>> Subject: Re: [vtkusers] vtkStreamTracer does not fill area
>> From: berk.geveci at kitware.com
>> To: jimshain at hotmail.com
>> CC: vtkusers at vtk.org
>>
>> Can you post an example dataset and an image? (or e-mail them to me
>> directly)
>>
>> 2009/10/15 Jim Shain <jimshain at hotmail.com>:
>> >
>> > Hi,
>> >
>> > When I try to use  vtkStreamTracer the Streamlines do not go all the way
>> > to
>> > the edge of the object.  It stops a bit short, giving the impression
>> > that
>> > there are no Streamlines there.   I get the streamer from an
>> > vtkExtractGrid
>> > (igrid below).  After the Streamline I use a vtkPolyDataMapper (mapper,
>> > below) and a vtkActor (called actor down below).  The pp_ below has a
>> > list
>> > of processor data.
>> >
>> >  I have looked around quite a bit and cannot find a solution.
>> >
>> >
>> > vtkSmartPointer<vtkExtractGrid> igrid;
>> > igrid.TakeReference(vtkExtractGrid::New());
>> >
>> > igrid->SetInputConnection(pdata_[i]->GetOutputPort());
>> > igrid->SetSampleRate(skip+1, 1, skip+1);
>> > igrid->IncludeBoundaryOn();
>> >
>> > // streamer
>> > vtkSmartPointer<vtkStreamTracer> streamer;
>> > streamer.TakeReference(vtkStreamTracer::New());
>> > streamer->SetInputConnection(pdata_[i]->GetOutputPort());
>> > streamer->SetSource(igrid->GetOutput());
>> > streamer->SetMaximumPropagation(2,pp_->nj(i));
>> >
>> > streamer->SetMinimumIntegrationStep(2,0.1);
>> > streamer->SetMaximumIntegrationStep(2,1.0);
>> > streamer->SetInitialIntegrationStep(2, 0.5);
>> >
>> > streamer->SetIntegratorTypeToRungeKutta45();
>> > streamer->SetMaximumError(1.0e-8);
>> > streamer->SetIntegrationDirectionToBoth();
>> > streamer->ComputeVorticityOff();
>> >
>> > // mapper
>> > vtkSmartPointer<vtkPolyDataMapper> mapper;
>> > mapper.TakeReference(vtkPolyDataMapper::New());
>> > mapper->SetInputConnection(streamer->GetOutputPort());
>> > mapper->ScalarVisibilityOn();
>> > mapper->ImmediateModeRenderingOn();
>> > mappers_.push_back(mapper);
>> > streamline_mappers_.push_back(mapper);
>> >
>> >
>> > // add actor
>> > for(int rot=rot_beg;rot<rot_end;++rot)
>> > {
>> >    double rotate = rot*360.0/nblades;
>> >    vtkSmartPointer<vtkActor> actor;
>> >    if(!rot)
>> >    {
>> >       actor.TakeReference(vtkActor::New());
>> >       actor->SetMapper(mapper);
>> >       actor->RotateZ(rotate);
>> >       actor->SetVisibility(0);
>> >       ren_->AddActor(actor);
>> >    }
>> >    streamlines_.push_back(actor);
>> > }
>> >
>> >
>> > Thanks!
>> >
>> > Jim Shain
>> >
>> >
>> > ________________________________
>> > Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. Sign up
>> > now.
>> > _______________________________________________
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the VTK FAQ at:
>> > http://www.vtk.org/Wiki/VTK_FAQ
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://www.vtk.org/mailman/listinfo/vtkusers
>> >
>> >
>
> ________________________________
> Hotmail: Free, trusted and rich email service. Get it now.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: slines.png
Type: image/png
Size: 50744 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091216/d0351a3d/attachment.png>


More information about the vtkusers mailing list