[Paraview] Python scripting/Grid geometry transformation

2013-04-02 Thread Nikolaos Beratlis
Hi,

I am reading the following xmf file (attached as var3d.xmf) into Paraview:









   0.   1.   2.


   0.   2.0944   4.1888   6.2832


   1.   2.




0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23






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:

pdi = self.GetPolyDataInput()

pdo = self.GetPolyDataOutput()

newPoints = vtk.vtkPoints()

numPoints = pdi.GetNumberOfPoints()

for i in range(0, numPoints):

coord = pdi.GetPoint(i)

x, y, z = coord[:3]

r = x * sin(y)

t = x * cos(y)

newPoints.InsertPoint(i, r, t, z)

pdo.SetPoints(newPoints)


with Output Data Set Type chosen to be the Same as Input, but I get this
error:


Traceback (most recent call last):
File "", line 26, in 
File "", line 12, in RequestData
AttributeError: 'NoneType' object has no attribute 'SetPoints'

I have no experience with Python scripting. What am I doing wrong?

Thank you,

Nikos
<>

var3d.xmf
Description: Binary data
___
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


Re: [Paraview] XDMF and structured grid in cylindrical coordinates (curvilinear)

2013-04-02 Thread Nikolaos Beratlis
I am currently trying the Function itemtype approach. In all of the
examples for the function itemtype it is assumed that arrays are all of the
same size. In my case I have three 1D arrays of different sizes: x(nx),
y(ny), and z(nz). The operation I need to do to convert to cylindrical
coordinates is:

do k=1,nz
do j=1,ny
do i=1,nx
  x(i)*sin(y(j)), x(i)*cos(y(j)), z(k)
enddo
enddo
enddo

I know that function has the operations SIN and COS but can the nested
looping be achieved with a function operation?

Thank you,

Nikos


On Wed, Mar 20, 2013 at 10:57 AM, David E DeMarle
wrote:

> See if XDMF's Function itemtype will do the trick. (If so please consider
> posting an example to the xdmf.org wiki).
>
> Otherwise you'll have to apply a filter to do the geometry transformation
> after you load the RectMesh into ParaView.
>
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
>
>
> On Wed, Mar 20, 2013 at 10:52 AM, Nikolaos Beratlis <
> nikos.berat...@gmail.com> wrote:
>
>> Hi David,
>>
>> I looked at your examples and I noticed that you changed the GeometryType
>> to XYZ in order to plot a curvilinear grid. So it can't be done by
>> specifying three separate 1D arrays instead (GeometryType=VXVYVZ)? My only
>> concern is storage as I use grids with sizes of 2000x2000x2000. Writing
>> that to a file will be huge compared to writing only three 1D arrays as I
>> do for the cartesian case. Or is there a way to convert a grid read in
>> cartesian coordinates to cylindrical the way it's done in Tecplot?
>>
>> Thank you.
>>
>> Nikos
>>
>>
>> On Wed, Mar 20, 2013 at 10:18 AM, David E DeMarle <
>> dave.dema...@kitware.com> wrote:
>>
>>> XDMF's 3DRectMesh == VTK's vtkRectilinearGrid, in which you case you
>>> specify an X array, Y array and a Z array.
>>>
>>> 3DSMesh == vtkStructuredGrid, in which case you specify X,Y,Z for every
>>> node. Once you do that you're example will work.
>>>
>>> Examples of both (produced in ParaView via Data Object Generator (RG1 |
>>> SG1)->Write as XDMF) are attached.
>>>
>>>
>>>
>>> David E DeMarle
>>> Kitware, Inc.
>>> R&D Engineer
>>> 21 Corporate Drive
>>> Clifton Park, NY 12065-8662
>>> Phone: 518-881-4909
>>>
>>>
>>> On Tue, Mar 19, 2013 at 11:04 PM, Nikolaos Beratlis <
>>> nikos.berat...@gmail.com> wrote:
>>>
 I am using a 3D structured orthogonal grid in cylindrical coordinates.
 I can read the grid as a cartesian grid using the following XDMF file by
 specifying TopologyType "3DRectMesh" and GeometryType="VXVYVZ" (see
 attached image):

 
 
 
 
 
 
 
 
 0.0 1.0 2.0 3.0 4.0 5.0
 
 
 0.0 1.5708 3.1415 4.7124
 
 
 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
 
 
 
 
 

 When I try to read the grid as 3DSMesh which I think corresponds to
 curvilinear Paraview crashes.

 
 
 
 
 
 
 
 
 0.0 1.0 2.0 3.0 4.0 5.0
 
 
 0.0 1.5708 3.1415 4.7124
 
 
 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
 
 
 
 
 

  Is there any way to read a 3D cylindrical grid using three 1D arrays
 for the coordinates in each direction?

 Thank you,

 Nikos



 ___
 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


