Hi Paul,<div><br></div><div>I add a bug entry for that here <a href="http://www.paraview.org/Bug/view.php?id=13088">http://www.paraview.org/Bug/view.php?id=13088</a> as I didn&#39;t manage to look into it this week...</div>
<div><br></div><div>Seb<br><br><div class="gmail_quote">On Mon, Feb 13, 2012 at 9:34 AM, Edwards, Paul <span dir="ltr">&lt;<a href="mailto:Paul.Edwards3@rolls-royce.com">Paul.Edwards3@rolls-royce.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="purple"><div><p class="MsoNormal">Hi,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The calculator gives incorrect results for multiblock unless the variables have the same index internally.  This can be reproduced with the steps below:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p>
<p><u></u><span>1.<span style="font:7.0pt &quot;Times New Roman&quot;">       </span></span><u></u>Create a python source that outputs vtkUnstructuredGrid with the following script:<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">
def add_scalar(ds, val):<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">                arr = vtk.vtkDoubleArray()<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">                arr.SetName(&quot;Scalar&quot;+str(val))<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">                arr.SetNumberOfComponents(1)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">                arr.SetNumberOfTuples(8)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">
                for i in range(8):<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">                                arr.SetTuple1(i, float(val))<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">
                output.GetPointData().AddArray(arr)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p><p class="MsoNormal" style="margin-left:36.0pt">output = self.GetOutput()<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">npts = 8<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">pts = vtk.vtkPoints()<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">pts.InsertNextPoint(-3.0, -1.0, -1.0)<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">pts.InsertNextPoint(-1.0, -1.0, -1.0)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">pts.InsertNextPoint(-1.0,  1.0, -1.0)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">
pts.InsertNextPoint(-3.0,  1.0, -1.0)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">pts.InsertNextPoint(-3.0, -1.0,  1.0)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">pts.InsertNextPoint(-1.0, -1.0,  1.0)<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">pts.InsertNextPoint(-1.0,  1.0,  1.0)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">pts.InsertNextPoint(-3.0,  1.0,  1.0)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">
output.SetPoints(pts)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">output.Allocate(1,1)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">ids = vtk.vtkIdList()<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">
for i in range(npts):<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">    ids.InsertId(i,i)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">add_scalar(output, 1)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">
add_scalar(output, 2)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">output.InsertNextCell(vtk.VTK_HEXAHEDRON, ids)<u></u><u></u></p><p><u></u><span>2.<span style="font:7.0pt &quot;Times New Roman&quot;">       </span></span><u></u>Create a second python source that outputs vtkUnstructuredGrid with the following script (notice the change in order when adding the scalars):<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">def add_scalar(ds, val):<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">                arr = vtk.vtkDoubleArray()<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">
                arr.SetName(&quot;Scalar&quot;+str(val))<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">                arr.SetNumberOfComponents(1)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">
                arr.SetNumberOfTuples(8)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">                for i in range(8):<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">                                arr.SetTuple1(i, float(val))<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">                output.GetPointData().AddArray(arr)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt"><u></u> <u></u></p><p class="MsoNormal" style="margin-left:36.0pt">
output = self.GetOutput()<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">npts = 8<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">pts = vtk.vtkPoints()<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">
pts.InsertNextPoint(-3.0, -1.0, -1.0)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">pts.InsertNextPoint(-1.0, -1.0, -1.0)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">pts.InsertNextPoint(-1.0,  1.0, -1.0)<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">pts.InsertNextPoint(-3.0,  1.0, -1.0)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">pts.InsertNextPoint(-3.0, -1.0,  1.0)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">
pts.InsertNextPoint(-1.0, -1.0,  1.0)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">pts.InsertNextPoint(-1.0,  1.0,  1.0)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">pts.InsertNextPoint(-3.0,  1.0,  1.0)<u></u><u></u></p>
<p class="MsoNormal" style="margin-left:36.0pt">output.SetPoints(pts)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">output.Allocate(1,1)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">
ids = vtk.vtkIdList()<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">for i in range(npts):<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">    ids.InsertId(i,i) <u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">
add_scalar(output, 2)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">add_scalar(output, 1)<u></u><u></u></p><p class="MsoNormal" style="margin-left:36.0pt">output.InsertNextCell(vtk.VTK_HEXAHEDRON, ids)<u></u><u></u></p>
<p><u></u><span>3.<span style="font:7.0pt &quot;Times New Roman&quot;">       </span></span><u></u>Group the two python sources together<u></u><u></u></p><p><u></u><span>4.<span style="font:7.0pt &quot;Times New Roman&quot;">       </span></span><u></u>Use the Calculator filter to pass through Scalar1<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">See output below:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><img width="750" height="629" src="cid:image001.png@01CCEA5B.B293B590"><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Regards,<u></u><u></u></p><p class="MsoNormal">Paul<u></u><u></u></p></div><pre>The data contained in, or attached to, this e-mail, may contain confidential information. If you have received it in error you should notify the sender immediately by reply e-mail, delete the message from your system and contact <a href="tel:%2B44%20%280%29%201332%20242424" value="+441332242424" target="_blank">+44 (0) 1332 242424</a> (the Rolls-Royce IT Security Director) if you need assistance. Please do not copy it for any purpose, or disclose its contents to any other person.

An e-mail response to this address may be subject to interception or monitoring for operational reasons or for lawful business practices.

(c) 2012 Rolls-Royce plc

Registered office: 65 Buckingham Gate, London SW1E 6AT Company number: 1003142. Registered in England. 
</pre></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a 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 href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div>