[Paraview] calculator gives incorrect results for multiblock datasets

Edwards, Paul Paul.Edwards3 at Rolls-Royce.com
Fri Apr 13 10:15:30 EDT 2012


I had added it too! (although, without the image) - 
http://www.paraview.org/Bug/view.php?id=12929

 

Regards,
Paul

 

From: Sebastien Jourdain [mailto:sebastien.jourdain at kitware.com] 
Sent: 13 April 2012 15:12
To: Edwards, Paul
Cc: paraview at paraview.org
Subject: Re: [Paraview] calculator gives incorrect results for
multiblock datasets

 

Hi Paul,

 

I add a bug entry for that here 
http://www.paraview.org/Bug/view.php?id=13088 as I didn't manage to look
into it this week...

 

Seb

On Mon, Feb 13, 2012 at 9:34 AM, Edwards, Paul <
Paul.Edwards3 at rolls-royce.com> wrote:

Hi,

 

The calculator gives incorrect results for multiblock unless the
variables have the same index internally.  This can be reproduced with
the steps below:

 

1.       Create a python source that outputs vtkUnstructuredGrid with
the following script:

def add_scalar(ds, val):

                arr = vtk.vtkDoubleArray()

                arr.SetName("Scalar"+str(val))

                arr.SetNumberOfComponents(1)

                arr.SetNumberOfTuples(8)

                for i in range(8):

                                arr.SetTuple1(i, float(val))

                output.GetPointData().AddArray(arr)

 

output = self.GetOutput()

npts = 8

pts = vtk.vtkPoints()

pts.InsertNextPoint(-3.0, -1.0, -1.0)

pts.InsertNextPoint(-1.0, -1.0, -1.0)

pts.InsertNextPoint(-1.0,  1.0, -1.0)

pts.InsertNextPoint(-3.0,  1.0, -1.0)

pts.InsertNextPoint(-3.0, -1.0,  1.0)

pts.InsertNextPoint(-1.0, -1.0,  1.0)

pts.InsertNextPoint(-1.0,  1.0,  1.0)

pts.InsertNextPoint(-3.0,  1.0,  1.0)

output.SetPoints(pts)

output.Allocate(1,1)

ids = vtk.vtkIdList()

for i in range(npts):

    ids.InsertId(i,i)

add_scalar(output, 1)

add_scalar(output, 2)

output.InsertNextCell(vtk.VTK_HEXAHEDRON, ids)

2.       Create a second python source that outputs vtkUnstructuredGrid
with the following script (notice the change in order when adding the
scalars):

def add_scalar(ds, val):

                arr = vtk.vtkDoubleArray()

                arr.SetName("Scalar"+str(val))

                arr.SetNumberOfComponents(1)

                arr.SetNumberOfTuples(8)

                for i in range(8):

                                arr.SetTuple1(i, float(val))

                output.GetPointData().AddArray(arr)

 

output = self.GetOutput()

npts = 8

pts = vtk.vtkPoints()

pts.InsertNextPoint(-3.0, -1.0, -1.0)

pts.InsertNextPoint(-1.0, -1.0, -1.0)

pts.InsertNextPoint(-1.0,  1.0, -1.0)

pts.InsertNextPoint(-3.0,  1.0, -1.0)

pts.InsertNextPoint(-3.0, -1.0,  1.0)

pts.InsertNextPoint(-1.0, -1.0,  1.0)

pts.InsertNextPoint(-1.0,  1.0,  1.0)

pts.InsertNextPoint(-3.0,  1.0,  1.0)

output.SetPoints(pts)

output.Allocate(1,1)

ids = vtk.vtkIdList()

for i in range(npts):

    ids.InsertId(i,i) 

add_scalar(output, 2)

add_scalar(output, 1)

output.InsertNextCell(vtk.VTK_HEXAHEDRON, ids)

3.       Group the two python sources together

4.       Use the Calculator filter to pass through Scalar1

 

See output below:

 

 

 

Regards,

Paul

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 +44 (0) 1332 242424
<tel:%2B44%20%280%29%201332%20242424>  (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. 


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

 


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 +44 (0) 1332 242424 (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. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120413/a25cde79/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 29544 bytes
Desc: image001.png
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120413/a25cde79/attachment-0001.png>


More information about the ParaView mailing list