>>>
>>
>
___
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


Re: [Paraview] XDMF and structured grid in cylindrical coordinates (curvilinear)

2013-04-02 Thread Nikolaos Beratlis
I am currently trying the Function itemtype approach. In all of the
examples for the function itemtype it assumes that arrays are all of the
same size. In my case I have three 1D arrays of different sizes: x(nx),
y(ny), and z(nz). The operation I need to do to convert to cylindrical
coordinates is:

do k=1,nz



On Wed, Mar 20, 2013 at 10:57 AM, David E DeMarle
wrote:

> See if XDMF's Function itemtype will do the trick. (If so please consider
> posting an example to the xdmf.org wiki).
>
> Otherwise you'll have to apply a filter to do the geometry transformation
> after you load the RectMesh into ParaView.
>
>
> David E DeMarle
> Kitware, Inc.
> R&D Engineer
> 21 Corporate Drive
> Clifton Park, NY 12065-8662
> Phone: 518-881-4909
>
>
> On Wed, Mar 20, 2013 at 10:52 AM, Nikolaos Beratlis <
> nikos.berat...@gmail.com> wrote:
>
>> Hi David,
>>
>> I looked at your examples and I noticed that you changed the GeometryType
>> to XYZ in order to plot a curvilinear grid. So it can't be done by
>> specifying three separate 1D arrays instead (GeometryType=VXVYVZ)? My only
>> concern is storage as I use grids with sizes of 2000x2000x2000. Writing
>> that to a file will be huge compared to writing only three 1D arrays as I
>> do for the cartesian case. Or is there a way to convert a grid read in
>> cartesian coordinates to cylindrical the way it's done in Tecplot?
>>
>> Thank you.
>>
>> Nikos
>>
>>
>> On Wed, Mar 20, 2013 at 10:18 AM, David E DeMarle <
>> dave.dema...@kitware.com> wrote:
>>
>>> XDMF's 3DRectMesh == VTK's vtkRectilinearGrid, in which you case you
>>> specify an X array, Y array and a Z array.
>>>
>>> 3DSMesh == vtkStructuredGrid, in which case you specify X,Y,Z for every
>>> node. Once you do that you're example will work.
>>>
>>> Examples of both (produced in ParaView via Data Object Generator (RG1 |
>>> SG1)->Write as XDMF) are attached.
>>>
>>>
>>>
>>> David E DeMarle
>>> Kitware, Inc.
>>> R&D Engineer
>>> 21 Corporate Drive
>>> Clifton Park, NY 12065-8662
>>> Phone: 518-881-4909
>>>
>>>
>>> On Tue, Mar 19, 2013 at 11:04 PM, Nikolaos Beratlis <
>>> nikos.berat...@gmail.com> wrote:
>>>
 I am using a 3D structured orthogonal grid in cylindrical coordinates.
 I can read the grid as a cartesian grid using the following XDMF file by
 specifying TopologyType "3DRectMesh" and GeometryType="VXVYVZ" (see
 attached image):

 
 
 
 
 
 
 
 
 0.0 1.0 2.0 3.0 4.0 5.0
 
 
 0.0 1.5708 3.1415 4.7124
 
 
 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
 
 
 
 
 

 When I try to read the grid as 3DSMesh which I think corresponds to
 curvilinear Paraview crashes.

 
 
 
 
 
 
 
 
 0.0 1.0 2.0 3.0 4.0 5.0
 
 
 0.0 1.5708 3.1415 4.7124
 
 
 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0
 
 
 
 
 

  Is there any way to read a 3D cylindrical grid using three 1D arrays
 for the coordinates in each direction?

 Thank you,

 Nikos



 ___
 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


