[vtk-developers] A possible Ensight bug?
John Biddiscombe
biddisco at cscs.ch
Wed Apr 26 17:27:05 EDT 2006
Amy
I've done some more trawling through the code and some Ensight files. It
seems all the Ensight files I get from a particular source are 1 based
instead of 0 based. Hence my trouble. I suspect the files are wrong.
I can see how to fix the Ensight readers (there are far too many of them
by the way, makes fixing things very painful).
Locally on vtkEnsightReader I'm adding the following flag
// Description:
// The MeasuredGeometryFile should list particle coordinates
// from 0->N-1.
// If a file is loaded where point Ids are listed from 1-N
// the Id to points reference will be wrong and the data
// will be generated incorrectly.
// Setting ParticleCoordinatesByIndex to true will force
// all Id's to increment from 0->N-1 (relative to their order
// in the file) and regardless of the actual Id of of the point.
// Warning, if the Points are listed in non sequential order
// then setting this flag will reorder them.
vtkSetMacro(ParticleCoordinatesByIndex, int);
vtkGetMacro(ParticleCoordinatesByIndex, int);
vtkBooleanMacro(ParticleCoordinatesByIndex, int);
Is this something I should commit? (I.m not sure if it's a fix, or just
a hack to solve my problems) It solves my trouble, but it could allow
file import abuse by careless users.
JB
> Hi John,
>
> I just took a quick look at the EnSight readers in VTK. They are
> assuming that the ids in the particle file are valid as cell ids in
> VTK (i.e., numbered from 0). The EnSight documentation we have here
> does not indicate whether the particle ids should be numbered starting
> from 0 or from 1.
>
> - Amy
>
> At 07:16 AM 4/26/2006, John Biddiscombe wrote:
>> I'm reading particles from an ensight file and I've been noticing
>> that I get nasty effects. After a lengthy bit of debugging, I find
>> that for this example below with 100000 particles, the points are
>> generated correctly, but the Vertex Cells are numbererd 1-100000
>> instead of 0 to 99999, which means that the final point in the list
>> is garbage.
>>
>> Can anyone confirm is this is an Ensight bug, or perhaps, the input
>> file (extract below) is numbered incorrectly
>>
>> Particle positions dataset in Ensight format
>> particle coordinates
>> 100000
>> 1-8.85646E-02-1.17152E-01 2.53629E-02
>> 2-8.94967E-02-1.16437E-01 8.30091E-03
>> 3-1.18068E-01-8.73709E-02 2.25589E-02
>> 4-1.26608E-01-7.45923E-02 3.06231E-02
>> 5-1.25651E-01-7.60931E-02 2.42047E-02
>> 6-1.21370E-01-8.28119E-02 1.69088E-02
>> 7-1.32129E-01-6.42284E-02 3.28655E-02
>> 8-1.32633E-01-6.32604E-02 2.69657E-02
>> 9-1.32304E-01-5.13977E-02 2.71431E-02
>> 10-1.36591E-01-5.40008E-02 3.04352E-02
>> ... for another 99989 points
>>
>> I'm worried because Ensight is used so often around here that there
>> can't really be a bug in the reader - and if the input file is wrong
>> then I have to renumber loads of data files. However, a reader should
>> never generate cellIDs that are larger than the input point list, so
>> there is a bug of some kind (at least not reporting an input file
>> error?)
>>
>> Anyone have any Insight on this (no pun intended!)
>>
>> JB
>>
>> --
>> John Biddiscombe, email:biddisco @ cscs.ch
>> http://www.cscs.ch/about/BJohn.php
>> CSCS, Swiss National Supercomputing Centre | Tel: +41 (91) 610.82.07
>> Via Cantonale, 6928 Manno, Switzerland | Fax: +41 (91) 610.82.82
>>
>> _______________________________________________
>> vtk-developers mailing list
>> vtk-developers at vtk.org
>> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
More information about the vtk-developers
mailing list