Hi Ernest,

Maybe you should give a look at these classes from vtk :

vtkStructuredGridWriter and vtkUnstructuredGridWriter ( http://public.kitware.com/VTK/doc/nightly/html/classvtkUnstructuredGridWriter.html ).

Here's the code we use in our program (linked with VTK)

         vtkUnstructuredGridWriter *uGridWriter=vtkUnstructuredGridWriter::New();
         uGridWriter->SetFileName(fileName)  ;

        ostream *fileHandle= uGridWriter->OpenVTKFile() ;
         uGridWriter->WriteHeader (fileHandle);

         uGridWriter->SetInput(container->getUnstructuredGrid());
         uGridWriter->Write();
         uGridWriter->CloseVTKFile (fileHandle) ;


If you only need to export the mesh (and not the data, it should not be too difficult)
Laurent.


Le 13:57 05/05/2008,Ernest Johnson écrit:
>Hi Ernest - To avoid writing format translators again and again (IIRC
>several people on this list are also interested in the VTK format), it
>would actually be really nice if you could directly add a routine in
>Gmsh to save a mesh in VTK format.

I'm not sure if I know enough to write a valid VTK file.  The code that I produce would probably work fine for my purposes, but cause other applications to fail. If some open source converter (or any other project that writes a general, unstructured mesh) to the VTK format exists, I offer to integrate that code into gmsh. Any suggestions where to start?

Best,
Ernest


Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
_______________________________________________
gmsh mailing list
gmsh@geuz.org
http://www.geuz.org/mailman/listinfo/gmsh

No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.8/1414 - Release Date: 04/05/2008 12:31

__________________________________________________________________________________________________

Laurent Van Miegroet
Ingénieur de recherche
LTAS - Service d'Ingénierie des Véhicules Terrestres
Université de Liège
Institut de Mécanique et de Génie Civil, Bât. B52
Chemin des Chevreuils, 1
B-4000 Liège, Belgique
Tél : +32.4.366.92.70
Fax: +32.4.366.91.59
E-Mail : [EMAIL PROTECTED]
URL: www.ingveh.ulg.ac.be
_______________________________________________
gmsh mailing list
gmsh@geuz.org
http://www.geuz.org/mailman/listinfo/gmsh

Reply via email to