>>>
>>
>
___
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


Re: [Paraview] Assign scalars/vectors to mesh points in vtkRectilinearGrid, C++

2013-04-02 Thread Andy Bauer
Could you share your generated file? I'm not sure why the rescale to data
range is scaling it to the range [0,1]. Also, what version of ParaView are
you using?

Modifying the file won't cause ParaView to reread it as the reader will not
notice that the time stamp on the file has changed.

Andy


On Tue, Apr 2, 2013 at 4:20 PM, Paw Møller  wrote:

> Superb,
> That was it. Thanks, both of you.
>
> But I have another question.
> The automatic scaling of the vector field works as expected.
> The scaling of the temperature however does not(array of floats). It set
> the range to [0 1], regardless of the actual values.
>
> Paraview(under information) gives the data range = [3.5 1333.5], which is
> correct. And if I manually set the color range to this, everything is good.
> Pressing the automatic color scale(rescale to data), the used interval is
> set back to [0 1].
> Why is that?
>
> I use to code suggested by Joe,
> vtkFloatArray* temperature = vtkFloatArray::New();
> temperature->SetName("Temperature");
> temperature->SetNumberOfComponents(1);
> temperature->SetNumberOfValues(mesh.nn);
> for(int i=0;itemperature->SetValue(i,3.5);
> }
> rgrid->GetPointData()->AddArray(temperature);
>
> And is it possible to update the plot if I overwrite the .vtr file,
> without closing and reopening the file?
>
> Paw
>
___
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


Re: [Paraview] ParaView 3.98.1: Problems with Space Navigator

2013-04-02 Thread David Lonie
On Tue, Apr 2, 2013 at 12:52 PM, Nenad Vujicic  wrote:
> Dear Dave,
>
> It doesn't happen anything, like I didn't touch my 3d mouse. Btw, here is
> what is outputted on standard output when I execute 'vrpn_print_devices
> device0@localhost':
>
> on left button pressed:
>
> Button device0@localhost, number 1 was just pressed
> Button device0@localhost, number 1 was just released
>
> on right button pressed:
>
> Button device0@localhost, number 0 was just pressed
> Button device0@localhost, number 0 was just released
>
> on touching tracker:
>
> Analog device0@localhost:
>
> 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 (6 chans)
> (several above lines with different values)

Ok, so the vrpn server is definitely working, and it sounds like the
"Call not supported for the current property type" error was from
trying to control the Visibility property, rather than the
ModelTransformMatrix. Double check that the VR plugin is listening
(i.e. the "Start" button is disabled and "Stop" is enabled). Also try
restarting paraview. The configuration looks fine to me, I'm not sure
why it isn't working for you.

Are any errors/warnings emitted during startup or while running ParaView?

Dave
___
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


Re: [Paraview] Assign scalars/vectors to mesh points in vtkRectilinearGrid, C++

2013-04-02 Thread Paw Møller
Superb,
That was it. Thanks, both of you.

But I have another question.
The automatic scaling of the vector field works as expected.
The scaling of the temperature however does not(array of floats). It set
the range to [0 1], regardless of the actual values.

Paraview(under information) gives the data range = [3.5 1333.5], which is
correct. And if I manually set the color range to this, everything is good.
Pressing the automatic color scale(rescale to data), the used interval is
set back to [0 1].
Why is that?

I use to code suggested by Joe,
vtkFloatArray* temperature = vtkFloatArray::New();
temperature->SetName("Temperature");
temperature->SetNumberOfComponents(1);
temperature->SetNumberOfValues(mesh.nn);
for(int i=0;iSetValue(i,3.5);
}
rgrid->GetPointData()->AddArray(temperature);

