Skip to content

Parse vasprun.xml into a MySQL database #2

@bkatiemills

Description

@bkatiemills

Upon receipt of each dataset, metadata has to be extracted out of vasprun.xml and registered to a table in a MySQL database via some python. Each piece of metadata has a name, a variable type, and a value, and each set of metadata has to be able to be related back to the file that it was extracted from. A proposed simple database scheme to achieve this is:

Data Table
<Primary Key> | <path to data>
...

Metadata value table
<Primary Key> | <ISPIN value> | <IBRION value> | .....
...

Metadata type table
<Primary Key> | <ISPIN type> | <IBRION type> | ...
...

The xml fields to extract are as follows (note that fields that don't have an explicit type listed have type 'float'):

 <i type="int" name="ISPIN"> 1</i>
 <i type="int" name="IBRION"> -1</i>
 <i name="EDIFF"> 0.00000100</i>
 <i name="EDIFFG"> -0.05000000</i>
 <i type="int" name="ISIF"> 2</i>
 <i type="int" name="ISYM"> 0</i>
 <i name="ENCUT"> 340.00000000</i>
 <i type="int" name="ISMEAR"> 0</i>
 <i name="SIGMA"> 0.01000000</i>
 <i type="logical" name="LOPTICS"> F </i>
 <i type="logical" name="LPEAD"> F </i>
 <i type="logical" name="LMETAGGA"> F </i>
 <i type="logical" name="LDAU"> T </i>
 <v type="int" name="LDAUTYPE"> 2</v>
 <v type="int" name="LDAUL"> -1 -1 2</v>
 <v name="LDAUU"> 0.00000000 0.00000000 5.00000000</v>
 <v name="LDAUJ"> 0.00000000 0.00000000 0.00000000</v>
 <i type="int" name="IALGO"> 68</i>
 <i type="int" name="NBANDS"> 96</i>
 <i name="NELECT"> 158.00000000</i>
 <i type="int" name="ISMEAR"> 0</i>
 <i name="SIGMA"> 0.01000000</i>
 <i type="logical" name="LNONCOLLINEAR"> F </i>
 <v name="MAGMOM"> 1.00000000 1.00000000 </v>
 <i name="NUPDOWN"> -1.00000000</i>
 <i type="logical" name="LSORBIT"> F </i>
 <i type="logical" name="LDIPOL"> F </i>
 <i type="logical" name="LMONO"> F </i>
 <i type="int" name="IDIPOL"> 0</i>
 <i name="EPSILON"> 1.00000000</i>
 <v name="DIPOL"> -100.00000000 -100.00000000 -100.00000000</v>
 <i name="EFIELD"> 0.00000000</i>
 <i name="PSTRESS"> 0.00000000</i>

 <i type="int" name="NFREE"> 0</i>
 <i type="logical" name="LOPTICS"> F </i>
 <i type="logical" name="LBERRY"> F </i>
 <i type="int" name="ICORELEVEL"> 0</i>
 <i type="int" name="I_CONSTRAINED_M"> 0</i>
 <i type="string" name="GGA">--</i>
 <i type="int" name="VOSKOWN"> 0</i>
 <i type="logical" name="LHFCALC"> F </i>
 <i type="string" name="PRECFOCK"></i>
 <i name="AEXX"> 0.00000000</i>
 <i type="int" name="NKREDX"> 1</i>
 <i type="int" name="NKREDY"> 1</i>
 <i type="int" name="NKREDZ"> 1</i>
 <i type="logical" name="ODDONLY"> F </i>
 <i type="logical" name="EVENONLY"> F </i>
 <i name="HFSCREEN"> 0.00000000</i>
 <i type="logical" name="LEPSILON"> F </i>
 <i type="logical" name="LRPA"> F </i>
 <i name="CSHIFT"> 0.10000000</i>
 <i name="OMEGAMAX"> -1.00000000</i>
 <i name="ENCUTGW"> -2.00000000</i>
 <i type="int" name="NOMEGA"> 0</i>
 <i type="logical" name="LSPECTRAL"> F </i>
 <i type="logical" name="ODDONLYGW"> F </i>
 <i type="logical" name="EVENONLYGW"> F </i>

 <array name="atomtypes" >
 </array>

<structure name="initialpos" >

 <crystal>
 <varray name="basis" >
 <v> 8.46878006 -0.00000094 -0.00000190 </v>
 <v> -0.00000514 8.46877926 -0.00000098 </v>
 <v> -0.00000092 -0.00000023 5.37411607 </v>
 </varray>

 <i name="volume"> 385.43283447 </i>

<varray name="forces" >
 <varray name="stress" >
 <v> 1.79816953 0.00018066 0.00051208 </v>
 <v> 0.00025570 1.79794929 0.00026502 </v>
 <v> 0.00021029 0.00028367 1.22115689 </v>
 </varray>

 <separator name="dft+d2" >
 <i type="logical" name="LVDW"> F </i>
 </separator>

 <v name="MAGDIPOLOUT"> 0.00000000 0.00000000 0.00000000</v>
 <i name="e_wo_entrp"> -70.72311261 </i>
 <i name="efermi"> 3.79419797 </i>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions