<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: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;}
/* 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";}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.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">Dear Cory,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">This is the complete message that I have obtained like output:<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:8.5pt;font-family:Courier;color:maroon">Traceback (most recent call last):</span><o:p></o:p></p>
<p class="MsoNormal"><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"><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"><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"><span style="font-size:8.5pt;font-family:Courier;color:maroon">_assertRankAtLeast2(a)</span><o:p></o:p></p>
<p class="MsoNormal"><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"><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"><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"><span style="font-size:8.5pt;font-family:Courier;color:green">number of points 1</span><o:p></o:p></p>
<p class="MsoNormal"><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"><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"><span style="font-size:8.5pt;font-family:Courier;color:green">[ 27.26550674, -231.06710815, 16.90883636]]], dtype=float32)]<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:Courier;color:green"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:Courier;color:green"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:Courier;color:green">From this, I have thought about the vtk array.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:Courier;color:green"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:Courier;color:green">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.5pt;font-family:Courier;color:green">Andrea</span><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"><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""> Cory Quammen [mailto:cory.quammen@kitware.com]
<br>
<b>Sent:</b> Wednesday, April 18, 2018 15:11<br>
<b>To:</b> Caffagni, Andrea<br>
<b>Cc:</b> 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>
<p class="MsoNormal">Hi Andrea,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">Besides the error message, what does your script print?<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Cory<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">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 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="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>_________________________________________________________________________________________________________________<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>
<p class="MsoNormal" style="margin-bottom:12.0pt"><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>
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><o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<p class="MsoNormal">Cory Quammen<br>
Staff R&D Engineer<br>
Kitware, Inc.<o:p></o:p></p>
</div>
</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>