And is it possible to update the plot if I overwrite the .vtr file, without
closing and reopening the file?

Paw
___
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


Re: [Paraview] Assign scalars/vectors to mesh points in vtkRectilinearGrid, C++

2013-04-02 Thread Andy Bauer
You're missing the vtkPointData header file so you just need to add:
#include "vtkPointData.h"

Andy

On Tue, Apr 2, 2013 at 3:33 PM, Paw Møller  wrote:

> Thanks for the answer Joe,
>
> but I still get a compilation error for
>
> rgrid->GetPointData()->AddArray(temperature);
>
> The error:
> invalid use of incomplete type ‘class vtkPointData’
> In file included from /usr/include/vtk-5.8/vtkPointSet.h:29:0,
>  from /usr/include/vtk-5.8/vtkStructuredGrid.h:42,
>  from vtk.cpp:13:
>
> Any ideas?
>
> Paw
>
> ___
> 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
>
>
___
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


Re: [Paraview] Assign scalars/vectors to mesh points in vtkRectilinearGrid, C++

2013-04-02 Thread joseph insley
Hi, Paw,

I believe the problem is that you are mixing calls for scalars and vectors…

For scalars you want to use SetNumberOfValues()/SetValue():

vtkIntArray* temperature = vtkIntArray::New();
temperature->SetName("Temperature");
temperature->SetNumberOfComponents(1);
temperature->SetNumberOfValues(nx*ny*nz);
for(int i=0;iSetValue(i,10); // set everything to 10
}
   rgrid->GetPointData()->AddArray(temperature);


For vectors you want to use SetNumberOfTuples()/SetTuple3() (assuming 
SetNumberOfComponents(3)):

vtkFloatArray* velocity = vtkFloatArray::New();
velocity->SetName("Velocity");
velocity->SetNumberOfComponents(3);
velocity->SetNumberOfTuples(nx*ny*nz);
for(int i=0;iSetTuple3(i,10, 10, 10); // set everything to 10
}
   rgrid->GetPointData()->AddArray(velocity);


I also tend to use GetPointData()->AddArray() rather than 
SetScalars()/SetVectors(), which has caused me trouble if I have more than one 
scalar/vector.
I don't know if that is necessarily the best practice, but it has worked well 
for me.

Hope that helps,
joe.

On Apr 2, 2013, at 1:10 PM, Paw Møller wrote:

