[vtkusers] extract values on plane
    Fabian Braennstroem 
    f.braennstroem at gmx.de
       
    Mon May 15 08:36:19 EDT 2006
    
    
  
Hi,
I try to extract the pressure data on a given plane using
python. I tried to define point probes for all points on the
plane and wrote those values to a file:
for k in zcoord:
  for j in ycoord:
    for i in xcoord:
            point= vtk.vtkPointSource();
            point.SetCenter(i, j ,k);
            mapline = vtk.vtkPolyDataMapper();
            mapline.SetInput(point.GetOutput());
            mapline.ScalarVisibilityOff();
            lineactor = vtk.vtkActor();
            lineactor.SetMapper(mapline);
            lineactor.GetProperty().SetColor(.8, .8, .6);
            probe = vtk.vtkProbeFilter();
            probe.SetInput(point.GetOutput());
            probe.SetSource(aa.GetOutput());
            probe.Update();
            pressure_data[kk,jj]= probe.GetOutput().GetPointData().GetArray(1).GetTuple1(1);
            out.write(str(simpleFoam_keps_smooth[kk,jj]) +"\n")
            l=l+1
    jj=jj+1
  jj=0
  kk=kk+1
with zcoord,ycoord and xcoord I define the plane, which works pretty nice, but
I have trouble to figure out how I get access to the pressure data. I set the
probe point inside the loop, so I am not sure, what I have to set for the
'GetTuple1(x)'!? Right now, I get different values for 'GetTuple1(0)',
GetTuple1(1),...'; the same happens with 'GetValue(1),...':
pressure_data[kk,jj]= probe.GetOutput().GetPointData().GetArray(1).GetTuple1(1);
Does anybody have an idea, how I can accomplish that?
Greetings!
 Fabian
    
    
More information about the vtkusers
mailing list