[Paraview] segmentation fault

Berk Geveci berk.geveci at kitware.com
Tue Jun 23 08:31:46 EDT 2009


Hi Alex,

I am moving this discussion to the ParaView mailing list. Please send
your questions/answers there instead of to me directly.

I am not sure what the problem is. The script looks fine at fist
glance. Did you try to get a stack trace by running in a debugger? Or
can you try to comment out portions of the code to try to locate where
the crash occurs?

-berk

On Tue, Jun 23, 2009 at 7:16 AM, Alex Lopez<al564 at eng.cam.ac.uk> wrote:
> Dear Berk,
>
> I finally install the latest version of Paraview, it is better.
> I run the script I copied below with your help.
> I finally have a segmentation fault.
> Do you have any idea
> Thank you very much in advance.
>
> Best
>
> Alex
>
> #! /usr/bin/pvpython
>
> # import paraview stuff
> import paraview
> from paraview import servermanager as sm
>
> # connect internally
> connection=sm.Connect()
>
>
> # Set the pvpython path
> INPUTFILE = "/home/al564/Documents/wo_ghostnodes/cube.vtu"
> OUTPUTFILE = "/home/al564/Documents/wo_ghostnodes/cube_data.vtu"
>
> # create a reader
> reader = sm.sources.XMLUnstructuredGridReader( FileName=INPUTFILE )
>
> # get the data i.e moves data from the server to the client
> data = sm.Fetch( reader )
>
> # get the points
> points = data.GetPoints()
>
> # number of points
> npoints = points.GetNumberOfPoints()
>
>
> # get displacements
> pdata = data.GetPointData()
> displ = pdata.GetArray( 0 )
>
> # array of points type
> newPoints = paraview.vtk.vtkPoints()
>
>
> # add
> for i in range(npoints):
>    coord = points.GetPoint(i)
>    x,y,z = coord[:3]
>    uvec  = displ.GetTuple3(i)
>    u,v,w = uvec[:3]
>    newPoints.InsertPoint(i, x+u, y+v, z+w)
>
>
> data.SetPoints( newPoints )
>
> print data
> #data is a vtkobject
>
> f = open('/home/al564/Documents/wo_ghostnodes/trivialproducer.xml', 'r')
> parser = sm.vtkSMXMLParser()
> parser.Parse(f.read())
> parser.ProcessConfiguration(sm.vtkSMObject.GetProxyManager())
>
> # Update the modules
> sm.updateModules()
>
> tp = sm.sources.TrivialProducer()
> obj = tp.GetClientSideObject()
> obj.SetOutput(data)
>
> writer = sm.writers.XMLUnstructuredGridWriter(DataMode = 0,
> FileName = OUTPUTFILE, Input = tp)
>
> # this writes the output.
> writer.UpdatePipeline()
>
>


More information about the ParaView mailing list