Nice to see someone else using Tcl/Tk for file conversion :) I do it all the time here.<br><br>Sadly, you've run into the #1 problem with VTK formats, the Grid & Data must remain together (<span style="font-style: italic;">
AFAIK, someone please correct me if I'm wrong</span>).. If you want to separate the two, then you have little choice than to switch to another format. <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 there,<br><br>Since I'm a poor Fortran programmer that can't make the Ensight's binary<br>format working in Paraview properly, I've been writing a TCL/VTK script to<br>convert from Ensight case files to Paraview/VTK format (and I hope 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 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 vtkXMLUnstructuredGridWriter<br>3- Export the results for each time step through the vtkXMLDataSetWriter
<br>4- Assembly the files through a PVD file (Paraview format) as is done with<br>the case file<br><br>My problem is:<br><br>* * * How do I export unstructured grids and results separetely? * * *<br><br>I'm using the following script, but it's only able to save grid+results in
<br>the same file. Note that it's not good since I'll be replicating 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>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: <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></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>