Skip to content

totals ​

Implementation level ​

TypeStatus
CML extraction template
HTML5 representation

Template attributes ​

AttributeValue
sourcexTB log
idtotals
nameTotal energies box
pattern\s*-{10,}\s*$\s*\|\s*TOTAL\sENERGY\s.*
endPattern\s*-{10,}\s*
endOffset1
repeat*
xml:basetotals.xml

Input

           -------------------------------------------------
          | TOTAL ENERGY               -5.070201851499 Eh   |
          | TOTAL ENTHALPY             -5.046994809530 Eh   |
          | TOTAL FREE ENERGY          -5.068414209106 Eh   |
          | GRADIENT NORM               0.016847435283 Eh/a |
          | HOMO-LUMO GAP              13.764660320819 eV   |
           -------------------------------------------------

Output text

xml
<comment class="example.output" id="totals">
        <module cmlx:templateRef="totals">
            <scalar dataType="xsd:double" dictRef="xtb:energy" units="nonsi:hartree">-5.070201851499</scalar>
            <scalar dataType="xsd:double" dictRef="xtb:totalenthalpy" units="nonsi:hartree">-5.046994809530</scalar>
            <scalar dataType="xsd:double" dictRef="xtb:totalfreeenergy" units="nonsi:hartree">-5.068414209106</scalar>
            <scalar dataType="xsd:double" dictRef="xtb:gradientnorm" units="nonsi2:hartree.bohr-1">0.016847435283</scalar>
            <scalar dataType="xsd:double" dictRef="xtb:homolumogap" units="nonsi:electronvolt">13.764660320819</scalar>
        </module>
    </comment>

Template definition

xml
<template id="totalEnergy" pattern="\s*\|\s*TOTAL\sENERGY\s.*" endPattern=".*">  <record>\s*\|\s*TOTAL\sENERGY&#123;F,xtb:energy&#125;.*</record>  <transform process="addUnits" xpath=".//cml:scalar" value="nonsi:hartree" />
    </template>
<template id="totalEnthalpy" pattern="\s*\|\s*TOTAL\sENTHALPY\s.*" endPattern=".*">  <record>\s*\|\s*TOTAL\sENTHALPY&#123;F,xtb:totalenthalpy&#125;.*</record>  <transform process="addUnits" xpath=".//cml:scalar" value="nonsi:hartree" />
    </template>
<template id="totalFreeEnergy" pattern="\s*\|\s*TOTAL\sFREE\sENERGY\s.*" endPattern=".*">  <record>\s*\|\s*TOTAL\sFREE\sENERGY&#123;F,xtb:totalfreeenergy&#125;.*</record>  <transform process="addUnits" xpath=".//cml:scalar" value="nonsi:hartree" />
    </template>
<template id="gradientNorm" pattern="\s*\|\s*GRADIENT\sNORM\s.*" endPattern=".*">  <record>\s*\|\s*GRADIENT\sNORM&#123;F,xtb:gradientnorm&#125;.*</record>  <transform process="addUnits" xpath=".//cml:scalar" value="nonsi2:hartree.bohr-1" />
    </template>
<template id="homolumo" pattern="\s*\|\s*HOMO-LUMO\sGAP\s.*" endPattern=".*">  <record>\s*\|\s*HOMO-LUMO\sGAP&#123;F,xtb:homolumogap&#125;.*</record>  <transform process="addUnits" xpath=".//cml:scalar" value="nonsi:electronvolt" />
    </template>
<transform process="pullup" xpath=".//cml:scalar" repeat="2" />
<transform process="delete" xpath=".//cml:list[count(*)=0]" />
<transform process="delete" xpath=".//cml:module[count(*)=0]" />