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

hirshfeldspin ​

Implementation level ​

TypeStatus
CML extraction template
HTML5 representation

Template attributes ​

AttributeValue
sourceCP2K log
idhirshfeldspin
nameHirshfeld charges (spin)
pattern.*Hirshfeld Charges.*$\s*$\s*#Atom\s+Element\s+Kind\s+Ref Charge\s+Population\s+Spin moment.*
endPattern\s+Total Charge.*
endOffset1
repeat*
keeplast
xml:baseproperties/hirshfeldspin.xml

Input

                                 Hirshfeld Charges
      
        #Atom  Element  Kind  Ref Charge     Population       Spin moment  Net charge
            1       O      1       6.000    3.500   2.500            1.000      0.001
            2       O      1       6.000    3.500   2.500            1.000      0.001

Output text

xml
<comment class="example.output" id="hirshfeldspin">
      <module cmlx:templateRef="hirshfeldspin">
        <list cmlx:templateRef="atom">
          <array dataType="xsd:integer" dictRef="cc:serialNumber" size="2">1 2</array>
          <array dataType="xsd:string" dictRef="cc:elementType" size="2">O O</array>
          <array dataType="xsd:integer" dictRef="cp2k:kind" size="2">1 1</array>
          <array dataType="xsd:double" dictRef="cp2k:referenceCharge" size="2">6.000 6.000</array>
          <array dataType="xsd:double" dictRef="cp2k:hirshfeldPopulationAlpha" size="2">3.500 3.500</array>
          <array dataType="xsd:double" dictRef="cp2k:hirshfeldPopulationBeta" size="2">2.500 2.500</array>
          <array dataType="xsd:double" dictRef="cp2k:spinMoment" size="2">1.000 1.000</array>
          <array dataType="xsd:double" dictRef="cp2k:hirshfeldCharge" size="2">0.001 0.001</array>
        </list>
        <list cmlx:templateRef="total">
          <scalar dataType="xsd:double" dictRef="cp2k:hirshfeldTotalCharge">0.001</scalar>
        </list>
      </module>
    </comment>

Template definition

xml
<record repeat="3" />
<record id="atom" repeat="*" makeArray="true">\s*&#123;I,cc:serialNumber&#125;\s+&#123;A,cc:elementType&#125;\s+&#123;I,cp2k:kind&#125;\s+&#123;E,cp2k:referenceCharge&#125;\s+&#123;E,cp2k:hirshfeldPopulationAlpha&#125;\s+&#123;E,cp2k:hirshfeldPopulationBeta&#125;\s+&#123;E,cp2k:spinMoment&#125;\s+&#123;E,cp2k:hirshfeldCharge&#125;\s*</record>
<record id="total">\s+Total Charge\s+&#123;E,cp2k:hirshfeldTotalCharge&#125;\s*</record>
<transform process="delete" xpath=".//cml:list[count(*)=0]" repeat="3" />