Well, i'm about as far away from an Ensight guru as you can get, so someone else will have to chime in on the specifics of the File Format &amp; Ensight.<br><br>But there's a few issues with Binary &amp; Fortran files.&nbsp; <br>
&nbsp;&nbsp; 1) Binary isn't really &quot;cross platform compatible&quot; .&nbsp; If you do an unformatted write on a big endian machine, you have to be careful to byte swap it on a little-endian machine.&nbsp; This can't be easily autodetected, so alot of the readers have the ability to specify it.&nbsp;&nbsp; Maybe this option is missing?
<br>&nbsp;&nbsp; 2) Fortran insists on writing Record Markers at the beginning &amp; end of each write.&nbsp; Handy for integrity checking, royal PITA when you start trying to use it in anything other than fortran.&nbsp; Again, hard to autodetect, so some of the readers give you the ability to specify C or Fortran (like the Plot3d Reader).
<br><br>So you're kinda left to using other formats.&nbsp; Personally, I would like to see the new VTK Parallel XML formats extended to allow for putting the data &amp; the grid in separate files, but I doubt that will happen anytime soon. Xmdf &amp; Xdmf are an option, but not very ensight friendly (I think).
<br><br>Personally i've started writing things to VTK XML formats with the compression enabled.&nbsp; It's ascii, and the grid gets carried around, but it's a minor annoyance for the stuff I'm doing. The ones where it is a huge annoyance, we're using PLOT3D files so it's not an issue.
<br><br><br><br><br><div><span class="gmail_quote">On 3/29/06, <b class="gmail_sendername">Renato N. Elias</b> &lt;<a href="mailto:rnelias@nacad.ufrj.br">rnelias@nacad.ufrj.br</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hi Randall, thanks for your advice...<br><br>This subject has been drive me crazy!!!<br><br>- I can't read SOS files since they are written by Fortran routines;<br><br>- I can't save transient data in VTK since VTK does not have support to
<br>transient data... ok, it can be overcame through PVD files;<br><br>- I can't save grid and results separetely... Ok, I can save them together<br>but it would give unnecessary data being replicated;<br><br>- I tried the Stephane approach (opening the file as unstructured and saving
<br>with only one write) but the number of parameters passed to the &quot;write&quot;<br>function is greater than the limit that the function supports to write;<br><br>- I open the file (ENSIGHT6) as binary (my Fortran has support to it) but PV
<br>only read my files in serial modes (SOS does not work)<br><br>- Ensight Gold binary written by Fortran does not work as well<br><br>- Ok, Ensight format in ASCII works fine but it would give me huge and very<br>slow files...
<br><br>- Ok, there's a Fortran/VTK library distributed with PV, but I'd have to<br>install VTK or port the library to any machine I use (and I'm not a system<br>administrator to do it).<br><br>- I only get success when reading Ensight6 Fortran/Binary data in serial
<br>mode.<br><br>I'm feeling that I (and other Fortran programmers) have no choice... I know<br>that PV and VTK have different Ensight readers, but why do the VTK readers<br>work with my files and in PV it is not always possible? Furthermore, how can
<br>Ensight read Fortran unstructured/binary and C/C++ files without any<br>problem? Within the files have a &quot;C binary&quot; and a &quot;Fortran binary&quot;<br>indication, can't it be used to guide the right way of reading the file?
<br><br>I don't know what I should do... I was writing this script to convert a<br>bunch of results that I have stored but I'm almost giving up and going<br>through write a C writer for my Fortran programs (unfortunately, it won't
<br>solve the problem of my results stored - only if I do another file<br>converter)<br><br>Regards<br><br>Renato N. Elias<br>===============================================<br>PhD student - <a href="http://www.nacad.ufrj.br/~rnelias">
http://www.nacad.ufrj.br/~rnelias</a><br>High Performance Computing Center<br>Federal University of Rio de Janeiro<br>Rio de Janeiro, Brazil<br>+55(21) 2562-8080<br><br><br>________________________________<br><br>De: Randall Hand [mailto:
<a href="mailto:randall.hand@gmail.com">randall.hand@gmail.com</a>]<br>Enviada em: quarta-feira, 29 de março de 2006 16:23<br>Para: Renato N. Elias<br>Cc: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>; <a href="mailto:paraview@paraview.org">
paraview@paraview.org</a><br>Assunto: Re: [vtkusers] Extracting an unstructured grid from Ensight case<br>files...<br><br><br>Nice to see someone else using Tcl/Tk for file conversion :)&nbsp;&nbsp;I do it all<br>the time here.<br>
<br>Sadly, you've run into the #1 problem with VTK formats, the Grid &amp; Data must<br>remain together ( AFAIK, someone please correct me if I'm wrong)..&nbsp;&nbsp;If you<br>want to separate the two, then you have little choice than to switch to
<br>another format.<br><br><br>On 3/29/06, Renato N. Elias &lt;<a href="mailto:rnelias@nacad.ufrj.br">rnelias@nacad.ufrj.br</a>&gt; wrote:<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Hi there,<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Since I'm a poor Fortran programmer that can't make the Ensight's
<br>binary<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;format working in Paraview properly, I've been writing a TCL/VTK<br>script to<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;convert from Ensight case files to Paraview/VTK format (and I hope<br>it will<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;work out my problems...).
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A have the following situation to cover:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1- Model partitioned in several case files (sometimes I run problems<br>in<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parallel/MPI)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2- Each case file has its geometry and results files associated
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3- The geometry does not change in time<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Then, I was thinking about do the following:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1- Read each case file<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2- Export the Unstructured grid through the<br>vtkXMLUnstructuredGridWriter
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3- Export the results for each time step through the<br>vtkXMLDataSetWriter<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4- Assembly the files through a PVD file (Paraview format) as is<br>done with<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the case file<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;My problem is:
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* * * How do I export unstructured grids and results separetely? * *<br>*<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I'm using the following script, but it's only able to save<br>grid+results in<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the same file. Note that it's not good since I'll be replicating
<br>grid that<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;does not change in time.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--------------------------------------------------------------<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;package require vtk<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# loading command line arguments<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set arch [lindex $argv 0]
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set nprocs&nbsp;&nbsp;[lindex $argv 1]<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# building the case file names<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;append arch &quot;_&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;append arch $nprocs<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;append arch &quot;_&quot;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# loop over the case files that will be read and saved in vtk format
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for {set i 0} {$i &lt; $nprocs} {incr i} {<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set filename $arch<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if {$i &lt; 10} { append filename &quot;0&quot; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;append filename $i<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set casefile $filename
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;append casefile &quot;.case&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts &quot; Reading Ensight casefile $casefile&quot;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkGenericEnSightReader reader<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader SetCaseFileName $casefile<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reader Update<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkXMLUnstructuredGridWriter vtkfile<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkfile SetInput [ reader GetOutput ]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkfile SetFileName &quot;$filename.vtk&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts &quot; Exporting VTK unified file...&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkfile Write<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reader&nbsp;&nbsp;Delete<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vtkfile Delete<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wm withdraw .<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Exit<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--------------------------------------------------------------
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thanks for any help<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Renato N. Elias<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;===============================================<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PhD student - <a href="http://www.nacad.ufrj.br/~rnelias">http://www.nacad.ufrj.br/~rnelias
</a><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;High Performance Computing Center<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Federal University of Rio de Janeiro<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rio de Janeiro, Brazil<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+55(21) 2562-8080<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_______________________________________________
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is the private VTK discussion list.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please keep messages on-topic. Check the FAQ at:<br><a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Follow this link to subscribe/unsubscribe:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br><br><br><br><br><br>--<br>Randall Hand<br>Visualization Scientist,<br>ERDC-MSRC Vicksburg, MS<br>Homepage: 
<a href="http://www.yeraze.com">http://www.yeraze.com</a> &lt;<a href="http://www.yeraze.com">http://www.yeraze.com</a>&gt;<br><br></blockquote></div><br><br clear="all"><br>-- <br>Randall Hand<br>Visualization Scientist, 
<br>ERDC-MSRC Vicksburg, MS<br>Homepage: <a href="http://www.yeraze.com">http://www.yeraze.com</a>