You are viewing the documentation of a previous ioChem-BD version (v4, legacy).ioChem-BD v4 legacy docs.Visit the current documentationCurrent docs
Skip to content

stress ​

Implementation level ​

TypeStatus
CML extraction template
HTML5 representation

Template attributes ​

AttributeValue
sourceCP2K log
idstress
nameStress tensor
pattern\s*STRESS\|\s+Analytical stress tensor.*
endPattern\s*STRESS\|\s+1/3 Trace.*
endOffset1
repeat*
keeplast
xml:baseproperties/stress.xml

Input

      STRESS| Analytical stress tensor [bar]
      STRESS|                        x                   y                   z
      STRESS|      x        9.54527826191E+03   6.71842980289E-02   1.67382348613E-02
      STRESS|      y        6.71842980289E-02   9.54525855795E+03  -2.86500277102E-02
      STRESS|      z        1.67382348613E-02  -2.86500277102E-02   9.54526358610E+03
      STRESS| 1/3 Trace                                             9.54526680198E+03

Output text

xml
<comment class="example.output" id="stress">
      <module cmlx:templateRef="stress">
        <list cmlx:templateRef="missingID" />
        <list cmlx:templateRef="rowX">
          <list>
            <scalar dataType="xsd:double" dictRef="cp2k:stressXX" units="nonsi2:bar">2.15749152097E+00</scalar>
            <scalar dataType="xsd:double" dictRef="cp2k:stressXY" units="nonsi2:bar">4.41628957151E-03</scalar>
            <scalar dataType="xsd:double" dictRef="cp2k:stressXZ" units="nonsi2:bar">-4.62370568697E-03</scalar>
          </list>
        </list>
        <list cmlx:templateRef="rowY">
          <list>
            <scalar dataType="xsd:double" dictRef="cp2k:stressYX" units="nonsi2:bar">4.41628957151E-03</scalar>
            <scalar dataType="xsd:double" dictRef="cp2k:stressYY" units="nonsi2:bar">2.15753064565E+00</scalar>
            <scalar dataType="xsd:double" dictRef="cp2k:stressYZ" units="nonsi2:bar">-4.98375599008E-03</scalar>
          </list>
        </list>
        <list cmlx:templateRef="rowZ">
          <list>
            <scalar dataType="xsd:double" dictRef="cp2k:stressZX" units="nonsi2:bar">-4.62370568697E-03</scalar>
            <scalar dataType="xsd:double" dictRef="cp2k:stressZY" units="nonsi2:bar">-4.98375599008E-03</scalar>
            <scalar dataType="xsd:double" dictRef="cp2k:stressZZ" units="nonsi2:bar">2.15748652529E+00</scalar>
          </list>
        </list>
        <list cmlx:templateRef="trace">
          <scalar dataType="xsd:double" dictRef="cp2k:pressure" units="nonsi2:bar">2.15750289730E+00</scalar>
        </list>
      </module>
    </comment>

Template definition

xml
<record repeat="2" />
<record id="rowX">\s*STRESS\|\s*x\s+&#123;E,cp2k:stressXX&#125;\s+&#123;E,cp2k:stressXY&#125;\s+&#123;E,cp2k:stressXZ&#125;\s*</record>
<record id="rowY">\s*STRESS\|\s+y\s+&#123;E,cp2k:stressYX&#125;\s+&#123;E,cp2k:stressYY&#125;\s+&#123;E,cp2k:stressYZ&#125;\s*</record>
<record id="rowZ">\s*STRESS\|\s+z\s+&#123;E,cp2k:stressZX&#125;\s+&#123;E,cp2k:stressZY&#125;\s+&#123;E,cp2k:stressZZ&#125;\s*</record>
<record id="trace">\s*STRESS\|\s+1/3 Trace\s+&#123;E,cp2k:pressure&#125;\s*</record>
<transform process="addUnits" xpath=".//cml:scalar" value="nonsi2:bar" />
<transform process="delete" xpath=".//cml:list[count(*)=0]" repeat="2" />