Class PWmatReader

  • All Implemented Interfaces:
    javajs.api.GenericLineReader

    public class PWmatReader
    extends AtomSetCollectionReader
    crude PWmat atom.config reader http://pwmatus.com/manual
    Author:
    hansonr
    • Field Detail

      • nAtoms

        private int nAtoms
        The format of pwmat config file specification is now clear, would like to adjust PWmatReader accordingly. The pwmat config file format accommodates conversion from other vendors and their formats. The first line always has number of atoms, before the number, could be spaces. after the number, there could be comments such as "generated from pwmat". Please ignore those comments, only gets the number from the first line. After the first line, there could be comments please ignore till reading of letter lattice or lattice vector. The letters are case non-sensitive. The lattice section consists of 3 lines representing lattice vector. For each line, there could be extra 3 numbers followed, please ignore. Following lattice section, there comes position section. As long as there is "position" case-insensitive leading the line, that is our position section. The position section consists of total lines of total atom number which is the from the first line. The lattice section, following by position section, then there are optional sections. The cue is always the words case-insensitive. After the keywords, following by the total lines of total atom number.
      • haveLattice

        private boolean haveLattice
      • havePositions

        private boolean havePositions
      • haveMagnetic

        private boolean haveMagnetic
      • global3

        private java.lang.String global3
    • Constructor Detail

      • PWmatReader

        public PWmatReader()
    • Method Detail

      • checkLine

        protected boolean checkLine()
                             throws java.lang.Exception
        Overrides:
        checkLine in class AtomSetCollectionReader
        Returns:
        true if need to read new line
        Throws:
        java.lang.Exception
      • readComments

        private void readComments()
      • readUnitCell

        private void readUnitCell()
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • readCoordinates

        private void readCoordinates()
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • readDataBlock

        private boolean readDataBlock​(java.lang.String name)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • trimPWPropertyNameTo

        private java.lang.String trimPWPropertyNameTo​(java.lang.String name,
                                                      java.lang.String chars)
      • readItems

        private void readItems​(java.lang.String name,
                               int offset,
                               float[] values)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setProperties

        private void setProperties​(java.lang.String name,
                                   float[] values,
                                   int n)
      • readVectors

        private void readVectors​(java.lang.String name,
                                 int offset,
                                 boolean haveLine)
                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getLine

        private java.lang.String getLine()
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeComments

        private java.lang.String removeComments()
      • setVectors

        private void setVectors​(java.lang.String name,
                                float[] valuesX,
                                float[] valuesY,
                                float[] valuesZ,
                                int n)