stress ​
Implementation level ​
| Type | Status |
|---|---|
| CML extraction template | |
| HTML5 representation |
Template attributes ​
| Attribute | Value |
|---|---|
| source | CP2K log |
| id | stress |
| name | Stress tensor |
| pattern | \s*STRESS\|\s+Analytical stress tensor.* |
| endPattern | \s*STRESS\|\s+1/3 Trace.* |
| endOffset | 1 |
| repeat | * |
| keep | last |
| xml:base | properties/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+{E,cp2k:stressXX}\s+{E,cp2k:stressXY}\s+{E,cp2k:stressXZ}\s*</record>
<record id="rowY">\s*STRESS\|\s+y\s+{E,cp2k:stressYX}\s+{E,cp2k:stressYY}\s+{E,cp2k:stressYZ}\s*</record>
<record id="rowZ">\s*STRESS\|\s+z\s+{E,cp2k:stressZX}\s+{E,cp2k:stressZY}\s+{E,cp2k:stressZZ}\s*</record>
<record id="trace">\s*STRESS\|\s+1/3 Trace\s+{E,cp2k:pressure}\s*</record>
<transform process="addUnits" xpath=".//cml:scalar" value="nonsi2:bar" />
<transform process="delete" xpath=".//cml:list[count(*)=0]" repeat="2" />