[Paraview] programmable access to vector components (via Python)

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Fri May 25 16:17:05 EDT 2012


I think this might be same as the bug: http://paraview.org/Bug/view.php?id=12951

Utkarsh

On Fri, May 25, 2012 at 4:13 PM, Berk Geveci <berk.geveci at kitware.com> wrote:
> Which version of ParaView is this? This bug sounds very familiar to me and I
> vaguely remember sitting down with Utkarsh to fix it. If it is an older
> version, can you try 3.14?
>
> As for the Python notation, take a look at:
>
> http://paraview.org/Wiki/ParaView/Users_Guide/Python_Programmable_Filter
> http://paraview.org/Wiki/ParaView/Users_Guide/Python_Calculator
>
> You need to use something like: inputs[0].CellData['mechTensor'][:, n]
> where n is whichever component that you are accessing. This notation is
> based on Numpy. You can learn more about it here:
>
> Guide to NumPy - Trelgol
>
> Note that NumPy is much more powerful and efficient that the Array
> Calculator so I'd recommend using the Python Calculator or the Python
> Programmable Filter whenever possible.
>
>
> -berk
>
>
> On Fri, May 25, 2012 at 10:03 AM, Fabian Wein
> <fabian.wein at am.uni-erlangen.de> wrote:
>>>
>>> It appears to me you have found a limitation (or bug?) in the
>>> Calculator filter. My comments are inserted below.
>>
>>
>> I just submitted a bug report: http://paraview.org/Bug/view.php?id=13204
>>
>>
>>> files, however, I have never used it. I graduated from VTK
>>> XML-structured ASCII-text results files to the EnSight
>>> binary-formatted specification in order to get compact, manageable
>>> file-sets for my modestly large explicit transient dynamic simulations.
>>
>>
>> We are happy with HDF5 but this requires a own reader plugin for
>> our format which we wrote some years ago. With HDF5 we have also access
>> via Matlab, with is a plus for us.
>>
>>
>>> If the error message reflects a "limitation" in the Calculator, then
>>> the Calculator only processes scalars and vectors (1st-order tensors),
>>> and that in itself is no small accomplishment.
>>
>>
>> My "mechTensor" is just a vector with 6 components, so the limitation is
>> with the size of the vector.
>>
>> This answers two of my questions:
>>
>>
>>> * am I right with the assumption, that the calculator does not like
>>> double characters after the underline?
>>> * Is this XX, YY, ... coming from Paraview?
>>
>>
>> Anyone who can help me with the following two?
>>
>>
>>> * How do I access the vector components via python?
>>> * Where can I find more information about the python interface?
>>
>>
>> Thanks a lot,
>>
>> Fabian
>>
>> _______________________________________________
>> 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
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.paraview.org/mailman/listinfo/paraview
>
>
>
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>


More information about the ParaView mailing list