[Paraview] StreamTracer: Combined ReasonForTermination or select individual polylines?
Andy Bauer
andy.bauer at kitware.com
Tue Mar 14 21:01:57 EDT 2017
In Python you can do something like create a Threshold filter to
# create a new 'Threshold'
threshold1 = Threshold(Input=streamTracer1)
threshold1.Scalars = ['CELLS', 'SeedIds']
threshold1.ThresholdRange = [1.0, 2.0]
threshold1.CellData['ReasonForTermination'].GetRange()
This will give you the range of values in the threshold output for the
ReasonForTermination array. You can query the number of seeds for the
high resolution line source with <streamtracer>.SeedType.Resolution
On Tue, Mar 14, 2017 at 4:31 PM, Liang Wang <frank0734 at gmail.com> wrote:
> A follow-up question: How to perform the `Find Data` by `criteria` in
> Python? I tried to record a macro but only got
>
> extractSelection1 = ExtractSelection(Input=tube1,
> Selection=None)
>
> On Tue, Mar 14, 2017 at 3:47 PM, Liang Wang <frank0734 at gmail.com> wrote:
>
>> Thank you, Andy.
>>
>>
>> I):
>>
>> I'm using 5.3 and your example is what I would get. But what I want is a
>> way to tell if the two streamlines from the same seed point are terminated
>> for different reasons. It might be more clear from the image I attached. I
>> would like to tell
>>
>> 1) closed field lines that have both ends terminated on the sphere
>> surface (the red tubes)
>> 2) semi-open field lines that have on the ends terminated on the sphere
>> surface, the other goes out-of-domain (the red and blue tubes)
>> 3) open field lines that have both ends out-of-bound (not shown in the
>> image, would be blue tubes)
>>
>> (Or, ideal, I would be happier to be able to tell if the open end of the
>> semi-open field lines goes out of the southern or northern bound)
>>
>> Indeed, I saw people doing this in Mayavi-based python (see
>> https://github.com/KristoforMaynard/Viscid/blob/dev/viscid/
>> cython/streamline.pyx and http://kristoformaynard.github
>> .io/Viscid/docs/master/examples/mayavi.html). One obstacle I can see is
>> that ParaView (or vtk?) probably treats the two streamlines from the same
>> seed point independently, thus it won't be easy to tag them together.
>>
>> II):
>>
>> I realize that I am demanding too much. I tried your way of `Find Data`,
>> and now I am able to manually choose individual streamlines, which is
>> already helpful.
>>
>>
>>
>> On Tue, Mar 14, 2017 at 3:17 PM, Andy Bauer <andy.bauer at kitware.com>
>> wrote:
>>
>>> Hi,
>>>
>>> What version of ParaView are you using?
>>>
>>> From my testing it looks like each direction for the stream tracer seeds
>>> has a separate reason for termination in PV 5.3 -- see the attached image.
>>> The domain is a box with length 20 on each side, the velocity is [1, 0, 0],
>>> the seeds are a line source going from min to max of the bounding box
>>> ([-10, -10, -10] to [10,10,10]). The red is for when the maximum
>>> streamline length has exceeded my specified max length of 5 and the blue is
>>> for when the streamline exited the domain.
>>>
>>> Is there a case where the same reason for termination value is being
>>> used for multiple termination criteria?
>>>
>>> You can use the SeedIds cell data array in the Threshold filter or use
>>> the Edit->Find Data option to select a given streamline from the seed id.
>>>
>>> Cheers,
>>> Andy
>>>
>>>
>>>
>>> On Tue, Mar 14, 2017 at 2:24 PM, Liang Wang <frank0734 at gmail.com> wrote:
>>>
>>>> If the IntegrationDirection is set to BOTH, the two segments of the
>>>> streamlines from the seed might terminate for different reasons. For
>>>> example, one end might end due to STAGNATION, the other due
>>>> to OUT_OF_DOMAIN. When coloring by ReasonForTermination, then the two
>>>> segments are colored differently.
>>>>
>>>> My question is: Can a user create more cases of ReasonForTermination so
>>>> that we can tell examples like above? Or, how can I select individual
>>>> streamlines by its SeedIds (I tried IdsSelection, but that appears to work
>>>> for cell/point data only, not for polydata?)
>>>>
>>>> My current solution is to use threshold filter to select lines in the
>>>> different regions and apply different solid colors. But it would be nice if
>>>> I can handle a few different cases more directly, even if that involves
>>>> some coding in C++ or Python.
>>>>
>>>> Thanks.
>>>>
>>>> _______________________________________________
>>>> 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 ParaView Wiki at:
>>>> http://paraview.org/Wiki/ParaView
>>>>
>>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>>>
>>>> Follow this link to subscribe/unsubscribe:
>>>> http://public.kitware.com/mailman/listinfo/paraview
>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20170314/e59cca35/attachment.html>
More information about the ParaView
mailing list