[Paraview] Access Point Data - something wrong
Axtmann Gabriel
axtmann at iag.uni-stuttgart.de
Fri Jun 8 07:28:20 EDT 2018
Hi guys,
I am trying to calculate the gradient of an unstructed data set saved in
vtk format with the function in the following:
Somehow I am not able to access the PointData of the solution. The error
is always
* Grad_DMDu = dataAdp.PointData['Grad_DMDu']*
obj._dataset.Set(dataset.VTKObject)
TypeError: Set argument 1: method requires a VTK objec
So what am I doing wrong here?
Thanks in advance
############################################
def Cal_Dissp(DMDmodeFile,DMDmodeName, nu):
"""
Calculate the (Pseudo) dissipation with paraview vtk, and return data
"""
print(' Calculate mode gradient ...')
import paraview.simple as ps
import vtk.numpy_interface.dataset_adapter as dsa
ps.paraview.simple._DisableFirstRenderCameraReset()
xmlUnstructerdGrReader =
ps.XMLUnstructuredGridReader(FileName=[DMDmodeFile])
xmlUnstructerdGrReader.PointArrayStatus = [ DMDmodeName ]
gradientOfUnstructuredDataSet1 =
ps.GradientOfUnstructuredDataSet(Input=xmlUnstructerdGrReader)
gradientOfUnstructuredDataSet1.ScalarArray = ['POINTS', DMDmodeName]
gradientOfUnstructuredDataSet1.ResultArrayName = 'Grad_DMDu'
gradientOfUnstructuredDataSet1.UpdatePipeline()
rawData = ps.servermanager.Fetch(gradientOfUnstructuredDataSet1)
rawData = rawData.Get
dataAdp = dsa.WrapDataObject(rawData)
* Grad_DMDu = dataAdp.PointData['Grad_DMDu'] - > Here comes the error*
#release paraview ocupied memory
del xmlUnstructerdGrReader
ps.Disconnect()
ps.Connect()
print(' Calculate dissipation ...')
D= ..........
return D
############################################
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/paraview/attachments/20180608/062bd00d/attachment.html>
-------------- next part --------------
An embedded message was scrubbed...
From: Axtmann Gabriel - hexatransition <gabriel.axtmann at hexatransition.com>
Subject: Access Point Data - something wrong
Date: Fri, 8 Jun 2018 13:03:21 +0200
Size: 6783
URL: <https://public.kitware.com/pipermail/paraview/attachments/20180608/062bd00d/attachment.eml>
More information about the ParaView
mailing list