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 & Ensight.<br><br>But there's a few issues with Binary & Fortran files. <br>
1) Binary isn't really "cross platform compatible" . 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. This can't be easily autodetected, so alot of the readers have the ability to specify it. Maybe this option is missing?
<br> 2) Fortran insists on writing Record Markers at the beginning & end of each write. Handy for integrity checking, royal PITA when you start trying to use it in anything other than fortran. 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. Personally, I would like to see the new VTK Parallel XML formats extended to allow for putting the data & the grid in separate files, but I doubt that will happen anytime soon. Xmdf & 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. 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> <<a href="mailto:rnelias@nacad.ufrj.br">rnelias@nacad.ufrj.br</a>> 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 "write"<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 "C binary" and a "Fortran binary"<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 :) I do it all<br>the time here.<br>
<br>Sadly, you've run into the #1 problem with VTK formats, the Grid & Data must<br>remain together ( AFAIK, someone please correct me if I'm wrong).. 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 <<a href="mailto:rnelias@nacad.ufrj.br">rnelias@nacad.ufrj.br</a>> wrote:<br><br><br> Hi there,<br><br> Since I'm a poor Fortran programmer that can't make the Ensight's
<br>binary<br> format working in Paraview properly, I've been writing a TCL/VTK<br>script to<br> convert from Ensight case files to Paraview/VTK format (and I hope<br>it will<br> work out my problems...).
<br><br> A have the following situation to cover:<br><br> 1- Model partitioned in several case files (sometimes I run problems<br>in<br> parallel/MPI)<br> 2- Each case file has its geometry and results files associated
<br> 3- The geometry does not change in time<br><br> Then, I was thinking about do the following:<br><br> 1- Read each case file<br> 2- Export the Unstructured grid through the<br>vtkXMLUnstructuredGridWriter
<br> 3- Export the results for each time step through the<br>vtkXMLDataSetWriter<br> 4- Assembly the files through a PVD file (Paraview format) as is<br>done with<br> the case file<br><br> My problem is:
<br><br> * * * How do I export unstructured grids and results separetely? * *<br>*<br><br> I'm using the following script, but it's only able to save<br>grid+results in<br> the same file. Note that it's not good since I'll be replicating
<br>grid that<br> does not change in time.<br><br> --------------------------------------------------------------<br> package require vtk<br><br> # loading command line arguments<br> set arch [lindex $argv 0]
<br> set nprocs [lindex $argv 1]<br><br> # building the case file names<br> append arch "_"<br> append arch $nprocs<br> append arch "_"<br><br> # loop over the case files that will be read and saved in vtk format
<br><br> for {set i 0} {$i < $nprocs} {incr i} {<br><br> set filename $arch<br> if {$i < 10} { append filename "0" }<br> append filename $i<br> set casefile $filename
<br> append casefile ".case"<br> puts " Reading Ensight casefile $casefile"<br><br> vtkGenericEnSightReader reader<br> reader SetCaseFileName $casefile<br>
reader Update<br><br> vtkXMLUnstructuredGridWriter vtkfile<br> vtkfile SetInput [ reader GetOutput ]<br> vtkfile SetFileName "$filename.vtk"<br> puts " Exporting VTK unified file..."
<br> vtkfile Write<br><br> reader Delete<br> vtkfile Delete<br> }<br> wm withdraw .<br> Exit<br> --------------------------------------------------------------
<br><br> Thanks for any help<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> This is the private VTK discussion list.<br> 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> Follow this link to subscribe/unsubscribe:
<br> <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> <<a href="http://www.yeraze.com">http://www.yeraze.com</a>><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>