[Paraview] Problem with Calculator filter in servermanager module

Adriano Gagliardi agagliardi at ara.co.uk
Mon Jul 13 04:29:15 EDT 2009


Andi,

You have to specify which scalars you want to use ni the calculator before
updating the pipeline using ScalarVariable or VectorVariable:
 
# Calculate von Mises Caucy stress and save in in celldata 'vMises_stress'
calc_vM = servermanager.filters.Calculator(
		Input=ptc, 
		AttributeMode=2,
		ResultArrayName='vMises',
	
Function='0.70711*sqrt((eigenval1-eigenval2)^2+(eigenval2-eigenval3)^2+(eige
nval3-eigenval1)^2)',
		ScalarVariable =
['eigenval1','eigenval1','0','eigenval2','eigenval2','0','eigenval3','eigenv
al3','0']) #<<===HERE
calc_vM.UpdatePipeline()


For a vector, the syntax would be: VectorVariable =
['Velocity','Velocity','0','1','2']. The first string is the stored varname,
the second string is what you would like to call it in your function, and
the proceeding numbers are there location in the array (scalar's always at
0). Might not be the best explanation, but it works!

===================================

Adriano Gagliardi MEng PhD
Project Scientist
Computational Aerodynamics
Aircraft Research Association Ltd.
Manton Lane
Bedford

Tel: 01234 32 4644
E-mail: agagliardi at ara.co.uk
Url: www.ara.co.uk 
-----Original Message-----
From: paraview-bounces at paraview.org [mailto:paraview-bounces at paraview.org]
On Behalf Of Andreas Maier
Sent: 13 July 2009 08:48
To: paraview at paraview.org
Subject: [Paraview] Problem with Calculator filter in servermanager module

Hi,

I have a problem with the Calculator filter using pvpython and the
servermanager module.

My script works fine upto that point:


> from paraview import servermanager
> ...
> ...
># Point to Cell Data
> ptc=servermanager.filters.PointDataToCellData(Input=clip2)
> ptc.UpdatePipeline()
>
># Calculate von Mises Caucy stress and save in in celldata 'vMises_stress'
> calc_vM=servermanager.filters.Calculator(Input=ptc, AttributeMode=2,
ResultArrayName='vMises',
Function='0.70711*sqrt((eigenval1-eigenval2)^2+(eigenval2-eigenval3)^2+(eige
nval3-eigenval1)^2)')
> calc_vM.UpdatePipeline()


and then I get the following error:

>ERROR: 
In /home/berk/Work/ReleaseBuilds/ParaView3/VTK/Common/vtkFunctionParser.cxx,

line 1473
>vtkFunctionParser (0xa105428): Syntax error: expecting a variable name; see

position 0

>ERROR: 
In /home/berk/Work/ReleaseBuilds/ParaView3/VTK/Common/vtkFunctionParser.cxx,

line 1473
>vtkFunctionParser (0xa105428): Syntax error: expecting a variable name; see

position 0

It must be something with the names of my cell 
arrays 'eigenval1',..,'eigenval3' because I do not get that error when using

just scalars in Function (IE: Function='10000').

That same formula works fine when I use it in the paraview Calculator.

I hope that anybody can help me with that problem. Thanks in advance.


Best wishes,

Andi
_______________________________________________
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


---------------------------
This email contains information that is private and confidential and is intended only for the addressee.  If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender.
Note: All email sent to or from this address may be accessed by someone other than the recipient, for system management and security reasons.
Aircraft Research Association Ltd.  Registered in England, Registration No 503668 Registered Office: Manton Lane, Bedford MK41 7PF England VAT No GB 196351245




More information about the ParaView mailing list