[Paraview] How to extract data array tuples using pvpython

Zhanping Liu zhanping.liu at kitware.com
Wed Apr 7 12:06:10 EDT 2010


Hi Andreas:

    Have you tried visualizing the EnSight data using ParaView UI (instead
of python script)? If it is due to the EnSight reader, please let me know.

    -Zhanping

On Wed, Apr 7, 2010 at 11:12 AM, Andreas Maier <andi.maier at mytum.de> wrote:

> Hi,
>
> I want to read cell data tuples in pvpython, but somehow I am stuck. My
> data
> is read from an ensight case file and I can process it until that point
> when
> I need to access the single tuples of my cell data arrays. Please find an
> extract of my pvpython-code below. Does anyone know how to solve that
> problem? Thanks in advance for your efforts.
>
> Best regards,
>
> Andreas
>
> >from paraview import servermanager, vtk
> >
> >    # Set up connection to the Paraview server
> >if not servermanager.ActiveConnection:
> >       connection = servermanager.Connect()
> >if not connection:
> >       raise exceptions.RuntimeError, "Connection to server failed"
> >
> >    # read ensight source object
> >reader = servermanager.sources.ensight()
> >reader.ByteOrder = 1
> >resultfile = "...._structure_new2.case"
> >reader.CaseFileName = resultfile
> >reader.UpdatePipelineInformation()
> >
> >    # Point to Cell Data
> >ptc = servermanager.filters.PointDataToCellData(Input=reader)
> >ptc.UpdatePipeline()
> >
> >pdi = ptc.GetDataInformation().DataInformation
> >numCells = pdi.GetNumberOfCells()
> >celldata = pdi.GetCellDataInformation()
> >
> >    # here I get my vtkPVArrayInformation
> >vM_array = celldata.GetArrayInformation("vMises_stress")
> >for i in range(numCells):
> >       vMises_str = vM_array.GetTuple1(i) ## <- this does not work
> _______________________________________________
> 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
>



-- 
Zhanping Liu, PhD
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x 138
http://www.zhanpingliu.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100407/8e11a8da/attachment.htm>


More information about the ParaView mailing list