<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Courier;
        panose-1:2 7 4 9 2 2 5 2 4 4;}
@font-face
        {font-family:Courier;
        panose-1:2 7 4 9 2 2 5 2 4 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.m4058480906308904695kwd
        {mso-style-name:m_4058480906308904695kwd;}
span.m4058480906308904695pln
        {mso-style-name:m_4058480906308904695pln;}
span.m4058480906308904695pun
        {mso-style-name:m_4058480906308904695pun;}
span.m4058480906308904695apple-converted-space
        {mso-style-name:m_4058480906308904695apple-converted-space;}
span.EmailStyle24
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Now it works,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Maybe was a problem about the treatment of the vectors or the numpy library.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks for the support,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Andrea<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Andy Bauer [mailto:andy.bauer@kitware.com]
<br>
<b>Sent:</b> Thursday, April 19, 2018 15:23<br>
<b>To:</b> Caffagni, Andrea<br>
<b>Cc:</b> Oscar Wilsby; Cory Quammen; paraview@public.kitware.com<br>
<b>Subject:</b> Re: [Paraview] Problem with numpy array<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">The Gradient of Unstructured Dataset does increase the tensor dimension. So a scalar, or 1 component array in VTK/PV, becomes a vector, or a 3 components array. Similarly, a vector becomes a 2nd order tensor,
 or 9 component array.<o:p></o:p></p>
</div>
<p class="MsoNormal">Andrea: could you try upgrading to ParaView 5.5 (available at
<a href="http://paraview.org/download">paraview.org/download</a>) ? Some of the numpy support has been improved since 5.3. I tried your original Programmable Filter script and I got an eigenvectors and eigenvalues array:<o:p></o:p></p>
<p class="MsoNormal" style="margin-top:9.0pt;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">import</span></b><span style="font-size:10.0pt;font-family:"Courier New"">
<b><span style="color:blue">numpy</span></b> <b><span style="color:green">as</span></b>
<b><span style="color:blue">np</span></b></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">from</span></b><span style="font-size:10.0pt;font-family:"Courier New"">
<b><span style="color:blue">numpy</span></b> <b><span style="color:green">import</span></b> linalg
<b><span style="color:green">as</span></b> LA</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">from</span></b><span style="font-size:10.0pt;font-family:"Courier New"">
<b><span style="color:blue">paraview</span></b> <b><span style="color:green">import</span></b> numpy_support</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New";color:green">input</span><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#666666">=</span> inputs[<span style="color:#666666">0</span>]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New"">numPoints
<span style="color:#666666">=</span> <span style="color:green">input</span><span style="color:#666666">.</span>GetNumberOfPoints()</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">print</span></b><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#BA2121">"number of points"</span>,numPoints</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New"">tensors
<span style="color:#666666">=</span> <span style="color:green">input</span><span style="color:#666666">.</span>PointData[<span style="color:#BA2121">'Gradients'</span>]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">print</span></b><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#BA2121">"tensors[0:3]"</span>,tensors[<span style="color:#666666">0</span>:<span style="color:#666666">3</span>]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New"">eigenvalues,eigenvectors
<span style="color:#666666">=</span> LA<span style="color:#666666">.</span>eig(tensors)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">print</span></b><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#BA2121">'eigenvalues'</span>, eigenvalues[<span style="color:#666666">0</span>]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">print</span></b><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#BA2121">'eigenvectors'</span>,eigenvectors[<span style="color:#666666">0</span>]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New"">output<span style="color:#666666">.</span>PointData<span style="color:#666666">.</span>append(eigenvalues,<span style="color:#BA2121">'eigenvalues'</span>)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">output<span style="color:#666666">.</span>PointData<span style="color:#666666">.</span>append(eigenvectors,<span style="color:#BA2121">'eigenvectors'</span>)<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Once you get PV 5.5, you can try loading the attached eigen.pvsm state file which worked for me if you want to test it out. Note that since I used the Gradient of Unstructured Dataset filter twice to go from
 a scalar array to a second order tensor before doing the programmable filter, I used Gradients2 for the output array name for the second order tensor.<o:p></o:p></p>
</div>
<p class="MsoNormal">Best,<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Andy<o:p></o:p></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Thu, Apr 19, 2018 at 1:03 AM, Caffagni, Andrea <<a href="mailto:Andrea.Caffagni@ferrari.com" target="_blank">Andrea.Caffagni@ferrari.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">If I add simply the code suggested from you Oscar, my filters becomes:</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-top:9.0pt;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">import</span></b><span style="font-size:10.0pt;font-family:"Courier New"">
<b><span style="color:blue">numpy</span></b> <b><span style="color:green">as</span></b>
<b><span style="color:blue">np</span></b></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">from</span></b><span style="font-size:10.0pt;font-family:"Courier New"">
<b><span style="color:blue">numpy</span></b> <b><span style="color:green">import</span></b> linalg
<b><span style="color:green">as</span></b> LA</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">from</span></b><span style="font-size:10.0pt;font-family:"Courier New"">
<b><span style="color:blue">paraview</span></b> <b><span style="color:green">import</span></b> numpy_support</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">from</span></b><span style="font-size:10.0pt;font-family:"Courier New"">
<b><span style="color:blue">vtk.util</span></b> <b><span style="color:green">import</span></b> numpy_support</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New";color:green">input</span><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#666666">=</span> inputs[<span style="color:#666666">0</span>]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New"">numPoints
<span style="color:#666666">=</span> <span style="color:green">input</span><span style="color:#666666">.</span>GetNumberOfPoints()</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">print</span></b><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#BA2121">"number of points"</span>,numPoints</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><i><span style="font-size:10.0pt;font-family:"Courier New";color:#408080">#print "keys",input.GetPointData().keys()</span></i><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New"">tensorsVTK
<span style="color:#666666">=</span> <span style="color:green">input</span><span style="color:#666666">.</span>PointData[<span style="color:#BA2121">'Gradients'</span>]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New"">tensorsNP<span style="color:#666666">=</span>numpy_support<span style="color:#666666">.</span>vtk_to_numpy(tensorsVTK)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><i><span style="font-size:10.0pt;font-family:"Courier New";color:#408080">#tensors[0,:,:]=np.diag((1,2,3))</span></i><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><i><span style="font-size:10.0pt;font-family:"Courier New";color:#408080">#tensors[0,:,:]=[[1,-1,2],[2,-1,3],[0,0,1]]</span></i><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">print</span></b><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#BA2121">"tensors[0:3]"</span>,tensors[<span style="color:#666666">0</span>:<span style="color:#666666">3</span>]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New"">eigenvalues,eigenvectors
<span style="color:#666666">=</span> LA<span style="color:#666666">.</span>eig(tensorsNP)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">print</span></b><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#BA2121">'eigenvalues'</span>, eigenvalues[<span style="color:#666666">0</span>]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">print</span></b><span style="font-size:10.0pt;font-family:"Courier New"">
<span style="color:#BA2121">'eigenvectors'</span>,eigenvectors[<span style="color:#666666">0</span>]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New"">output<span style="color:#666666">.</span>PointData<span style="color:#666666">.</span>append(eigenvalues,<span style="color:#BA2121">'eigenvalues'</span>)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">output<span style="color:#666666">.</span>PointData<span style="color:#666666">.</span>append(eigenvectors,<span style="color:#BA2121">'eigenvectors'</span>)<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I obtain the following Output:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:Courier;color:maroon">Traceback (most recent call last):</span><o:p></o:p></p>
<p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:Courier;color:maroon">File "<string>", line 22, in <module></span><o:p></o:p></p>
<p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:Courier;color:maroon">File "<string>", line 8, in RequestData</span><o:p></o:p></p>
<p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:Courier;color:maroon">UnboundLocalError: local variable 'NumPy_data' referenced before assignment</span><o:p></o:p></p>
<p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:Courier;color:maroon">Traceback (most recent call last):</span><o:p></o:p></p>
<p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:Courier;color:maroon">File "<string>", line 22, in <module></span><o:p></o:p></p>
<p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:Courier;color:maroon">File "<string>", line 12, in RequestData</span><o:p></o:p></p>
<p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:Courier;color:maroon">File "C:\Program Files\ParaView 5.3.0-Qt5-OpenGL2-Windows-64bit\bin\lib\site-packages\vtk\util\numpy_support.py", line 213, in vtk_to_numpy</span><o:p></o:p></p>
<p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:Courier;color:maroon">typ = vtk_array.GetDataType()</span><o:p></o:p></p>
<p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:Courier;color:maroon">AttributeError: 'VTKCompositeDataArray' object has no attribute 'GetDataType'</span><o:p></o:p></p>
<p style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:8.5pt;font-family:Courier;color:green">number of points 1</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I need to reshape the vector or define the type?</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Best Regards,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Andrea</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Oscar Wilsby [mailto:<a href="mailto:ow222@cam.ac.uk" target="_blank">ow222@cam.ac.uk</a>]
<br>
<b>Sent:</b> Wednesday, April 18, 2018 21:14<br>
<b>To:</b> Cory Quammen<br>
<b>Cc:</b> Caffagni, Andrea; Andy Bauer; <a href="mailto:paraview@public.kitware.com" target="_blank">
paraview@public.kitware.com</a></span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
<b>Subject:</b> Re: [Paraview] Problem with numpy array<o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi Andy,<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I haven’t verified, but at a glance it looks like what you are passing to the the LA.eig function is not a 2D numpy array. Can you try doing np.asarray(tensors) or <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<pre style="background:#EFF0F1;vertical-align:baseline;line-height:inherit;box-sizing:inherit;max-height:600px;word-wrap:normal;overflow:auto"><span class="m4058480906308904695kwd"><span style="font-family:"Times New Roman","serif";color:#101094;border:none windowtext 1.0pt;padding:0cm">from</span></span><span class="m4058480906308904695pln"><span style="font-family:"Times New Roman","serif";color:#303336;border:none windowtext 1.0pt;padding:0cm"> vtk</span></span><span class="m4058480906308904695pun"><span style="font-family:"Times New Roman","serif";color:#303336;border:none windowtext 1.0pt;padding:0cm">.</span></span><span class="m4058480906308904695pln"><span style="font-family:"Times New Roman","serif";color:#303336;border:none windowtext 1.0pt;padding:0cm">util</span></span><span class="m4058480906308904695pun"><span style="font-family:"Times New Roman","serif";color:#303336;border:none windowtext 1.0pt;padding:0cm">.</span></span><span class="m4058480906308904695pln"><span style="font-family:"Times New Roman","serif";color:#303336;border:none windowtext 1.0pt;padding:0cm">numpy_support </span></span><span class="m4058480906308904695kwd"><span style="font-family:"Times New Roman","serif";color:#101094;border:none windowtext 1.0pt;padding:0cm">import</span></span><span class="m4058480906308904695pln"><span style="font-family:"Times New Roman","serif";color:#303336;border:none windowtext 1.0pt;padding:0cm"> vtk_to_numpy</span></span><o:p></o:p></pre>
<pre style="background:#EFF0F1;vertical-align:baseline;line-height:inherit;box-sizing:inherit;max-height:600px;word-wrap:normal;overflow:auto"><span style="font-family:Consolas;color:#303336">tensors = vtk_to_numpy(tensors)</span><o:p></o:p></pre>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">and then pass that to LA.eig?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Kind regards,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Oscar<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On 18 Apr 2018, at 16:33, Cory Quammen <<a href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">Hey Andy,<br>
<br>
Does the GradientOfUnstructuredDataSet filter produce a tensor from an input vector field? My testing in ParaView indicates it doesn't , but I'm not super familiar with it.</span><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">Thanks,</span><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">Cory</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""> </span><o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">On Wed, Apr 18, 2018 at 11:14 AM, Caffagni, Andrea<span class="m4058480906308904695apple-converted-space"> </span><<a href="mailto:Andrea.Caffagni@ferrari.com" target="_blank">Andrea.Caffagni@ferrari.com</a>><span class="m4058480906308904695apple-converted-space"> </span>wrote:</span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Dear Cory,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">This is the complete message that I have obtained like output:</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">Traceback (most recent call last):</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">File "<string>", line 22, in <module></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">File "<string>", line 14, in RequestData</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">File "C:\Program Files\ParaView 5.3.0-Qt5-OpenGL2-Windows-64bit\bin\lib\site-packages\numpy\linalg\linalg.py", line
 1095, in eig</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">_assertRankAtLeast2(a)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">File "C:\Program Files\ParaView 5.3.0-Qt5-OpenGL2-Windows-64bit\bin\lib\site-packages\numpy\linalg\linalg.py", line
 202, in _assertRankAtLeast2</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">'at least two-dimensional' % len(a.shape))</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">numpy.linalg.linalg.LinAlgError: 0-dimensional array given. Array must be at least two-dimensional</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:green">number of points 1</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:green">tensors[0:3] [VTKArray([[[ 8.34616375, -23.89611435, 2.00894117],</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:green">[ 0.67995167, -23.11237526, 289.07113647],</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:green">[ 27.26550674, -231.06710815, 16.90883636]]], dtype=float32)]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:green"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:green"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:green">From this, I have thought about the vtk array.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:green"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:green">Best regards,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:green">Andrea</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> </span></span><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Cory
 Quammen [mailto:<a href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>]<span class="m4058480906308904695apple-converted-space"> </span><br>
<b>Sent:</b><span class="m4058480906308904695apple-converted-space"> </span>Wednesday, April 18, 2018 15:11<br>
<b>To:</b><span class="m4058480906308904695apple-converted-space"> </span>Caffagni, Andrea<br>
<b>Cc:</b><span class="m4058480906308904695apple-converted-space"> </span><a href="mailto:paraview@public.kitware.com" target="_blank">paraview@public.kitware.com</a><br>
<b>Subject:</b><span class="m4058480906308904695apple-converted-space"> </span>Re: [Paraview] Problem with numpy array</span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi Andrea,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Besides the error message, what does your script print?<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Thanks,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Cory<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Wed, Apr 18, 2018 at 2:14 AM, Caffagni, Andrea <<a href="mailto:Andrea.Caffagni@ferrari.com" target="_blank">Andrea.Caffagni@ferrari.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Dear Users,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I need to solve an eigenproblem in a point of a CFD field.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Using the GradientOfUnstructuredDataSet I calculate the velocity gradient of my velocity field, than I isolate may point of interest and I have written the following ProgrammableFilter:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="margin-top:9.0pt;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">import</span></b><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Courier New""> </span></span><b><span style="font-size:10.0pt;font-family:"Courier New";color:blue">numpy</span></b><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Courier New""> </span></span><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">as</span></b><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Courier New""> </span></span><b><span style="font-size:10.0pt;font-family:"Courier New";color:blue">np</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">from</span></b><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Courier New""> </span></span><b><span style="font-size:10.0pt;font-family:"Courier New";color:blue">numpy</span></b><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Courier New""> </span></span><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">import</span></b><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Courier New""> </span></span><span style="font-size:10.0pt;font-family:"Courier New"">linalg<span class="m4058480906308904695apple-converted-space"> </span><b><span style="color:green">as</span></b><span class="m4058480906308904695apple-converted-space"> </span>LA</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">from</span></b><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Courier New""> </span></span><b><span style="font-size:10.0pt;font-family:"Courier New";color:blue">paraview</span></b><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Courier New""> </span></span><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">import</span></b><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Courier New""> </span></span><span style="font-size:10.0pt;font-family:"Courier New"">numpy_support</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New";color:green">input</span><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Courier New""> </span></span><span style="font-size:10.0pt;font-family:"Courier New";color:#666666">=</span><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Courier New""> </span></span><span style="font-size:10.0pt;font-family:"Courier New"">inputs[<span style="color:#666666">0</span>]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New"">numPoints<span class="m4058480906308904695apple-converted-space"> </span><span style="color:#666666">=</span><span class="m4058480906308904695apple-converted-space"> </span><span style="color:green">input</span><span style="color:#666666">.</span>GetNumberOfPoints()</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">print</span></b><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Courier New""> </span></span><span style="font-size:10.0pt;font-family:"Courier New";color:#BA2121">"number
 of points"</span><span style="font-size:10.0pt;font-family:"Courier New"">,numPoints</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New"">tensors<span class="m4058480906308904695apple-converted-space"> </span><span style="color:#666666">=</span><span class="m4058480906308904695apple-converted-space"> </span><span style="color:green">input</span><span style="color:#666666">.</span>PointData[<span style="color:#BA2121">'Gradients'</span>]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">print</span></b><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Courier New""> </span></span><span style="font-size:10.0pt;font-family:"Courier New";color:#BA2121">"tensors[0:3]"</span><span style="font-size:10.0pt;font-family:"Courier New"">,tensors[<span style="color:#666666">0</span>:<span style="color:#666666">3</span>]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New"">eigenvalues,eigenvectors<span class="m4058480906308904695apple-converted-space"> </span><span style="color:#666666">=</span><span class="m4058480906308904695apple-converted-space"> </span>LA<span style="color:#666666">.</span>eig(tensors)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">print</span></b><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Courier New""> </span></span><span style="font-size:10.0pt;font-family:"Courier New";color:#BA2121">'eigenvalues'</span><span style="font-size:10.0pt;font-family:"Courier New"">,
 eigenvalues[<span style="color:#666666">0</span>]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;font-family:"Courier New";color:green">print</span></b><span class="m4058480906308904695apple-converted-space"><span style="font-size:10.0pt;font-family:"Courier New""> </span></span><span style="font-size:10.0pt;font-family:"Courier New";color:#BA2121">'eigenvectors'</span><span style="font-size:10.0pt;font-family:"Courier New"">,eigenvectors[<span style="color:#666666">0</span>]</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Courier New"">output<span style="color:#666666">.</span>PointData<span style="color:#666666">.</span>append(eigenvalues,<span style="color:#BA2121">'eigenvalues'</span>)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">output<span style="color:#666666">.</span>PointData<span style="color:#666666">.</span>append(eigenvectors,<span style="color:#BA2121">'eigenvectors'</span>)<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I have obtained the following error message:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">Traceback (most recent call last):</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">File "<string>", line 22, in <module></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">File "<string>", line 14, in RequestData</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">File "C:\Program Files\ParaView 5.3.0-Qt5-OpenGL2-Windows-64bit\bin\lib\site-packages\numpy\linalg\linalg.py", line
 1095, in eig</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">_assertRankAtLeast2(a)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">File "C:\Program Files\ParaView 5.3.0-Qt5-OpenGL2-Windows-64bit\bin\lib\site-packages\numpy\linalg\linalg.py", line
 202, in _assertRankAtLeast2</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">'at least two-dimensional' % len(a.shape))</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon">numpy.linalg.linalg.LinAlgError: 0-dimensional array given. Array must be at least two-dimensional</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier;color:maroon"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier">I imagine that the problem is linked to the vtk array, I need to convert my ‘Gradients’ matrix in a nparray?</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier">Someone have the same problem?</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier">Best Regards,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.5pt;font-family:Courier">Andrea</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">_________________________________________________________________________________________________________________</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">Questo messaggio è da intendersi esclusivamente ad uso del destinatario e può contenere informazioni che sono
 di natura privilegiata, confidenziale o non divulgabile secondo le leggi vigenti. Se il lettore del presente messaggio non è il destinatario designato, o il dipendente/agente responsabile per la consegna del messaggio al destinatario designato, si informa
 che ogni disseminazione, distribuzione o copiatura di questa comunicazione è vietata anche ai sensi della normativa vigente in materia di protezione dei dati personali. Se avete ricevuto questo messaggio per errore, vi preghiamo di notificarcelo immediatamente
 a mezzo e-mail di risposta e successivamente di procedere alla cancellazione di questa e-mail e relativi allegati dal vostro sistema.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">_________________________________________________________________________________________________________________</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">This message is intended only for the use of the addressee and may contain information that is privileged, confidential
 and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution
 or copying of this communication is prohibited under the applicable data protection law. If you have received this e-mail by mistake, please notify us immediately by return e-mail and delete this e-mail and all attachments from your system.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">_________________________________________________________________________________________________________________ </span><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><br>
_______________________________________________<br>
Powered by<span class="m4058480906308904695apple-converted-space"> </span><a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<span class="m4058480906308904695apple-converted-space"> </span><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:<span class="m4058480906308904695apple-converted-space"> </span><a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at:<span class="m4058480906308904695apple-converted-space"> </span><a href="http://markmail.org/search/?q=ParaView" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/paraview" target="_blank">https://public.kitware.com/mailman/listinfo/paraview</a><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">--<span class="m4058480906308904695apple-converted-space"> </span><o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Cory Quammen<br>
Staff R&D Engineer<br>
Kitware, Inc.<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">_________________________________________________________________________________________________________________</span><o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""> </span><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">Questo messaggio è da intendersi esclusivamente ad uso del destinatario e può contenere informazioni che sono
 di natura privilegiata, confidenziale o non divulgabile secondo le leggi vigenti. Se il lettore del presente messaggio non è il destinatario designato, o il dipendente/agente responsabile per la consegna del messaggio al destinatario designato, si informa
 che ogni disseminazione, distribuzione o copiatura di questa comunicazione è vietata anche ai sensi della normativa vigente in materia di protezione dei dati personali. Se avete ricevuto questo messaggio per errore, vi preghiamo di notificarcelo immediatamente
 a mezzo e-mail di risposta e successivamente di procedere alla cancellazione di questa e-mail e relativi allegati dal vostro sistema.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">_________________________________________________________________________________________________________________</span><o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""> </span><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">This message is intended only for the use of the addressee and may contain information that is privileged, confidential
 and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution
 or copying of this communication is prohibited under the applicable data protection law. If you have received this e-mail by mistake, please notify us immediately by return e-mail and delete this e-mail and all attachments from your system.</span><o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""> </span><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">_________________________________________________________________________________________________________________ </span><o:p></o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""><br>
<br clear="all">
<br>
--<span class="m4058480906308904695apple-converted-space"> </span></span><o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">Cory Quammen<br>
Staff R&D Engineer<br>
Kitware, Inc.</span><o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">_______________________________________________<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>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" target="_blank">
http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/paraview" target="_blank">https://public.kitware.com/mailman/listinfo/paraview</a></span><o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
<div>
<div>
<p>_________________________________________________________________________________________________________________<o:p></o:p></p>
<p> <o:p></o:p></p>
<p>Questo messaggio è da intendersi esclusivamente ad uso del destinatario e può contenere informazioni che sono di natura privilegiata, confidenziale o non divulgabile secondo le leggi vigenti. Se il lettore del presente messaggio non è il destinatario designato,
 o il dipendente/agente responsabile per la consegna del messaggio al destinatario designato, si informa che ogni disseminazione, distribuzione o copiatura di questa comunicazione è vietata anche ai sensi della normativa vigente in materia di protezione dei
 dati personali. Se avete ricevuto questo messaggio per errore, vi preghiamo di notificarcelo immediatamente a mezzo e-mail di risposta e successivamente di procedere alla cancellazione di questa e-mail e relativi allegati dal vostro sistema.<o:p></o:p></p>
<p>_________________________________________________________________________________________________________________<o:p></o:p></p>
<p> <o:p></o:p></p>
<p>This message is intended only for the use of the addressee and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent
 responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is prohibited under the applicable data protection law. If you have received this e-mail by mistake,
 please notify us immediately by return e-mail and delete this e-mail and all attachments from your system.<o:p></o:p></p>
<p> <o:p></o:p></p>
<p>_________________________________________________________________________________________________________________ <o:p></o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p>_________________________________________________________________________________________________________________</p>
<p> </p>
<p>Questo messaggio è da intendersi esclusivamente ad uso del destinatario e può contenere informazioni che sono di natura privilegiata, confidenziale o non divulgabile secondo le leggi vigenti. Se il lettore del presente messaggio non è il destinatario designato,
 o il dipendente/agente responsabile per la consegna del messaggio al destinatario designato, si informa che ogni disseminazione, distribuzione o copiatura di questa comunicazione è vietata anche ai sensi della normativa vigente in materia di protezione dei
 dati personali. Se avete ricevuto questo messaggio per errore, vi preghiamo di notificarcelo immediatamente a mezzo e-mail di risposta e successivamente di procedere alla cancellazione di questa e-mail e relativi allegati dal vostro sistema.</p>
<p>_________________________________________________________________________________________________________________</p>
<p> </p>
<p>This message is intended only for the use of the addressee and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent
 responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is prohibited under the applicable data protection law. If you have received this e-mail by mistake,
 please notify us immediately by return e-mail and delete this e-mail and all attachments from your system.</p>
<p> </p>
<p>_________________________________________________________________________________________________________________ </p>
</body>
</html>