<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi Andy,<br>
      <br>
      ok - try to do the job with a programmable filter:<br>
      <br>
      <br>
      <style type="text/css">
p, li { white-space: pre-wrap; }
</style>
      <pre style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack'; font-weight:600; color:#008000;">import</span><span style=" font-family:'Hack';"> </span><span style=" font-family:'Hack'; font-weight:600; color:#0000ff;">numpy</span><span style=" font-family:'Hack';"> </span><span style=" font-family:'Hack'; font-weight:600; color:#008000;">as</span><span style=" font-family:'Hack';"> </span><span style=" font-family:'Hack'; font-weight:600; color:#0000ff;">np</span></pre>
      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack'; font-weight:600; color:#008000;">from</span><span style=" font-family:'Hack';"> </span><span style=" font-family:'Hack'; font-weight:600; color:#0000ff;">numpy</span><span style=" font-family:'Hack';"> </span><span style=" font-family:'Hack'; font-weight:600; color:#008000;">import</span><span style=" font-family:'Hack';"> linalg </span><span style=" font-family:'Hack'; font-weight:600; color:#008000;">as</span><span style=" font-family:'Hack';"> LA</span></pre>
      <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Hack';">
</pre>
      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack'; font-weight:600; color:#008000;">from</span><span style=" font-family:'Hack';"> </span><span style=" font-family:'Hack'; font-weight:600; color:#0000ff;">paraview.numpy_support</span><span style=" font-family:'Hack';"> </span><span style=" font-family:'Hack'; font-weight:600; color:#008000;">import</span><span style=" font-family:'Hack';"> vtk_to_numpy</span></pre>
      <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Hack';">
</pre>
      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack';">input0 </span><span style=" font-family:'Hack'; color:#666666;">=</span><span style=" font-family:'Hack';"> inputs[</span><span style=" font-family:'Hack'; color:#666666;">0</span><span style=" font-family:'Hack';">]</span></pre>
      <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Hack';">
</pre>
      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack'; font-style:italic; color:#408080;"># Test NumPy</span></pre>
      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack';">w, v </span><span style=" font-family:'Hack'; color:#666666;">=</span><span style=" font-family:'Hack';"> LA</span><span style=" font-family:'Hack'; color:#666666;">.</span><span style=" font-family:'Hack';">eig(np</span><span style=" font-family:'Hack'; color:#666666;">.</span><span style=" font-family:'Hack';">diag((</span><span style=" font-family:'Hack'; color:#666666;">1</span><span style=" font-family:'Hack';">, </span><span style=" font-family:'Hack'; color:#666666;">2</span><span style=" font-family:'Hack';">, </span><span style=" font-family:'Hack'; color:#666666;">3</span><span style=" font-family:'Hack';">)))</span></pre>
      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack'; font-weight:600; color:#008000;">print</span><span style=" font-family:'Hack';"> w</span></pre>
      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack'; font-weight:600; color:#008000;">print</span><span style=" font-family:'Hack';"> v</span></pre>
      <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Hack';">
</pre>
      <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Hack';">npArr </span><span style=" font-family:'Hack'; color:#666666;">=</span><span style=" font-family:'Hack';"> vtk_to_numpy(input0</span><span style=" font-family:'Hack'; color:#666666;">.</span><span style=" font-family:'Hack';">PointData[</span><span style=" font-family:'Hack'; color:#ba2121;">"val"</span><span style=" font-family:'Hack';">])</span></pre>
      <br>
      <br>
      <br>
      The test with the eig-function works fine. However - i have to
      convert the val-Tensor from VTK to NumPy to work with NumPy. I use
      therefore the vtk_to_numpy function - but it gives<br>
      <br>
      <br>
      <br>
      <style type="text/css">p, li { white-space: pre-wrap; }
</style>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:10pt; color:#800000;">Traceback (most recent call last):</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:10pt; color:#800000;">  File "<string>", line 22, in <module></span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:10pt; color:#800000;">  File "<string>", line 19, in RequestData</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:10pt; color:#800000;">  File "/opt/PARAVIEW_5_4_0_OpenGL2/ParaView-v5.4.0.bin/lib/site-packages/paraview/numpy_support.py", line 213, in vtk_to_numpy</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:10pt; color:#800000;">    typ = vtk_array.GetDataType()</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:10pt; color:#800000;">AttributeError: 'VTKCompositeDataArray' object has no attribute 'GetDataType'</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:10pt; color:#008000;">[ 1.  2.  3.]</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:10pt; color:#008000;">[[ 1.  0.  0.]</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:10pt; color:#008000;"> [ 0.  1.  0.]</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Courier'; font-size:10pt; color:#008000;"> [ 0.  0.  1.]]</span></p>
      <br>
      What did i wrong?<br>
      <br>
            Stefan<br>
      <br>
      <br>
    </div>
    <blockquote type="cite"
