l101.zmatvariables

Implementation level

Type

Status

CML extraction template

image1

HTML5 representation

image2

Template attributes

Attribute

Value

source

Gaussian log

id

l101.zmatvariables

pattern

\s*Symbolic.*$\s+Charge.*Multiplicity.*$[^\.]+

endPattern

\s*

repeat

*

xml:base

l101/l101.zmatvariables.xml

Input

Symbolic Z-matrix:
Charge =  0 Multiplicity = 1
C
H                    1    B1
H                    1    B2       2    A1
H                    1    B3       2    A2       3    D1       0
H                    1    B4       2    A3       3    D2       0
      Variables:
 B1                    1.113
 B2                    1.113
 B3                    1.113
 B4                    1.113
 A1                  109.47124
 A2                  109.47119
 D1                  120.
 A3                  109.47123
 D2                 -120.

Output text

 1<comment class="example.output" id="l101.zmatvariables">
 2    <module cmlx:templateRef="l101.zmatvariables">
 3      <map id="variableMap">
 4        <link from="B1" to="1.113" />
 5        <link from="B2" to="1.113" />
 6        <link from="B3" to="1.113" />
 7        <link from="B4" to="1.113" />
 8        <link from="A1" to="109.47124" />
 9        <link from="A2" to="109.47119" />
10        <link from="D1" to="120.0" />
11        <link from="A3" to="109.47123" />
12        <link from="D2" to="-120.0" />
13      </map>
14      <molecule id="zinitial" spinMultiplicity="1" formalCharge="0">
15        <zMatrix>
16          <length atomRefs2="a1 a2">1.113</length>
17          <length atomRefs2="a1 a3">1.113</length>
18          <angle atomRefs3="a2 a1 a3">109.47124</angle>
19          <length atomRefs2="a1 a4">1.113</length>
20          <angle atomRefs3="a2 a1 a4">109.47119</angle>
21          <torsion atomRefs4="a3 a2 a1 a4">120.0</torsion>
22          <length atomRefs2="a1 a5">1.113</length>
23          <angle atomRefs3="a2 a1 a5">109.47123</angle>
24          <torsion atomRefs4="a3 a2 a1 a5">-120.0</torsion>
25        </zMatrix>
26        <atomArray>
27          <atom elementType="C" id="a1" x3="1.113" y3="0.0" z3="0.0" />
28          <atom elementType="H" id="a2" x3="0.0" y3="0.0" z3="0.0" />
29          <atom elementType="H" id="a3" x3="1.4840003546705822" y3="1.0493463378857821" z3="0.0" />
30          <atom elementType="H" id="a4" x3="1.4839994389430116" y3="-0.524673330822134" z3="0.9087608663603304" />
31          <atom elementType="H" id="a5" x3="1.484000171525091" y3="-0.5246732013187714" z3="-0.9087606420539267" />
32        </atomArray>
33      </molecule>
34    </module>
35  </comment>

Template definition

 1<record />
 2<record id="chargemult">\s*Charge\s*={I,x:formalCharge}\s*Multiplicity\s*={I,x:multiplicity}\s*</record>
 3<record id="atom1">\s*{A,cc:elementType}\s*</record>
 4<record id="atom2">\s*{A,cc:elementType}\s{I,x:junk}\s{A,cc:name}\s*</record>
 5<record id="atom3">\s*{A,cc:elementType}\s{I,x:junk}\s{A,cc:name}\s{I,x:junk}\s{A,cc:name}\s*</record>
 6<record id="atom4" repeat="*">\s*{A,cc:elementType}\s{I,x:junk}\s{A,cc:name}\s{I,x:junk}\s{A,cc:name}\s{I,x:junk}\s{A,cc:name}\s{I,g:unknown}\s*</record>
 7<record />
 8<record id="variable" repeat="*">\s*{A,x:name}\s{F,x:value}\s*</record>
 9<transform process="addMap" xpath="." id="variableMap" from=".//cml:scalar[@dictRef='x:name']" to=".//cml:scalar[@dictRef='x:value']" />
10<transform process="delete" xpath="./cml:list[@cmlx:templateRef='variable']" />
11<transform process="createAtom" xpath=".//cml:scalar[@dictRef='cc:elementType']" />
12<transform process="setValue" xpath=".//cml:list/cml:scalar[2] |            .//cml:list/cml:scalar[4] |            .//cml:list/cml:scalar[6]" map="//cml:map[@id='variableMap']" value="$string(.)" />
13<transform process="createLength" xpath=".//cml:list/cml:list[cml:atom]" atomRefs="$string(cml:scalar[1]) $string(cml:atom/@id)" value="$string(cml:scalar[2])" />
14<transform process="createAngle" xpath=".//cml:list/cml:list[cml:atom]" atomRefs="$string(cml:scalar[3]) $string(cml:scalar[1]) $string(cml:atom/@id)" value="$string(cml:scalar[4])" />
15<transform process="createTorsion" xpath=".//cml:list/cml:list[cml:atom]" atomRefs="$string(cml:scalar[5]) $string(cml:scalar[3]) $string(cml:scalar[1]) $string(cml:atom/@id)" value="$string(cml:scalar[6])" />
16<transform process="createZMatrix" xpath="." id="zinitial" />
17<transform process="addAttribute" xpath=".//cml:molecule" name="spinMultiplicity" value="$string(..//cml:scalar[@dictRef='x:multiplicity'])" />
18<transform process="addAttribute" xpath=".//cml:molecule" name="formalCharge" value="$string(..//cml:scalar[@dictRef='x:formalCharge'])" />
19<transform process="delete" xpath="./cml:list" />