Skip to content

constraint ​

Implementation level ​

TypeStatus
CML extraction template
HTML5 representation

Template attributes ​

AttributeValue
sourceMOLCAS log
idconstraint
nameContraints section
pattern\s*(?i)()(CONSTRAINTS){5,}.*
endPattern\s*(?i)()(CONSTRAINTS){5,}.*$\s*(?i)()(CONSTRAINTS){5,}.*
endOffset2
xml:basemodules/constraint.xml

Input ​

ConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraints
ConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraints
Constraints                                                                                        Constraints
Constraints                                 C O N S T R A I N T S                                  Constraints
Constraints                                                                                        Constraints

************************************************************************************************************************
A = ANGLE H1 O H2                                                                                                       
VALUES                                                                                                                  
A = 110 DEGREES                                                                                                         
************************************************************************************************************************


 *************************************************************
 * Values of the primitive constraints                       *
 *************************************************************
 A        : Angle=      108.9246   / Degree    1.901094 / rad


 *******************************************
 * Values of the constraints   / au or rad *
 *******************************************
   Label        C         C0
 Cns001      1.901094  1.919862

Constraints                                                                                        Constraints
ConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraints
ConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraintsConstraints          

Output text ​

xml
<comment class="example.output" id="constraint">
        <module cmlx:templateRef="constraint">
            <list>
               <scalar dataType="xsd:string" dictRef="m:restrictionlabel">A</scalar>
               <scalar dataType="xsd:string" dictRef="m:restriction">ANGLE</scalar>
               <scalar dataType="xsd:string" dictRef="m:restrictionextras">H1 O H2</scalar>
            </list>
            <list>
               <scalar dataType="xsd:string" dictRef="m:restrictionlabel">A</scalar>
               <scalar dataType="xsd:string" dictRef="m:restrictionvalue">110</scalar>
               <scalar dataType="xsd:string" dictRef="m:restrictionunit">DEGREES</scalar>
            </list>
         </module>
    </comment>

Template definition ​

xml
<template pattern="\s*\*&#123;40,&#125;\s*$\s*.*(ANGLE|BOND|DIHEDRAL|OUTOFP).*" endPattern="\s*VALUES.*">  <record />  <record repeat="*">&#123;A,m:restrictionlabel&#125;=&#123;A,m:restriction&#125;&#123;X,m:restrictionextras&#125;</record>                    
    </template>
<template pattern="\s*VALUES.*" endPatern="\s*\*&#123;40,&#125;">  <record />  <record repeat="*">&#123;A,m:restrictionlabel&#125;=&#123;A,m:restrictionvalue&#125;&#123;X,m:restrictionunit&#125;</record>
    </template>
<transform process="move" xpath=".//cml:list/cml:list" to="." />
<transform process="delete" xpath=".//cml:list[count(*)=0]" />
<transform process="delete" xpath=".//cml:module" />