[Paraview] Ensight reader problems...

Jean M. Favre jfavre at cscs.ch
Thu Oct 21 09:49:25 EDT 2004


Renato Nascimento Elias wrote:
>  
> I've been getting some problems when trying to read an Ensight (not GOLD)
> file generated by a Fortran routine written by myself. This routine writes
> multiparts geometry files and three variable files (2 scalar and 1 vectorial
> fields) in binary format. 
> 
> I've already checked the case file with the ens_checker.exe utility provided
> by CEI and everything appears to be fine with my file (see ens_checker.out
> file attached). When I try to read the file with the Ensight reader of the
> Paraview (in little and big endian byte orders) nothing happens.

ParaView actually returns silently because the following check returns 
an error:

int vtkEnSight6BinaryReader::ReadGeometryFile()

   lineRead = this->ReadLine(line);
   fprintf(stderr,"line0 = %s\n", line);
   sscanf(line, " %*s %s", subLine);
   if (strcmp(subLine, "Binary") != 0 &&
       strcmp(subLine, "binary") != 0)
     {
     vtkErrorMacro("This is not an EnSight6 binary file. Try "
                   << "vtkEnSight6Reader.");
     return 0;
     }

Readline(line) only reads up 80 characters and since the binary was 
writen in FORTRAN, it actually has 4-byte offsets added before and after 
the data item. I took a look at the data with "od" and it shows the 
following:

od -A decimal -s80 pl075-pqn_4.geo | more

0000004 Fortran Binary 

0000092  Created by WriteEnsightMesh Routine 

0000180 Preprocessor2D program 

0000268 node id given 

0000356 element id given

Notice the decimal offsets. The VTK EnSight readers parse the data on 
80-byte blocks as extracted by Readline(line). I suspect that is the 
source of the problem.

Hope this helps track down the problem.

-- 
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 ParaView mailing list