<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Look in Google some presentations about
      vtk to understand how vtk handle the different types of datasets
      (Uniform Rectilinear Grids, Unstructured Grid...).<br>
      &nbsp;Some filters in Paraview change the type of the dataset, this
      implies sometimes some memory penalty.<br>
      <br>
      One way to see this phenomena is to create a Wavelet (Sources
      menu), look the information panel (type: Uniform Rectilinear
      Grid), type and memory.<br>
      And then apply a CleanToGrid to generate a Unstructured Grid (so
      we can move the points). <br>
      <br>
      <br>
      Felipe<br>
      <br>
      <br>
      <br>
      Le 05/04/2013 19:36, Nikolaos Beratlis a &eacute;crit&nbsp;:<br>
    </div>
    <blockquote
cite="mid:CALdMxnxgoQQfFuQ2b75sPh-nyHWR1vUjQQTWe425so7N+LrL5A@mail.gmail.com"
      type="cite">
      <div dir="ltr">So I have done the following test. I have created a
        xmf file of a grid in cylindrical coordinates "grid3d_cyl.xmf"
        specified as Topology Type 3DSMesh and Geometry Type XYZ. That
        is a full 3D array is written:
        <div>
          <br>
        </div>
        <div>
          <div>&lt;?xml version="1.0" ?&gt;</div>
          <div>&lt;!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []&gt;</div>
          <div>&lt;Xdmf Version="2.2"&gt;</div>
          <div>&lt;Domain&gt;</div>
          <div>&lt;Grid GridType="Uniform"&gt;</div>
          <div>&lt;Topology TopologyType="3DSMesh" Dimensions=" &nbsp; &nbsp;30 &nbsp;
            &nbsp;70 &nbsp; &nbsp;40"/&gt;</div>
          <div>&lt;Geometry GeometryType="XYZ"&gt;</div>
          <div>&lt;DataItem Dimensions="84000 3" NumberType="Float"
            Precision="4" Format="XML"&gt;</div>
        </div>
        <div>....</div>
        <div>....</div>
        <div>....</div>
        <div>
          <div>&lt;/DataItem&gt;</div>
          <div>&lt;/Geometry&gt;</div>
          <div>&lt;/Grid&gt;</div>
          <div>&lt;/Domain&gt;</div>
          <div>&lt;/Xdmf&gt;</div>
        </div>
        <div><br>
        </div>
        <div style="">The grid is 30x70x40 and the file "grid3d_cyl.xmf"
          is 15.8 MB large. When I read this into Paraview the
          information windows shows it uses 0.98MB of memory.</div>
        <div style=""><br>
        </div>
        <div style="">I then create a grid in cartesian coordinates
          "grid3d_car" specified as Topology Type 3DRectMesh and
          Geometry Type VXVYVZ. Here instead of the full 3D array I
          write thee 1D arrays, one for each coordinates. The file looks
          like:</div>
        <div style=""><br>
        </div>
        <div style="">
          <div>&lt;?xml version="1.0" ?&gt;</div>
          <div>&lt;!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []&gt;</div>
          <div>&lt;Xdmf Version="2.2"&gt;</div>
          <div>&lt;Domain&gt;</div>
          <div>
            &lt;Grid GridType="Uniform"&gt;</div>
          <div>&lt;Topology TopologyType="3DRectMesh" Dimensions=" &nbsp; &nbsp;30
            &nbsp; &nbsp;70 &nbsp; &nbsp;40"/&gt;</div>
          <div>&lt;Geometry GeometryType="VXVYVZ"&gt;</div>
          <div>&lt;DataItem Dimensions=" &nbsp; 40" NumberType="Float"
            Precision="4" Format="XML"&gt;</div>
          <div>&nbsp; &nbsp;0.0000 &nbsp; 1.0000 &nbsp; 2.0000 &nbsp; 3.0000 &nbsp; 4.0000 &nbsp; 5.0000 &nbsp;
            6.0000 &nbsp; 7.0000 &nbsp; 8.0000 &nbsp; 9.0000 &nbsp;10.0000 &nbsp;11.0000 &nbsp;12.0000
            &nbsp;13.0000 &nbsp;14.0000 &nbsp;15.0000 &nbsp;16.0000 &nbsp;17.0000 &nbsp;18.0000
            &nbsp;19.0000 &nbsp;20.0000 &nbsp;21.0000 &nbsp;22.0000 &nbsp;23.0000 &nbsp;24.0000
            &nbsp;25.0000 &nbsp;26.0000 &nbsp;27.0000 &nbsp;28.0000 &nbsp;29.0000 &nbsp;30.0000
            &nbsp;31.0000 &nbsp;32.0000 &nbsp;33.0000 &nbsp;34.0000 &nbsp;35.0000 &nbsp;36.0000
            &nbsp;37.0000 &nbsp;38.0000 &nbsp;39.0000</div>
          <div>&lt;/DataItem&gt;</div>
          <div>&lt;DataItem Dimensions=" &nbsp; 70" NumberType="Float"
            Precision="4" Format="XML"&gt;</div>
          <div>&nbsp; &nbsp;0.0000 &nbsp; 0.0911 &nbsp; 0.1821 &nbsp; 0.2732 &nbsp; 0.3642 &nbsp; 0.4553 &nbsp;
            0.5464 &nbsp; 0.6374 &nbsp; 0.7285 &nbsp; 0.8195 &nbsp; 0.9106 &nbsp; 1.0017 &nbsp; 1.0927
            &nbsp; 1.1838 &nbsp; 1.2748 &nbsp; 1.3659 &nbsp; 1.4570 &nbsp; 1.5480 &nbsp; 1.6391 &nbsp;
            1.7302 &nbsp; 1.8212 &nbsp; 1.9123 &nbsp; 2.0033 &nbsp; 2.0944 &nbsp; 2.1855 &nbsp; 2.2765
            &nbsp; 2.3676 &nbsp; 2.4586 &nbsp; 2.5497 &nbsp; 2.6408 &nbsp; 2.7318 &nbsp; 2.8229 &nbsp;
            2.9139 &nbsp; 3.0050 &nbsp; 3.0961 &nbsp; 3.1871 &nbsp; 3.2782 &nbsp; 3.3692 &nbsp; 3.4603
            &nbsp; 3.5514 &nbsp; 3.6424 &nbsp; 3.7335 &nbsp; 3.8245 &nbsp; 3.9156 &nbsp; 4.0067 &nbsp;
            4.0977 &nbsp; 4.1888 &nbsp; 4.2799 &nbsp; 4.3709 &nbsp; 4.4620 &nbsp; 4.5530 &nbsp; 4.6441
            &nbsp; 4.7352 &nbsp; 4.8262 &nbsp; 4.9173 &nbsp; 5.0083 &nbsp; 5.0994 &nbsp; 5.1905 &nbsp;
            5.2815 &nbsp; 5.3726 &nbsp; 5.4636 &nbsp; 5.5547 &nbsp; 5.6458 &nbsp; 5.7368 &nbsp; 5.8279
            &nbsp; 5.9189 &nbsp; 6.0100 &nbsp; 6.1011 &nbsp; 6.1921 &nbsp; 6.2832</div>
          <div>&lt;/DataItem&gt;</div>
          <div>&lt;DataItem Dimensions=" &nbsp; 30" NumberType="Float"
            Precision="4" Format="XML"&gt;</div>
          <div>&nbsp; &nbsp;1.0000 &nbsp; 2.0000 &nbsp; 3.0000 &nbsp; 4.0000 &nbsp; 5.0000 &nbsp; 6.0000 &nbsp;
            7.0000 &nbsp; 8.0000 &nbsp; 9.0000 &nbsp;10.0000 &nbsp;11.0000 &nbsp;12.0000 &nbsp;13.0000
            &nbsp;14.0000 &nbsp;15.0000 &nbsp;16.0000 &nbsp;17.0000 &nbsp;18.0000 &nbsp;19.0000
            &nbsp;20.0000 &nbsp;21.0000 &nbsp;22.0000 &nbsp;23.0000 &nbsp;24.0000 &nbsp;25.0000
            &nbsp;26.0000 &nbsp;27.0000 &nbsp;28.0000 &nbsp;29.0000 &nbsp;30.0000</div>
          <div>&lt;/DataItem&gt;</div>
          <div>&lt;/Geometry&gt;</div>
          <div>&lt;/Grid&gt;</div>
          <div>&lt;/Domain&gt;</div>
          <div>&lt;/Xdmf&gt;</div>
          <div><br>
          </div>
          <div style="">The gris is still 30x70x40 but the file
            "grid3d_car.xmf" is more compact, it is only 2.2 KB in size.
            When I read it into Paraview the information windows shows
            it uses only 0.003MB. So far so good, I end up saving space
            both on the hard drive and in memory.</div>
          <div style=""><br>
          </div>
          <div style="">I then convert the cartesian grid to cylindrical
            coordinates using the CleantoGrid Filter and also a
            programmable Filter:</div>
          <div style=""><br>
          </div>
          <div style="">
            <p style="margin:0px">pdi = self.GetInput()</p>
            <p style="margin:0px">pdo = self.GetOutput()</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 * cos(y)</p>
            <p style="margin:0px"> t = x * sin(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">The information window in Paraview
              shows that The CleanToGrid Filter uses 7.2 MB and the
              ProgrammableFilter another 7.1MB so in total the cartesian
              to cylindrical conversion uses 14.3 MB. That's a huge
              memory penalty. Here's a summary:</p>
            <p style="margin:0px"><br>
            </p>
            <p style="margin:0px">File &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Size &nbsp; &nbsp; &nbsp;
              Memory</p>
            <p style="margin:0px">grid3d_cyl.xmf &nbsp; 15.8MB &nbsp; &nbsp;0.98MB</p>
          </div>
        </div>
        <div style="">grid3d_car.xmf &nbsp; &nbsp;2.2KB &nbsp; &nbsp; 0.003MB</div>
        <div style="">CleanToGrid &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7.2MB</div>
        <div style="">Programmable &nbsp; &nbsp; &nbsp; - &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 7.1MB</div>
        <div style=""><br>
        </div>
        <div style="">Since both grids contain the exact same coordinate
          information I would expect the approach of converting the grid
          from cartesian to cylindrical to not take more than 0.98MB of
          memory, instead it takes 14.3MB. Does it make any sense? Am I
          doing sth wrong? Can I avoid the memory penalty?</div>
        <div style=""><br>
        </div>
        <div style="">Thank you,</div>
        <div style=""><br>
        </div>
        <div style="">Nikos</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Fri, Apr 5, 2013 at 3:48 AM, Felipe
          Bordeu <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:felipe.bordeu@ec-nantes.fr" target="_blank">felipe.bordeu@ec-nantes.fr</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>By "pipelines", I think you want to say "filters". I
                do not know how to delete intermediary results. <br>
                One way is to apply a filter and then save the result
                ("File"-&gt; "Save Data"). So you can open it later
                without the deed to recreate the hole pipeline.<br>
                <br>
                Felipe<br>
                <br>
                Le 04/04/2013 19:51, Nikolaos Beratlis a &eacute;crit&nbsp;:<br>
              </div>
              <div>
                <div class="h5">
                  <blockquote type="cite">
                    <div dir="ltr">Hi Felipe,
                      <div><br>
                      </div>
                      <div>When I try this script to transform from
                        cartesian to cylindrical coordinates after I
                        have applied the CleantoGrid Filter:</div>
                      <div><br>
                      </div>
                      <div>
                        <div
                          style="font-family:arial,sans-serif;font-size:13px">
                          <div style="margin:0px">pdi = self.GetInput()</div>
                          <div style="margin:0px">pdo = self.GetOutput()</div>
                          <div style="margin:0px">newPoints =
                            vtk.vtkPoints()</div>
                          <div style="margin:0px">numPoints =
                            pdi.GetNumberOfPoints()</div>
                          <div style="margin:0px">for i in range(0,
                            numPoints):</div>
                          <div style="margin:0px">coord =
                            pdi.GetPoint(i)</div>
                          <div style="margin:0px">x, y, z = coord[:3]</div>
                          <div style="margin:0px">r = x * cos(y)</div>
                          <div style="margin:0px"> t = x * sin(y)</div>
                          <div style="margin:0px">newPoints.InsertPoint(i,
                            r, t, z)</div>
                          <div style="margin:0px">pdo.SetPoints(newPoints)</div>
                        </div>
                        <div
                          style="font-family:arial,sans-serif;font-size:13px;margin:0px">pdo.GetPointData().AddArray(pdi.GetPointData().GetArray(0))</div>
                        <div
                          style="font-family:arial,sans-serif;font-size:13px;margin:0px">pdo.GetPointData().AddArray(pdi.GetPointData().GetArray(1))</div>
                        <div
                          style="font-family:arial,sans-serif;font-size:13px;margin:0px">pdo.GetPointData().AddArray(pdi.GetPointData().GetArray(2))</div>
                      </div>
                      <div
                        style="font-family:arial,sans-serif;font-size:13px;margin:0px"><br>
                      </div>
                      <div
                        style="font-family:arial,sans-serif;font-size:13px;margin:0px">it

                        creates two more pipelines, one for CleantoGrid
                        and one for Programmable Filter. Both pipelines
                        are linked to the original pipeline and both
                        pipelines require the same memory as the
                        original pipeline. Is there a way to to delete
                        the previous two pipelines (original with
                        cartesian coordinates and cleantoGrid) so that I
                        only use one memory amount and not three?</div>
                      <div
                        style="font-family:arial,sans-serif;font-size:13px;margin:0px"><br>
                      </div>
                      <div
                        style="font-family:arial,sans-serif;font-size:13px;margin:0px">Nikos</div>
                    </div>
                    <div class="gmail_extra"><br>
                      <br>
                      <div class="gmail_quote"> On Wed, Apr 3, 2013 at
                        12:05 PM, Felipe Bordeu <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:felipe.bordeu@ec-nantes.fr"
                            target="_blank">felipe.bordeu@ec-nantes.fr</a>&gt;</span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div bgcolor="#FFFFFF" text="#000000">
                            <div>you need to copy the point data: add
                              this line to the end of your script:<br>
                              <br>
                              <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">pdo.GetPointData().AddArray(pdi.GetPointData().GetArray(0))</p>
                              <br>
                              this will work only for one field, you can
                              put this line inside a loop to add all the
                              pointdata.<br>
                              <br>
                              Felipe<br>
                              <br>
                              Le 03/04/2013 17:59, Nikolaos Beratlis a
                              &eacute;crit&nbsp;:<br>
                            </div>
                            <div>
                              <div>
                                <blockquote type="cite">
                                  <div dir="ltr">I did and it shows me
                                    the transformed grid, but the
                                    ProgrammableFilter doesn't contain
                                    the variable var. I cannot plot
                                    contours. Should I change the
                                    script?</div>
                                  <div class="gmail_extra"><br>
                                    <br>
                                    <div class="gmail_quote"> On Wed,
                                      Apr 3, 2013 at 11:48 AM, Felipe
                                      Bordeu <span dir="ltr">&lt;<a
                                          moz-do-not-send="true"
                                          href="mailto:felipe.bordeu@ec-nantes.fr"
                                          target="_blank">felipe.bordeu@ec-nantes.fr</a>&gt;</span>
                                      wrote:<br>
                                      <blockquote class="gmail_quote"
                                        style="margin:0 0 0
                                        .8ex;border-left:1px #ccc
                                        solid;padding-left:1ex">
                                        <div bgcolor="#FFFFFF"
                                          text="#000000">
                                          <div>You must apply the
                                            programmablefilter to the
                                            cleantoGrid not to the
                                            var3d.xmf. <br>
                                            <br>
                                            look at the screenshot.<br>
                                            <br>
                                            Felipe<br>
                                            <br>
                                            <img
                                              src="cid:part4.06000205.07090906@ec-nantes.fr"
                                              alt=""><br>
                                            <br>
                                            Le 03/04/2013 17:43,
                                            Nikolaos Beratlis a &eacute;crit&nbsp;:<br>
                                          </div>
                                          <div>
                                            <div>
                                              <blockquote type="cite">
                                                <div dir="ltr">Hi
                                                  Felipe,
                                                  <div><br>
                                                  </div>
                                                  <div>I applied the
                                                    CleanToGrid Filter
                                                    first and then
                                                    applied the
                                                    following script:</div>
                                                  <div>
                                                    <p
                                                      style="margin:0px"><br>
                                                    </p>
                                                    <p
                                                      style="margin:0px">pdi
                                                      = self.GetInput()</p>
                                                    <p
                                                      style="margin:0px">pdo
                                                      = self.GetOutput()</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">&nbsp;
                                                      coord =
                                                      pdi.GetPoint(i)</p>
                                                    <p
                                                      style="margin:0px">&nbsp;
                                                      x, y, z =
                                                      coord[:3]</p>
                                                    <p
                                                      style="margin:0px">&nbsp;
                                                      r = x * <span
                                                        style="background-color:rgb(243,243,243)"><font
color="#ff0000">cos</font></span>(y)</p>
                                                    <p
                                                      style="margin:0px">&nbsp;
                                                      t = x * <font
                                                        color="#ff0000">sin</font>(y)</p>
                                                    <p
                                                      style="margin:0px">&nbsp;
                                                      newPoints.InsertPoint(i,
                                                      r, t, z)</p>
                                                    <p
                                                      style="margin:0px">pdo.SetPoints(newPoints)</p>
                                                  </div>
                                                  <div><br>
                                                  </div>
                                                  <div>Notice
                                                    the&nbsp;indentation&nbsp;and
                                                    also the change of
                                                    the cos(y) and
                                                    sin(y) assignments.&nbsp;</div>
                                                  <div><br>
                                                  </div>
                                                  <div>but I got this
                                                    error:</div>
                                                  <br>
                                                  Traceback (most recent
                                                  call last):<br>
                                                  <br>
                                                  File "&lt;string&gt;",
                                                  line 26, in
                                                  &lt;module&gt;<br>
                                                  <br>
                                                  File "&lt;string&gt;",
                                                  line 12, in
                                                  RequestData<br>
                                                  <br>
                                                  AttributeError:
                                                  SetPoints
                                                  <div>
                                                    <p
                                                      style="margin:0px">
                                                    </p>
                                                  </div>
                                                  <div><br>
                                                  </div>
                                                  <div>What am I doing
                                                    wrong?</div>
                                                </div>
                                                <div class="gmail_extra"><br>
                                                  <br>
                                                  <div
                                                    class="gmail_quote">On
                                                    Wed, Apr 3, 2013 at
                                                    11:13 AM, Felipe
                                                    Bordeu <span
                                                      dir="ltr">&lt;<a
                                                        moz-do-not-send="true"
href="mailto:felipe.bordeu@ec-nantes.fr" target="_blank">felipe.bordeu@ec-nantes.fr</a>&gt;</span>
                                                    wrote:<br>
                                                    <blockquote
                                                      class="gmail_quote"
                                                      style="margin:0 0
                                                      0
                                                      .8ex;border-left:1px
                                                      #ccc
                                                      solid;padding-left:1ex">
                                                      <div
                                                        bgcolor="#FFFFFF"
                                                        text="#000000">
                                                        <div>apply a
                                                          CleanToGrid
                                                          filter before&nbsp;
                                                          the python
                                                          programmable
                                                          filter and
                                                          this is a
                                                          corrected
                                                          version of
                                                          your script:<br>
                                                          <br>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">pdi




                                                          =
                                                          self.GetInput()</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">pdo



                                                          =
                                                          self.GetOutput()</p>
                                                          <div>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">newPoints




                                                          =
                                                          vtk.vtkPoints()</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">numPoints




                                                          =
                                                          pdi.GetNumberOfPoints()</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">for



                                                          i in range(0,
                                                          numPoints):</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          coord =
                                                          pdi.GetPoint(i)</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          x, y, z =
                                                          coord[:3]</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          r = x * sin(y)</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          t = x * cos(y)</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">
                                                          newPoints.InsertPoint(i,

                                                          r, t, z)</p>
                                                          <p
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">pdo.SetPoints(newPoints)</p>
                                                          <br>
                                                          <br>
                                                          </div>
                                                          Felipe<br>
                                                          <br>
                                                          Le 03/04/2013
                                                          04:55,
                                                          Nikolaos
                                                          Beratlis a
                                                          &eacute;crit&nbsp;:<br>
                                                        </div>
                                                        <blockquote
                                                          type="cite">
                                                          <div>
                                                          <div>
                                                          <div dir="ltr">
                                                          <div>Hi,</div>
                                                          <div><br>
                                                          </div>
                                                          I am reading
                                                          the following
                                                          xmf file
                                                          (attached as
                                                          var3d.xmf)
                                                          into Paraview:
                                                          <div><br>
                                                          </div>
                                                          <div>
                                                          <div>&lt;?xml
                                                          version="1.0"
                                                          ?&gt;</div>
                                                          <div>&lt;!DOCTYPE

                                                          Xdmf SYSTEM
                                                          "Xdmf.dtd"
                                                          []&gt;</div>
                                                          <div>&lt;Xdmf
Version="2.2"&gt;</div>
                                                          <div>&lt;Domain&gt;</div>
                                                          <div>&lt;Grid
GridType="Uniform"&gt;</div>
                                                          <div>&lt;Topology

                                                          TopologyType="3DRectMesh"

                                                          Dimensions=" &nbsp;
                                                          &nbsp; 2 &nbsp; &nbsp; 4 &nbsp; &nbsp;
                                                          3"/&gt;</div>
                                                          <div>&lt;Geometry

GeometryType="VXVYVZ"&gt;</div>
                                                          <div>&lt;DataItem

                                                          Dimensions=" &nbsp;
                                                          &nbsp;3"
                                                          NumberType="Float"
                                                          Precision="4"
Format="XML"&gt;</div>
                                                          <div>&nbsp; &nbsp;0.0000
                                                          &nbsp; 1.0000 &nbsp;
                                                          2.0000</div>
                                                          <div>&lt;/DataItem&gt;</div>
                                                          <div>&lt;DataItem

                                                          Dimensions=" &nbsp;
                                                          &nbsp;4"
                                                          NumberType="Float"
                                                          Precision="4"
Format="XML"&gt;</div>
                                                          <div>&nbsp; &nbsp;0.0000
                                                          &nbsp; <a
                                                          moz-do-not-send="true"
href="tel:2.0944%20%C2%A0%204.1888" value="+12094441888" target="_blank">2.0944

                                                          &nbsp; 4.1888</a> &nbsp;
                                                          6.2832</div>
                                                          <div>&lt;/DataItem&gt;</div>
                                                          <div>&lt;DataItem

                                                          Dimensions=" &nbsp;
                                                          &nbsp;2"
                                                          NumberType="Float"
                                                          Precision="4"
Format="XML"&gt;</div>
                                                          <div>&nbsp; &nbsp;1.0000
                                                          &nbsp; 2.0000</div>
                                                          <div>&lt;/DataItem&gt;</div>
                                                          <div>&lt;/Geometry&gt;</div>
                                                          <div>
                                                          &lt;Attribute
                                                          Name="var"
                                                          AttributeType="Scalar"
Center="Node"&gt;</div>
                                                          <div>&lt;DataItem

                                                          Dimensions="24"

                                                          NumberType="Float"

                                                          Precision="4"
Format="XML"&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> 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
                                                          "&lt;string&gt;",
                                                          line 26, in
                                                          &lt;module&gt;<br>
                                                          File
                                                          "&lt;string&gt;",
                                                          line 12, in
                                                          RequestData<br>
                                                          AttributeError:

                                                          'NoneType'
                                                          object has no
                                                          attribute
                                                          'SetPoints'</div>
                                                          </div>
                                                          <div><br>
                                                          </div>
                                                          <div>I have no
                                                          experience
                                                          with Python
                                                          scripting.
                                                          What am I
                                                          doing wrong?</div>
                                                          <div><br>
                                                          </div>
                                                          <div>Thank
                                                          you,</div>
                                                          <div><br>
                                                          </div>
                                                          <div>Nikos</div>
                                                          </div>
                                                          <br>
                                                          <fieldset></fieldset>
                                                          <br>
                                                          </div>
                                                          </div>
                                                          <pre>_______________________________________________
Powered by <a moz-do-not-send="true" href="http://www.kitware.com" target="_blank">www.kitware.com</a>

Visit other Kitware open-source projects at <a moz-do-not-send="true" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a>

Please keep messages on-topic and check the ParaView Wiki at: <a moz-do-not-send="true" href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a>

Follow this link to subscribe/unsubscribe:
<a moz-do-not-send="true" href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><span><font color="#888888">
</font></span></pre>
                                                          <span><font
                                                          color="#888888">
                                                          </font></span></blockquote>
                                                        <span><font
                                                          color="#888888">
                                                          <br>
                                                          <br>
                                                          <pre cols="72">-- 
Felipe Bordeu Weldt
Ing&eacute;nieur de Recherche
-------------------------------------
T&eacute;l. : <a moz-do-not-send="true" href="tel:33%20%280%292%2040%2037%2016" value="+13302403716" target="_blank">33 (0)2 40 37 16</a> 57
Fax. : <a moz-do-not-send="true" href="tel:33%20%280%292%2040%2074%2074" value="+13302407474" target="_blank">33 (0)2 40 74 74</a> 06
<a moz-do-not-send="true" href="mailto:Felipe.Bordeu@ec-nantes.fr" target="_blank">Felipe.Bordeu@ec-nantes.fr</a>
Institut GeM - UMR CNRS 6183
&Eacute;cole Centrale Nantes
1 Rue de La No&euml;, 44321 Nantes, FRANCE
-------------------------------------</pre>
                                                          </font></span></div>
                                                      <br>
_______________________________________________<br>
                                                      Powered by <a
                                                        moz-do-not-send="true"
href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
                                                      <br>
                                                      Visit other
                                                      Kitware
                                                      open-source
                                                      projects at <a
                                                        moz-do-not-send="true"
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
                                                        moz-do-not-send="true"
href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
                                                      <br>
                                                      Follow this link
                                                      to
                                                      subscribe/unsubscribe:<br>
                                                      <a
                                                        moz-do-not-send="true"
href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
                                                      <br>
                                                    </blockquote>
                                                  </div>
                                                  <br>
                                                </div>
                                              </blockquote>
                                              <br>
                                              <br>
                                              <pre cols="72">-- 
Felipe Bordeu Weldt
Ing&eacute;nieur de Recherche
-------------------------------------
T&eacute;l. : <a moz-do-not-send="true" href="tel:33%20%280%292%2040%2037%2016" value="+13302403716" target="_blank">33 (0)2 40 37 16</a> 57
Fax. : <a moz-do-not-send="true" href="tel:33%20%280%292%2040%2074%2074" value="+13302407474" target="_blank">33 (0)2 40 74 74</a> 06
<a moz-do-not-send="true" href="mailto:Felipe.Bordeu@ec-nantes.fr" target="_blank">Felipe.Bordeu@ec-nantes.fr</a>
Institut GeM - UMR CNRS 6183
&Eacute;cole Centrale Nantes
1 Rue de La No&euml;, 44321 Nantes, FRANCE
-------------------------------------</pre>
                                            </div>
                                          </div>
                                        </div>
                                        <br>
_______________________________________________<br>
                                        Powered by <a
                                          moz-do-not-send="true"
                                          href="http://www.kitware.com"
                                          target="_blank">www.kitware.com</a><br>
                                        <br>
                                        Visit other Kitware open-source
                                        projects at <a
                                          moz-do-not-send="true"
                                          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 moz-do-not-send="true"
                                          href="http://paraview.org/Wiki/ParaView"
                                          target="_blank">http://paraview.org/Wiki/ParaView</a><br>
                                        <br>
                                        Follow this link to
                                        subscribe/unsubscribe:<br>
                                        <a moz-do-not-send="true"
                                          href="http://www.paraview.org/mailman/listinfo/paraview"
                                          target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
                                        <br>
                                      </blockquote>
                                    </div>
                                    <br>
                                  </div>
                                </blockquote>
                                <br>
                                <br>
                                <pre cols="72">-- 
Felipe Bordeu Weldt
Ing&eacute;nieur de Recherche
-------------------------------------
T&eacute;l. : <a moz-do-not-send="true" href="tel:33%20%280%292%2040%2037%2016" value="+13302403716" target="_blank">33 (0)2 40 37 16</a> 57
Fax. : <a moz-do-not-send="true" href="tel:33%20%280%292%2040%2074%2074" value="+13302407474" target="_blank">33 (0)2 40 74 74</a> 06
<a moz-do-not-send="true" href="mailto:Felipe.Bordeu@ec-nantes.fr" target="_blank">Felipe.Bordeu@ec-nantes.fr</a>
Institut GeM - UMR CNRS 6183
&Eacute;cole Centrale Nantes
1 Rue de La No&euml;, 44321 Nantes, FRANCE
-------------------------------------</pre>
                              </div>
                            </div>
                          </div>
                          <br>
_______________________________________________<br>
                          Powered by <a moz-do-not-send="true"
                            href="http://www.kitware.com"
                            target="_blank">www.kitware.com</a><br>
                          <br>
                          Visit other Kitware open-source projects at <a
                            moz-do-not-send="true"
                            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 moz-do-not-send="true"
                            href="http://paraview.org/Wiki/ParaView"
                            target="_blank">http://paraview.org/Wiki/ParaView</a><br>
                          <br>
                          Follow this link to subscribe/unsubscribe:<br>
                          <a moz-do-not-send="true"
                            href="http://www.paraview.org/mailman/listinfo/paraview"
                            target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
                          <br>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                  </blockquote>
                  <br>
                  <br>
                  <pre cols="72">-- 
Felipe Bordeu Weldt
Ing&eacute;nieur de Recherche
-------------------------------------
T&eacute;l. : <a moz-do-not-send="true" href="tel:33%20%280%292%2040%2037%2016" value="+13302403716" target="_blank">33 (0)2 40 37 16</a> 57
Fax. : <a moz-do-not-send="true" href="tel:33%20%280%292%2040%2074%2074" value="+13302407474" target="_blank">33 (0)2 40 74 74</a> 06
<a moz-do-not-send="true" href="mailto:Felipe.Bordeu@ec-nantes.fr" target="_blank">Felipe.Bordeu@ec-nantes.fr</a>
Institut GeM - UMR CNRS 6183
&Eacute;cole Centrale Nantes
1 Rue de La No&euml;, 44321 Nantes, FRANCE
-------------------------------------</pre>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            Powered by <a moz-do-not-send="true"
              href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
            <br>
            Visit other Kitware open-source projects at <a
              moz-do-not-send="true"
              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 moz-do-not-send="true"
              href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
            <br>
            Follow this link to subscribe/unsubscribe:<br>
            <a moz-do-not-send="true"
              href="http://www.paraview.org/mailman/listinfo/paraview"
              target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Felipe Bordeu Weldt
Ing&eacute;nieur de Recherche
-------------------------------------
T&eacute;l. : 33 (0)2 40 37 16 57
Fax. : 33 (0)2 40 74 74 06
<a class="moz-txt-link-abbreviated" href="mailto:Felipe.Bordeu@ec-nantes.fr">Felipe.Bordeu@ec-nantes.fr</a>
Institut GeM - UMR CNRS 6183
&Eacute;cole Centrale Nantes
1 Rue de La No&euml;, 44321 Nantes, FRANCE
-------------------------------------</pre>
  </body>
</html>