# How do I migrate from Legacy VTK (Structured Points) to XML (Structured Grid)?

The documentation is fairly confusing and I know that I need to keep track of the actual grid location of my data. Writing a python script to convert binary data into this vtk format. I want to leave the legacy VTK behind so that I can utilize the parallelism that XML will give. Any help here is appreciated.

• You say "Writing a python script to convert binary data into this vtk format.". I'm not sure what you mean by that. Presumably you have some kind of analysis code that has a discrete model and produces results. The XML format has many subtleties and I finally gave up trying to understand them. It was easier to simply use the VTK API (C++ in my case) to create the data objects and then use the API to write the XML file. Assuming you understand the VTK data model, you can almost ignore the XML file format. – Bill Greene Jun 30 '17 at 17:21
• Where is the documentation for the VTK API? That would probably be a lot easier in the grand scheme of things. – jake_gerard10 Jun 30 '17 at 19:26
• If you simply go to vtk.org and look under Resources, there is a huge amount of documentation and examples. – Bill Greene Jun 30 '17 at 21:10
• I suppose we'd be remiss not to link to the primary source for vtk file formats here. It's always seemed clear enough to work from this document, at least when I've been writing Unstructured Grid file writers. The XML file formats are discussed starting about halfway down the document. vtk.org/wp-content/uploads/2015/04/file-formats.pdf – Tyler Olsen Jun 30 '17 at 23:32

But there is a good case to be made for re-writing the code you have that produces VTK files. I agree that the VTU file is confusing and poorly documented, but take a look at some VTU files that you can find on the web. As an example, there are numerous VTU files in subdirectories here: https://github.com/geodynamics/aspect/tree/master/tests (you may just want to check out the entire git repository to look for them). You can also look at code that writes VTU files -- e.g., the write_vtu() function here: https://github.com/dealii/dealii/blob/master/source/base/data_out_base.cc