<div dir="ltr">This line looks suspicious to me:<div><br></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">rawData = rawData.Get</span><br style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">It looks like you are setting `rawData` to a function `rawData.Get`. That should be a syntax error.</span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">If fixing that doesn't help, what does</span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">print(type(rawData))</span></div><div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div>produce?</div><div><br></div><div>Cory</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 8, 2018 at 7:25 AM Axtmann Gabriel <<a href="mailto:axtmann@iag.uni-stuttgart.de" target="_blank">axtmann@iag.uni-stuttgart.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  

    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hi guys,<br>
    <br>
    I am trying to calculate the gradient of an unstructed data set
    saved in vtk format with the function in the following:<br>
    <br>
    Somehow I am not able to access the PointData of the solution. The
    error is always<br>
    <br>
    <br>
    <b>    Grad_DMDu = dataAdp.PointData['Grad_DMDu']</b><br>
        obj._dataset.Set(dataset.VTKObject)<br>
        TypeError: Set argument 1: method requires a VTK objec<br>
    <br>
    <br>
    So what am I doing wrong here?<br>
    <br>
    Thanks in advance<br>
    <br>
    ############################################<br>
    def Cal_Dissp(DMDmodeFile,DMDmodeName, nu):<br>
        """<br>
        Calculate the (Pseudo) dissipation with paraview vtk, and return
    data<br>
        """    <br>
        print('   Calculate mode gradient ...')<br>
        import paraview.simple as ps<br>
        import vtk.numpy_interface.dataset_adapter as dsa<br>
        ps.paraview.simple._DisableFirstRenderCameraReset()<br>
        <br>
    <br>
        xmlUnstructerdGrReader =
    ps.XMLUnstructuredGridReader(FileName=[DMDmodeFile])<br>
        xmlUnstructerdGrReader.PointArrayStatus = [ DMDmodeName ]<br>
        <br>
        gradientOfUnstructuredDataSet1 =
    ps.GradientOfUnstructuredDataSet(Input=xmlUnstructerdGrReader)<br>
        gradientOfUnstructuredDataSet1.ScalarArray = ['POINTS',
    DMDmodeName]<br>
        gradientOfUnstructuredDataSet1.ResultArrayName = 'Grad_DMDu'<br>
        <br>
        gradientOfUnstructuredDataSet1.UpdatePipeline()<br>
        <br>
        rawData = ps.servermanager.Fetch(gradientOfUnstructuredDataSet1)<br>
        rawData = rawData.Get<br>
        dataAdp = dsa.WrapDataObject(rawData)<br>
        <br>
    <b>    Grad_DMDu = dataAdp.PointData['Grad_DMDu'] - > Here comes
      the error</b><br>
        <br>
        #release paraview ocupied memory<br>
        del xmlUnstructerdGrReader<br>
        ps.Disconnect()<br>
        ps.Connect()<br>
    <br>
        print('   Calculate dissipation ...')<br>
        D= ..........<br>
     <br>
        return D<br>
    ############################################
  </div>

_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
ParaView discussion is moving! Please visit <a href="https://discourse.paraview.org/" rel="noreferrer" target="_blank">https://discourse.paraview.org/</a> for future posts.<br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" rel="noreferrer" 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" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/paraview</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-956084082460034634gmail_signature" data-smartmail="gmail_signature">Cory Quammen<br>Staff R&D Engineer<br>Kitware, Inc.</div>