Vorpal In File to XML tree structure

VorpalDOM 0.1

  • Parses Vorpal .in files to a XML DOM structure using xml.etree.ElementTree
  • Block finding functions (by type and by name)
  • Scale class to convert between grid and length coordinate systems

With a little fiddling about, python’s built in XML packages can be used to parse the vorpal .in file. xml.etree.ElementTree only needs the block titles (“” for instance) to be altered to “” and a wrapping tag added (the equivalent of an “” tag) for it to be able to parse the file.

The variables contained in the blocks are of course not valid html, but after they have been split into their blocks it is straight forward to parse these into XML attributes and read in their numerical values.

There is also a class which reads some information from the DOM and makes it easy to convert from grid coordinates to meters.

 

Leave a Reply