cite="mid:CAMaOp+EDw35ot+JyH6WAdpBckEeGs3aMC+=aM4+f=zGANJqsdA@mail.gmail.com">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi,
        <div><br>
        </div>
        <div>The best way to do this would be in a programmable filter.
          I'm guessing numpy has some method to compute eigenvalues for
          non-symmetric matrices. Beyond that adding the capability to
          the Python calculator or some other filter would be needed.</div>
        <div><br>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Tue, Jun 13, 2017 at 3:35 AM, Stefan
          Melber <span dir="ltr"><<a
              href="mailto:Stefan.Melber@dlr.de" target="_blank"
              moz-do-not-send="true">Stefan.Melber@dlr.de</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote">
            <div>
              <div class="m_5477797258878518425moz-cite-prefix">Hi Andy,<br>
                <br>
                i think i found the reason: i need the computation of
                (unsymmetrical) eigenvalues for lambda2 - however it
                seems that the function "eingenvalue" calculates only
                symmetric ones (see
                <a class="m_5477797258878518425moz-txt-link-freetext"
href="https://www.paraview.org/ParaView/Doc/Nightly/www/py-doc/paraview.vtk.numpy_interface.algorithms.html"
                  target="_blank" moz-do-not-send="true">https://www.paraview.org/<wbr>ParaView/Doc/Nightly/www/py-<wbr>doc/paraview.vtk.numpy_<wbr>interface.algorithms.html</a>).
                How can i calculate the unsymmetric ones with ParaView?<br>
                <br>
                Best regards,<br>
                <br>
                     Stefan<br>
                <br>
                <br>
              </div>
              <blockquote type="cite">
                <div dir="ltr">Hi,
                  <div><br>
                  </div>
                  <div>Maybe compute each portion manually and check
                    that against the correct values. Also, verifying the
                    gradient calculation is correct is another thing to
                    look at. If the grid isn't specified properly then
                    the gradient operation will likely be wrong.</div>
                </div>
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">On Fri, Jun 9, 2017 at 8:46
                    AM, Stefan Melber <span dir="ltr"><<a
                        href="mailto:Stefan.Melber@dlr.de"
                        target="_blank" moz-do-not-send="true">Stefan.Melber@dlr.de</a>></span>
                    wrote:<br>
                    <blockquote class="gmail_quote">
                      <div> Hi,<br>
                        <br>
                        <br>
                        for vortex-detection i (tried) to calculate the
                        lambda2-criterion (see e.g. <a
                          class="m_5477797258878518425m_6725794015711734747moz-txt-link-freetext"
href="https://en.wikipedia.org/wiki/Lambda2_method" target="_blank"
                          moz-do-not-send="true">https://en.wikipedia.org/wiki/<wbr>Lambda2_method</a>)
                        with ParaView. The way of calculation is based
                        on this link <a
                          class="m_5477797258878518425m_6725794015711734747moz-txt-link-freetext"
href="http://www.iesensor.com/blog/2016/01/24/using-paraview-to-visualise-vorticity-lambda2-vorticity-q-criterion/"
                          target="_blank" moz-do-not-send="true">http://www.iesensor.com/blog/2<wbr>016/01/24/using-paraview-to-vi<wbr>sualise-vorticity-lambda2-vort<wbr>icity-q-criterion/</a>.<br>
                        <br>
                        However - the results are a kind of "wrong" -
                        see attached pictures: l2_solver.png shows what
                        the flow solver writes out for lambda2,
                        l2_paraview.png shows what calculated with the
                        algorithm below.<br>
                        <br>
                        Calculation of lambda2:<br>
                        <br>
                        <tt>D = Gradients = [d_ij]</tt><tt><br>
                        </tt><tt>S = strain(Vel)</tt><tt><br>
                        </tt><tt><br>
                        </tt><tt>S     = (D + D^T)/2</tt><tt><br>
                        </tt><tt>Omega = (D - D^T)/2</tt><tt><br>
                        </tt><tt><br>
                        </tt><tt>lambda = EigenValue_of(S^2 + Omega^2) </tt><tt><br>
                        </tt><tt>       = EigenValue_of(S^2 + (D - S)^2)
                        </tt><tt><br>
                        </tt><tt>       = EigenValue_of(S^2 + (Gradients
                          - strain(vel))^2) </tt><tt><br>
                        </tt><tt>       </tt><tt><br>
                        </tt><tt>lambda2 = lambda_Y</tt><tt><br>
                        </tt><br>
                        and in ParaView this mean<br>
                        <br>
                        <tt>o Vector of velocity with
                          "Calculator".................: Vel =
                          iHat*x_velocity+jHat*y_velocit<wbr>y+kHat*z_velocity</tt><tt><br>
                        </tt><tt>o Gradients of Vel with
                          "GradientOfUnstructuredDataSet<wbr>": switch
                          on "compute gradient" and name it "Gradients"</tt><tt><br>
                        </tt><tt>o Calculate lambda with
                          "PythonCalculator"............<wbr>.: lambda =
                          eigenvalue(strain(Vel)**2+(Gra<wbr>dients -
                          strain(Vel))**2)</tt><tt><br>
                        </tt><tt>o Caluclate lambda2 with
                          Calculator....................<wbr>: lambda2 =
                          lambda_Y</tt><tt><br>
                        </tt><br>
                               <br>
                        <br>
                        Does anyone see the error why the calculation of
                        lambda2 with ParaView does not work?<br>
                        <br>
                        Remark: i contacted the author of the blog above
                        already - seems he never tested his calculation
                        and has no idea what is "wrong".<br>
                        <br>
                            Stefan<br>
                        <br>
                        <br>
                        <br>
                        <tt>==============================<wbr>==============================<wbr>====</tt><tt><br>
                        </tt><tt>                              <wbr>                            
                                </tt><tt><br>
                        </tt><tt>                     _/             <b>Dr.
                            Stefan Melber-Wilkending</b></tt><tt><br>
                        </tt><tt>                   _/_/                
                                                   </tt><tt><br>
                        </tt><tt>                 _/  _/            
                          Deutsches Zentrum für Luft-  </tt><tt><br>
                        </tt><tt>         _/_/_/_/_/_/_/_/_/_/        
                          und Raumfahrt e.V. (DLR)   </tt><tt><br>
                        </tt><tt>       _/    _/    _/   
                          _/                            <wbr>          </tt><tt><br>
                        </tt><tt>     _/    _/    _/    _/            
                          German Aerospace Center    </tt><tt><br>
                        </tt><tt>   _/_/_/_/_/_/_/_/_/_/          <wbr>   
                          Institute of Aerodynamics   </tt><tt><br>
                        </tt><tt>         _/  _/  _      _              
                          and Flow Technology      </tt><tt><br>
                        </tt><tt>         _/_/   | \ |  |_|          
                          Transport Aircraft Branch   </tt><tt><br>
                        </tt><tt>         _/     |_/ |_ |
                          \                             <wbr>          </tt><tt><br>
                        </tt><tt>                              <wbr>          
                          Lilienthalplatz 7       </tt><tt><br>
                        </tt><tt> Fields of activities:                 
                          38108 Braunschweig</tt><tt>       <br>
                        </tt><tt>                              <wbr>              
                          Germany</tt><tt>             <br>
                        </tt><tt> o Numerical Windtunnel
                          Simulation                    <wbr>          
                        </tt><tt><br>
                        </tt><tt> o Aero-Acoustic Windtunnel Design   
                          Phone : +49 <a
                            href="tel:%28531%29%20295-2836"
                            value="+15312952836" target="_blank"
                            moz-do-not-send="true">531/295-2836</a>   </tt><tt><br>
                        </tt><tt> o Numerical Optimization            
                          Fax. .: +49 <a
                            href="tel:%28531%29%20295-2914"
                            value="+15312952914" target="_blank"
                            moz-do-not-send="true">531/295-2914</a>   </tt><tt><br>
                        </tt><tt> o Visualization
                          Techniques                    <wbr>              
                             </tt><tt><br>
                        </tt><tt> o High-Lift Aerodynamics          
                          Email : <a
class="m_5477797258878518425m_6725794015711734747moz-txt-link-abbreviated"
                            href="mailto:Stefan.Melber@DLR.de"
                            target="_blank" moz-do-not-send="true">Stefan.Melber@DLR.de</a></tt><tt><br>
                        </tt><tt> o Glider-Aerodynamics           <wbr>  
                          Web ..: <a
                            class="m_5477797258878518425m_6725794015711734747moz-txt-link-freetext"
                            href="http://www.dlr.de/AS" target="_blank"
                            moz-do-not-send="true">http://www.dlr.de/AS</a></tt><tt><br>
                        </tt>                              <wbr>                              <wbr>                              <wbr>                     
                        <br>
                        <tt>==============================<wbr>==============================<wbr>====</tt><tt><br>
                        </tt><br>
                      </div>
                      <br>
                      ______________________________<wbr>_________________<br>
                      Powered by <a href="http://www.kitware.com"
                        rel="noreferrer" target="_blank"
                        moz-do-not-send="true">www.kitware.com</a><br>
                      <br>
                      Visit other Kitware open-source projects at <a
                        href="http://www.kitware.com/opensource/opensource.html"
                        rel="noreferrer" target="_blank"
                        moz-do-not-send="true">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
                      <br>
                      Please keep messages on-topic and check the
                      ParaView Wiki at: <a
                        href="http://paraview.org/Wiki/ParaView"
                        rel="noreferrer" target="_blank"
                        moz-do-not-send="true">http://paraview.org/Wiki/ParaV<wbr>iew</a><br>
                      <br>
                      Search the list archives at: <a
                        href="http://markmail.org/search/?q=ParaView"
                        rel="noreferrer" target="_blank"
                        moz-do-not-send="true">http://markmail.org/search/?q=<wbr>ParaView</a><br>
                      <br>
                      Follow this link to subscribe/unsubscribe:<br>
                      <a
                        href="http://public.kitware.com/mailman/listinfo/paraview"
                        rel="noreferrer" target="_blank"
                        moz-do-not-send="true">http://public.kitware.com/mail<wbr>man/listinfo/paraview</a><br>
                      <br>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </blockquote>
              <p>

    </p>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <p>
</p>
  </body>
</html>