Thanks! My mistake was in this line:
 
g.SetInputScalars(0, var)
 
I was using 1 instead of 0 as I was getting the enum from vtkDataSet rather
than vtkDataObject, which is why it couldn't find my variable (it was
looking for cell data rather than point data). Confusion on my part (partly
due to lack of coffee), but thank you for providing the example.
 
Regards,
 
Adriano
 
===================================

Adriano Gagliardi MEng PhD
Business Sector Leader
Computational Aerodynamics
Aircraft Research Association Ltd.
Manton Lane
Bedford

Tel: 01234 32 4644
E-mail: agaglia...@ara.co.uk
Url: www.ara.co.uk 
 

  _____  

From: aur.mar...@gmail.com [mailto:aur.mar...@gmail.com] On Behalf Of
Aurélien Marsan
Sent: 02 July 2010 10:28
To: agaglia...@ara.co.uk
Cc: paraview@paraview.org
Subject: Re: [Paraview] Compute gradients


Here an example to compute the gradient of var, and store the result as
new_var. 



g = vtk.vtkGradientFilter()
        g.SetInput(Bloc)
        g.SetInputScalars(0, var)
        g.SetResultArrayName(new_var)
        g.Update()
 
Bloc.GetPointData().AddArray(g.GetOutput().GetPointData().GetArray(new_var))



Maybe you forgot the "Update" ? 


2010/7/2 Adriano Gagliardi <agaglia...@ara.co.uk>



Does anyone have an example of using vtkGradientFilter to compute the
gradients of a single vector in your data-set? I've tried using
SetInputScalars, but it tells me that there is no input array,. although the
array I pass it does exist.

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

Adriano Gagliardi MEng PhD
Business Sector Leader
Computational Aerodynamics
Aircraft Research Association Ltd.
Manton Lane
Bedford

Tel: 01234 32 4644
E-mail: agaglia...@ara.co.uk
Url: www.ara.co.uk


**********************************************************************
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

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





-- 
Aurélien MARSAN
Doctorant Cifre Turbomeca/LMFA
aurelien.mar...@ecl2009.ec-lyon.fr
06.31.98.26.73


**********************************************************************
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

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

Reply via email to