<div dir="ltr"><div style>Hi,</div><div style><br></div>I am reading the following xmf file (attached as var3d.xmf) into Paraview:<div><br></div><div><div>&lt;?xml version=&quot;1.0&quot; ?&gt;</div><div>&lt;!DOCTYPE Xdmf SYSTEM &quot;Xdmf.dtd&quot; []&gt;</div>
<div>&lt;Xdmf Version=&quot;2.2&quot;&gt;</div><div>&lt;Domain&gt;</div><div>&lt;Grid GridType=&quot;Uniform&quot;&gt;</div><div>&lt;Topology TopologyType=&quot;3DRectMesh&quot; Dimensions=&quot;     2     4     3&quot;/&gt;</div>
<div>&lt;Geometry GeometryType=&quot;VXVYVZ&quot;&gt;</div><div>&lt;DataItem Dimensions=&quot;    3&quot; NumberType=&quot;Float&quot; Precision=&quot;4&quot; Format=&quot;XML&quot;&gt;</div><div>   0.0000   1.0000   2.0000</div>
<div>&lt;/DataItem&gt;</div><div>&lt;DataItem Dimensions=&quot;    4&quot; NumberType=&quot;Float&quot; Precision=&quot;4&quot; Format=&quot;XML&quot;&gt;</div><div>   0.0000   2.0944   4.1888   6.2832</div><div>&lt;/DataItem&gt;</div>
<div>&lt;DataItem Dimensions=&quot;    2&quot; NumberType=&quot;Float&quot; Precision=&quot;4&quot; Format=&quot;XML&quot;&gt;</div><div>   1.0000   2.0000</div><div>&lt;/DataItem&gt;</div><div>&lt;/Geometry&gt;</div><div>
&lt;Attribute Name=&quot;var&quot; AttributeType=&quot;Scalar&quot; Center=&quot;Node&quot;&gt;</div><div>&lt;DataItem Dimensions=&quot;24&quot; NumberType=&quot;Float&quot; Precision=&quot;4&quot; Format=&quot;XML&quot;&gt;</div>
<div>0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23</div><div>&lt;/DataItem&gt;</div><div>&lt;/Attribute&gt;</div><div>&lt;/Grid&gt;</div><div>&lt;/Domain&gt;</div><div>&lt;/Xdmf&gt;</div><div><br></div><div style>
The grid is a 3D orthogonal grid read in cartesian coordinates (see attached image showing grid and contours of variable). I then want to transform the grid from cartesian to cylindrical coordinates. I tried using the following Python script:</div>
<div><br></div><div>
<p style="margin:0px">pdi = self.GetPolyDataInput()</p>
<p style="margin:0px">pdo =  self.GetPolyDataOutput()</p>
<p style="margin:0px">newPoints = vtk.vtkPoints()</p>
<p style="margin:0px">numPoints = pdi.GetNumberOfPoints()</p>
<p style="margin:0px">for i in range(0, numPoints):</p>
<p style="margin:0px">    coord = pdi.GetPoint(i)</p>
<p style="margin:0px">    x, y, z = coord[:3]</p>
<p style="margin:0px">    r = x * sin(y)</p>
<p style="margin:0px">    t = x * cos(y)</p>
<p style="margin:0px">    newPoints.InsertPoint(i, r, t, z)</p>
<p style="margin:0px">pdo.SetPoints(newPoints)</p><p style="margin:0px"><br></p><p style="margin:0px">with Output Data Set Type chosen to be the Same as Input, but I get this error:</p><p style="margin:0px"><br></p>Traceback (most recent call last):<br>
File &quot;&lt;string&gt;&quot;, line 26, in &lt;module&gt;<br>File &quot;&lt;string&gt;&quot;, line 12, in RequestData<br>AttributeError: &#39;NoneType&#39; object has no attribute &#39;SetPoints&#39;</div></div><div><br>
</div><div style>I have no experience with Python scripting. What am I doing wrong?</div><div style><br></div><div style>Thank you,</div><div style><br></div><div style>Nikos</div></div>