[Paraview] python scripting / calculator filter

Peter Brady petertbrady at gmail.com
Tue Dec 2 16:53:47 EST 2008


Here's something I did recently

calc = servermanager.filters.Calculator(Input=pderiv)
calc.ResultArrayName = 'w'
calc.AddVectorVariable = ['Vorticity', 'Vorticity', '0', '1', '2']
calc.Function = '(Vorticity).(kHat)'
calc.UpdatePipeline() # w is now element 16

This gave the vorticity in the khat direction.  That should get you started.

Good Luck,
Peter.


On Tue, Dec 2, 2008 at 2:45 PM, Pierre-Olivier Dallaire
<pierre-olivier.dallaire at videotron.ca> wrote:
> Good afternoon,
>
> I'm looking for an example on how to use the calculator filter in a python
> script.
> With the calculator, I want to :
>
> 1) Extract each component of a vector array (x, y, z);
> 2) Apply a scalar factor on each array (for unit conversion).
>
> Best regards,
>
> PO
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
>


More information about the ParaView mailing list