[vtkusers] Reading EnSight files
Jean Favre
jfavre at cscs.ch
Thu Mar 29 16:24:15 EDT 2007
On 28, Mar 2007 03:22 PM, Marzio Sala <marzio.sala at gmail.com> wrote:
>Hello,
>
>I am using VTK (through Python) to read EnSight files, using something
>like
>
>>>>reader = vtk.vtkEnSightGoldReader()
>>>>reader.SetCaseFileName('test.case')
>>>>reader.Update()
>
>The files are composed by more than one part (or dataset), and they are
>correctly stored in reader.GetOutput().
>
>However, I cannot find the part name anywhere... Anybody knows how to
>get
>the part name?
The part name is stored in FieldData in an array called "Name"
So, the answer to both of your questions are:
1) get a specific output, for example the 0th output
reader.GetOutput().GetDataSet(0,0)
2) get the name of the part
reader.getOutput().GetDataSet(0,0).GetFieldData().GetArray("Name").GetPointer(0)
the command above gives the following answer when run with EnSight's
demo file ami.case
' external flow field'
hope this helps.
--
Dr. Jean M. Favre, email:favre @ cscs.ch
http://www.cscs.ch/about/Favre.php
CSCS, Swiss National Supercomputing Centre | Tel: +41 (91) 610.82.40
Via Cantonale, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82
More information about the vtkusers
mailing list