Class NBOParser


  • public class NBOParser
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean haveBeta  
      private Viewer vwr  
    • Constructor Summary

      Constructors 
      Constructor Description
      NBOParser()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean connectNBO​(int modelIndex, java.lang.String type)  
      private static void dumpMatrix​(java.lang.String nrtType, int index, int[][] matrix)  
      javajs.util.Lst<java.lang.Object> getAllStructures​(java.lang.String output, javajs.util.Lst<java.lang.Object> list)  
      private static int getAtomIndex​(java.lang.String xx99)  
      private java.lang.String getBlock​(java.lang.String output, java.lang.String key)  
      private java.lang.String getData​(java.lang.String output, java.lang.String start, java.lang.String end, int n)  
      java.lang.String getNBOAtomLabel​(Atom a)
      get the
      static java.util.Map<java.lang.String,​java.lang.Object> getStructureMap​(javajs.util.Lst<java.lang.Object> structureList, java.lang.String type, int index)
      Find the map for a specified structure, producing a structure that can be used to generate lone pairs and bonds for a Lewis structure
      int getStructures​(java.lang.String data, java.lang.String nrtType, javajs.util.Lst<java.lang.Object> list)
      Reads the $NRTSTR $NRTSTRA, $NRTSTRB, and $CHOOSE blocks.
      static void getStructures46​(java.lang.String[] tokens, java.lang.String type, javajs.util.Lst<java.lang.Object> structures, int nAtoms)
      Use the .46 file NBO alpha/beta labels to identify bonds, lone pairs, and lone valences.
      private void getStructuresTOPO​(java.lang.String data, java.lang.String nrtType, javajs.util.Lst<java.lang.Object> list)  
      boolean isOpenShell()  
      NBOParser set​(Viewer vwr)  
      private boolean setJmolLewisStructure​(java.util.Map<java.lang.String,​java.lang.Object> structureMap, int modelIndex, int resNo)
      Starting with a structure map, do what needs to be done to change the current Jmol structure to that in terms of bonding and formal charge.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • haveBeta

        private boolean haveBeta
    • Constructor Detail

      • NBOParser

        public NBOParser()
    • Method Detail

      • getAllStructures

        public javajs.util.Lst<java.lang.Object> getAllStructures​(java.lang.String output,
                                                                  javajs.util.Lst<java.lang.Object> list)
      • getBlock

        private java.lang.String getBlock​(java.lang.String output,
                                          java.lang.String key)
      • getStructures46

        public static void getStructures46​(java.lang.String[] tokens,
                                           java.lang.String type,
                                           javajs.util.Lst<java.lang.Object> structures,
                                           int nAtoms)
        Use the .46 file NBO alpha/beta labels to identify bonds, lone pairs, and lone valences.
        Parameters:
        tokens -
        type -
        structures -
        nAtoms -
      • getAtomIndex

        private static int getAtomIndex​(java.lang.String xx99)
      • getStructuresTOPO

        private void getStructuresTOPO​(java.lang.String data,
                                       java.lang.String nrtType,
                                       javajs.util.Lst<java.lang.Object> list)
      • dumpMatrix

        private static void dumpMatrix​(java.lang.String nrtType,
                                       int index,
                                       int[][] matrix)
      • getData

        private java.lang.String getData​(java.lang.String output,
                                         java.lang.String start,
                                         java.lang.String end,
                                         int n)
      • getStructures

        public int getStructures​(java.lang.String data,
                                 java.lang.String nrtType,
                                 javajs.util.Lst<java.lang.Object> list)
        Reads the $NRTSTR $NRTSTRA, $NRTSTRB, and $CHOOSE blocks. Creates a Lst of Hashtables
        Parameters:
        data - NBO output block not including $END
        nrtType - "CHOOSE", "NRTSTRA", "NRTSTRB"
        list - to fill
        Returns:
        number of structures found or -1 for an error
      • isOpenShell

        public boolean isOpenShell()
      • getStructureMap

        public static java.util.Map<java.lang.String,​java.lang.Object> getStructureMap​(javajs.util.Lst<java.lang.Object> structureList,
                                                                                             java.lang.String type,
                                                                                             int index)
        Find the map for a specified structure, producing a structure that can be used to generate lone pairs and bonds for a Lewis structure
        Parameters:
        structureList - a list of structural information from this class created from an NBO file
        type - topoa, topob, nrtstra, nrtstrb, alpha, beta -- last two are from CHOOSE
        index - 0-based index for this type
        Returns:
        Hashtable or null
      • connectNBO

        public boolean connectNBO​(int modelIndex,
                                  java.lang.String type)
        Parameters:
        modelIndex -
        type - one of alpha|beta|choosea|chooseb|nrtstr_n|nrtstra_n|topo_n|topoa_n| topob_n
        Returns:
        true if successful
      • setJmolLewisStructure

        private boolean setJmolLewisStructure​(java.util.Map<java.lang.String,​java.lang.Object> structureMap,
                                              int modelIndex,
                                              int resNo)
        Starting with a structure map, do what needs to be done to change the current Jmol structure to that in terms of bonding and formal charge. Three map configurations are supported: bond/lone/3c data from $CHOOSE or $NRTSTR, $NRTSTRA, or $NRTSTRB matrix from TOPO map of atom names from the .46 file NBO alpha/beta lists
        Parameters:
        structureMap -
        modelIndex -
        resNo -
        Returns:
        true if successful
      • getNBOAtomLabel

        public java.lang.String getNBOAtomLabel​(Atom a)
        get the
        Parameters:
        a -
        Returns:
        label including (lp), (lv), and (if not open-spin) formal charge