> Hi,
> 
> Using the C++ VTK library for writing an .vtr file, I'm able to create the 
> mesh, but not assign any skalars/vectors to the grid points. This is more or 
> less given in the example file RGrid.cxx.
> 
> But how do I assign values at the mesh-points?
> 
> Write the mesh:
> #include 
> #include 
> #include 
> #include 
> #include 
> #include 
> 
> int main(){
>   int nx = 3, ny = 3, nz = 3;
> 
>   // coordinates
>   vtkDoubleArray *xCoords = vtkDoubleArray::New();
>   for (int i=0; iInsertNextValue(i);
>   vtkDoubleArray *yCoords = vtkDoubleArray::New();
>   for (int i=0; iInsertNextValue(i);
>   vtkDoubleArray *zCoords = vtkDoubleArray::New();
>   for (int i=0; iInsertNextValue(i);
> 
>   // The coordinates are assigned to the rectilinear grid.
>   vtkRectilinearGrid *rgrid = vtkRectilinearGrid::New();
>   rgrid->SetDimensions(nx,ny,nz);
>   rgrid->SetXCoordinates(xCoords);
>   rgrid->SetYCoordinates(yCoords);
>   rgrid->SetZCoordinates(zCoords);
> 
>   /* Write to file */
>   vtkSmartPointer
> writer = vtkSmartPointer::New();
>   writer->SetFileName("test.vtr");
> 
> #if VTK_MAJOR_VERSION <= 5
>   writer->SetInput(rgrid);
> #else
>   writer->SetInputData(rgrid);
> #endif
>   writer->Write();
> 
>   /* clean up */
>   xCoords->Delete();
>   yCoords->Delete();
>   zCoords->Delete();
>   rgrid->Delete();
> 
>   printf("DONE printing\n");
> }
> 
> For setting values at the mesh-points, I assumed something like:
> vtkIntArray* temperature = vtkIntArray::New();
> temperature->SetName("Temperature");
> temperature->SetNumberOfComponents(1);
> temperature->SetNumberOfTuples(nx*ny*nz);
> for(int i=0;itemperature->SetValue(i,10); // set everything to 10
> }
> 
>rgrid->GetPointData()->SetScalars(temperature);
> 
> But that doesn't work. As expected, when looking at 
> http://www.vtk.org/doc/nightly/html/classvtkRectilinearGrid.html
> 
> So how do I set values/vectors for all the points in the mesh.
> 
> Regards,
> Paw
> ___
> 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



smime.p7s
Description: S/MIME cryptographic signature
___
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


Re: [Paraview] Assign scalars/vectors to mesh points in vtkRectilinearGrid, C++

2013-04-02 Thread Paw Møller
Thanks for the answer Joe,

but I still get a compilation error for

rgrid->GetPointData()->AddArray(temperature);

The error:
invalid use of incomplete type ‘class vtkPointData’
In file included from /usr/include/vtk-5.8/vtkPointSet.h:29:0,
 from /usr/include/vtk-5.8/vtkStructuredGrid.h:42,
 from vtk.cpp:13:

Any ideas?

Paw
___
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


[Paraview] Assign scalars/vectors to mesh points in vtkRectilinearGrid, C++

2013-04-02 Thread Paw Møller
Hi,

Using the C++ VTK library for writing an .vtr file, I'm able to create the
mesh, but not assign any skalars/vectors to the grid points. This is more
or less given in the example file RGrid.cxx.

But how do I assign values at the mesh-points?

Write the mesh:

#include 
#include 
#include 
#include 
#include 
#include 

int main(){
  int nx = 3, ny = 3, nz = 3;

  // coordinates
  vtkDoubleArray *xCoords = vtkDoubleArray::New();
  for (int i=0; iInsertNextValue(i);
  vtkDoubleArray *yCoords = vtkDoubleArray::New();
  for (int i=0; iInsertNextValue(i);
  vtkDoubleArray *zCoords = vtkDoubleArray::New();
  for (int i=0; iInsertNextValue(i);

  // The coordinates are assigned to the rectilinear grid.
  vtkRectilinearGrid *rgrid = vtkRectilinearGrid::New();
  rgrid->SetDimensions(nx,ny,nz);
  rgrid->SetXCoordinates(xCoords);
  rgrid->SetYCoordinates(yCoords);
  rgrid->SetZCoordinates(zCoords);

  /* Write to file */
  vtkSmartPointer
writer = vtkSmartPointer::New();
  writer->SetFileName("test.vtr");

#if VTK_MAJOR_VERSION <= 5
  writer->SetInput(rgrid);
#else
  writer->SetInputData(rgrid);
#endif
  writer->Write();

  /* clean up */
  xCoords->Delete();
  yCoords->Delete();
  zCoords->Delete();
  rgrid->Delete();

  printf("DONE printing\n");
}

For setting values at the mesh-points, I assumed something like:
vtkIntArray* temperature = vtkIntArray::New();
temperature->SetName("Temperature");
temperature->SetNumberOfComponents(1);
temperature->SetNumberOfTuples(nx*ny*nz);
for(int i=0;iSetValue(i,10); // set everything to 10
}

   rgrid->GetPointData()->SetScalars(temperature);

But that doesn't work. As expected, when looking at
http://www.vtk.org/doc/nightly/html/classvtkRectilinearGrid.html

So how do I set values/vectors for all the points in the mesh.

Regards,
Paw
___
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


Re: [Paraview] Parallel Scalability

2013-04-02 Thread Berk Geveci
Hi Olaf,

I am having some difficulty reproducing this issue. It seems to scale fine
for me. I have some suggestions for improving workflow andperformance:

1. You can simply use pvbatch for this if you remove the Connect() command
from the script. I was running it as:

mpiexec -n 2 ~/Work/ParaView/git-3.14/build-osmesa/bin/pvbatch visualize.py
conc_4996800.vtr

This removes the need to setup a pvserver and a pvpython. It might also
improve performance in situations where ParaView delivers geometry to the
client (pvpython). This is unnecessary for batch use and pvbatch should
avoid it.

2. If you add the following to the end of your script (when running with
pvbatch), you can see a more detailed breakdown of timing information. This
will tell you how long each filter is taking on each process.

from paraview import servermanager as sm

session = sm.ActiveConnection.Session
timerInfo = sm.vtkPVTimerInformation()
timerInfo.SetLogThreshold(0)
session.GatherInformation(0x04, timerInfo, 0)

for i in range(timerInfo.GetNumberOfLogs()):
  print timerInfo.GetLog(i)

3. The way you are using the transform filter is significantly increasing
your compute time and memory usage by converting your rectilinear grid to a
structured grid (because rectilinear grids are always axis aligned). If you
really must transform your data, I suggest  transforming the output of the
contour filter. This was a huge time server when I was running this script.

Best,
-berk


On Tue, Mar 26, 2013 at 11:40 AM, Dr. Olaf Ippisch <
olaf.ippi...@iwr.uni-heidelberg.de> wrote:

> Dear Berk,
>
> I tried your suggestion and coloured the result with the
> ProcessIdScalars Filter. I can see the partitioning and it also makes
> sense, so there should not be any major load imbalance. I did add some
> timing information in the code. I add the changed program. It is evident
> that the data input is not the bottleneck. There is also some speedup in
> the application of the filters (should be the contour filter mostly),
> but this is more than compensated by the much longer time needed by the
> WriteImage command which does the rendering. You can see the times
> below. As I use a fast raid for the I/O this is not due to disk speed.
> Do you have any ideas if I could do something to speed up this last part?
>
> Best regards,
> Olaf
>
> 1 Process:
> Reading data from  conc_4996800.vtr
> Setup and Transformation took  1.5299576
> Writing  contour_00380.png
> [Array: conc, Array: ProcessId]
> (0.0, 0.0)
> Filters took  83.8577969074
> Rendering took  13.8007481098
> Total runtime:  99.1809921265
>
> 2 Processes:
> Reading data from  conc_4996800.vtr
> Setup and Transformation took  1.02662491798
> Writing  contour_00380.png
> [Array: conc, Array: ProcessId]
> (0.0, 1.0)
> Filters took  54.6261291504
> Rendering took  46.8519799709
> Total runtime:  102.504925966
>
> 4 Processes:
> Reading data from  conc_4996800.vtr
> Setup and Transformation took  0.90910410881
> Writing  contour_00380.png
> [Array: conc, Array: ProcessId]
> (0.0, 3.0)
> Filters took  56.8009800911
> Rendering took  42.3190040588
> Total runtime:  100.029356956
>
>
>
> Am 26.03.13 13:43, schrieb Berk Geveci:
> > Hi Olaf,
> >
> > From your previous message, I am assuming that you are using vtr files.
> > In this case, the processing should scale. If you can make an example
> > files available, I can verify this. Feel free to e-mail them to me
> > directly or I can download them somewhere if they are too big. The two
> > potential problems are:
> >
> > - IO. You still have one disk if you are not running this on a cluster.
> > If the processing that ParaView is doing is negligible compared to the
> > time it takes to read the data, you will not see good scaling of the
> > whole script as you add more processes.
> >
> > - Load balancing. ParaView uses static load balancing when running in
> > parallel. So if that partitioning is not load balanced wrt iso-surfacing
> > (e.g. most of the iso-surface is generated by one process only), you
> > will not see good scaling. You can check if this is the case by applying
> > Process Id Scalars to the contour output. It will color polygons based
> > on which processor generates them.
> >
> > Best,
> > -berk
> >
> >
> >
> > On Mon, Mar 25, 2013 at 10:46 AM, Dr. Olaf Ippisch
> >  > > wrote:
> >
> > Dear Paraview developers and users,
> >
> > I tried to run paraview in parallel using a python script. I
> compiled a
> > server including OpenMPI support and support for MESA off-screen
> > rendering and started the server using mpirun. The I connected from a
> > python script (see attachment). I could see that there are two
> threads
> > both taking 100% CPU time. However, there was absolutely no speed-up.
> > The runtime using two processors was completely the some. The data
> sets
> > were rather large (about 100 million unknowns in 3D, 512 x 512 x
> 405).
> > The result looked 

[Paraview] accessing an array in a specific block of a composite dataset

2013-04-02 Thread Hedieh Ebrahimi
Hello all,

I have a composite dataset. I want to access the arrays on one of the
blocks, then do some simple calculations and then write the output to in a
result array using a Python Programmable Filter.

I saw some samples on how to do this using Simple dataset, but does anybody
have any idea how to access arrays in a composite dataset?

Thanks
___
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


Re: [Paraview] ParaView 3.98.1: Problems with Space Navigator

2013-04-02 Thread Nenad Vujicic
Dear Dave,

It doesn't happen anything, like I didn't touch my 3d mouse. Btw, here is
what is outputted on standard output when I execute 'vrpn_print_devices
device0@localhost':

on left button pressed:

Button device0@localhost, number 1 was just pressed
Button device0@localhost, number 1 was just released

on right button pressed:

Button device0@localhost, number 0 was just pressed
Button device0@localhost, number 0 was just released

on touching tracker:

Analog device0@localhost:

0.00, 0.00, 0.00, 0.00, 0.00, 0.00 (6 chans)
(several above lines with different values)

Thanks,
Nenad.



On Tue, Apr 2, 2013 at 6:43 PM, David Lonie  wrote:
>
> On Tue, Apr 2, 2013 at 12:39 PM, Nenad Vujicic  wrote:
> > Dear Dave, Aashish,
> >
> > Thank you very much for your responses.
> >
> > I'm sorry, I tried dummy buttons with both v3.98.1 and current master
> > ParaView sources, but they didn't help me. Also, I'm still able to
select
> > visibility with grab world style from ParaView's UI (in master sources).
> > Btw, my 3d mouse has 2 buttons
> > (http://www.3dconnexion.com/products/spacenavigator.html). Here is one
of
> > snippets from state file I tried:
> >
> >
> > 
> >
> >   
> >   
> >   
> >   
> >
> >   
> > 
> >   
> >   
> >  > property="ModelTransformMatrix">
> >   

Re: [Paraview] ParaView 3.98.1: Problems with Space Navigator

2013-04-02 Thread David Lonie
On Tue, Apr 2, 2013 at 12:39 PM, Nenad Vujicic  wrote:
> Dear Dave, Aashish,
>
> Thank you very much for your responses.
>
> I'm sorry, I tried dummy buttons with both v3.98.1 and current master
> ParaView sources, but they didn't help me. Also, I'm still able to select
> visibility with grab world style from ParaView's UI (in master sources).
> Btw, my 3d mouse has 2 buttons
> (http://www.3dconnexion.com/products/spacenavigator.html). Here is one of
> snippets from state file I tried:
>
>
> 
>
>   
>   
>   
>   
>
>   
> 
>   
>   
>  property="ModelTransformMatrix">
>   

Re: [Paraview] ParaView 3.98.1: Problems with Space Navigator

2013-04-02 Thread Nenad Vujicic
Dear Dave, Aashish,

Thank you very much for your responses.

I'm sorry, I tried dummy buttons with both v3.98.1 and current master
ParaView sources, but they didn't help me. Also, I'm still able to select
visibility with grab world style from ParaView's UI (in master sources).
Btw, my 3d mouse has 2 buttons (
http://www.3dconnexion.com/products/spacenavigator.html). Here is one of
snippets from state file I tried: