<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16981" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=052154409-02072010><FONT face=Arial color=#0000ff 
size=2>Thanks! My mistake was in&nbsp;this line:</FONT></SPAN></DIV>
<DIV><SPAN class=052154409-02072010><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=052154409-02072010>g.SetInputScalars(0, var)</SPAN></DIV>
<DIV><SPAN class=052154409-02072010></SPAN>&nbsp;</DIV>
<DIV><SPAN class=052154409-02072010><FONT face=Arial color=#0000ff size=2>I was 
using 1 instead of 0 as I was getting&nbsp;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.</FONT></SPAN></DIV>
<DIV><SPAN class=052154409-02072010><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=052154409-02072010><FONT face=Arial color=#0000ff 
size=2>Regards,</FONT></SPAN></DIV>
<DIV><SPAN class=052154409-02072010><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=052154409-02072010><FONT face=Arial color=#0000ff 
size=2>Adriano</FONT></SPAN></DIV>
<DIV><SPAN class=052154409-02072010><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><FONT size=2>===================================<BR><BR>Adriano Gagliardi 
MEng PhD<BR>Business Sector Leader<BR>Computational Aerodynamics<BR>Aircraft 
Research Association Ltd.<BR>Manton Lane<BR>Bedford<BR><BR>Tel: 01234 32 
4644<BR>E-mail: agagliardi@ara.co.uk<BR>Url: www.ara.co.uk </FONT></DIV>
<DIV>&nbsp;</DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> aur.marsan@gmail.com 
[mailto:aur.marsan@gmail.com] <B>On Behalf Of </B>Aurélien 
Marsan<BR><B>Sent:</B> 02 July 2010 10:28<BR><B>To:</B> 
agagliardi@ara.co.uk<BR><B>Cc:</B> paraview@paraview.org<BR><B>Subject:</B> Re: 
[Paraview] Compute gradients<BR></FONT><BR></DIV>
<DIV></DIV>Here an example to compute the gradient of var, and store the result 
as new_var. <BR><BR>
<BLOCKQUOTE class=gmail_quote 
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">g 
  = vtk.vtkGradientFilter()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  g.SetInput(Bloc)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  g.SetInputScalars(0, var)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  g.SetResultArrayName(new_var)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  g.Update()<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  Bloc.GetPointData().AddArray(g.GetOutput().GetPointData().GetArray(new_var))<BR></BLOCKQUOTE><BR>Maybe 
you forgot the "Update" ? <BR><BR>
<DIV class=gmail_quote>2010/7/2 Adriano Gagliardi <SPAN dir=ltr>&lt;<A 
href="mailto:agagliardi@ara.co.uk">agagliardi@ara.co.uk</A>&gt;</SPAN><BR>
<BLOCKQUOTE class=gmail_quote 
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid"><BR>Does 
  anyone have an example of using vtkGradientFilter to compute the<BR>gradients 
  of a single vector in your data-set? I've tried using<BR>SetInputScalars, but 
  it tells me that there is no input array,. although the<BR>array I pass it 
  does exist.<BR><BR>===================================<BR><BR>Adriano 
  Gagliardi MEng PhD<BR>Business Sector Leader<BR>Computational 
  Aerodynamics<BR>Aircraft Research Association Ltd.<BR>Manton 
  Lane<BR>Bedford<BR><BR>Tel: 01234 32 4644<BR>E-mail: <A 
  href="mailto:agagliardi@ara.co.uk">agagliardi@ara.co.uk</A><BR>Url: <A 
  href="http://www.ara.co.uk" 
  target=_blank>www.ara.co.uk</A><BR><BR><BR>**********************************************************************<BR>This 
  email contains information that is private and confidential and is intended 
  only for the addressee.<BR>If you are not the intended recipient please delete 
  it and notify us immediately by e-mailing the sender.<BR>Note: All email sent 
  to or from this address may be accessed by someone other than the recipient, 
  for<BR>system management and security reasons.<BR>Aircraft Research 
  Association Ltd. &nbsp;Registered in England, Registration No 503668 
  Registered Office:<BR>Manton Lane, Bedford MK41 7PF England VAT No GB 
  196351245<BR><BR>**********************************************************************<BR>_______________________________________________<BR>Powered 
  by <A href="http://www.kitware.com" 
  target=_blank>www.kitware.com</A><BR><BR>Visit other Kitware open-source 
  projects at <A href="http://www.kitware.com/opensource/opensource.html" 
  target=_blank>http://www.kitware.com/opensource/opensource.html</A><BR><BR>Please 
  keep messages on-topic and check the ParaView Wiki at: <A 
  href="http://paraview.org/Wiki/ParaView" 
  target=_blank>http://paraview.org/Wiki/ParaView</A><BR><BR>Follow this link to 
  subscribe/unsubscribe:<BR><A 
  href="http://www.paraview.org/mailman/listinfo/paraview" 
  target=_blank>http://www.paraview.org/mailman/listinfo/paraview</A><BR></BLOCKQUOTE></DIV><BR><BR 
clear=all><BR>-- <BR>Aurélien MARSAN<BR>Doctorant Cifre Turbomeca/LMFA<BR><A 
href="mailto:aurelien.marsan@ecl2009.ec-lyon.fr">aurelien.marsan@ecl2009.ec-lyon.fr</A><BR>06.31.98.26.73<BR><p>**********************************************************************<br />This email contains information that is private and confidential and is intended only for the addressee.<br />If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender.<br />Note: All email sent to or from this address may be accessed by someone other than the recipient, for<br />system management and security reasons.<br />Aircraft Research Association Ltd.  Registered in England, Registration No 503668 Registered Office:<br />Manton Lane, Bedford MK41 7PF England VAT No GB 196351245</p><p>**********************************************************************</p>
</BODY></HTML>