Class MagresReader

  • All Implemented Interfaces:
    javajs.api.GenericLineReader

    public class MagresReader
    extends AtomSetCollectionReader
    • Field Detail

      • currentBlock

        private int currentBlock
      • cellParams

        private float[] cellParams
      • magresUnits

        private java.util.Map<java.lang.String,​java.lang.String> magresUnits
      • interactionTensors

        private javajs.util.Lst<Tensor> interactionTensors
      • header

        private javajs.util.SB header
    • Constructor Detail

      • MagresReader

        public MagresReader()
    • Method Detail

      • finalizeSubclassReader

        protected void finalizeSubclassReader()
                                       throws java.lang.Exception
        Set final auxiliary info and symmetry, including "fileHeader", "magresUnits", and "interactionTensors"; note that print getProperty("auxiliaryInfo.models[1].magresUnits") should return a catalog of tensor types.
        Overrides:
        finalizeSubclassReader in class AtomSetCollectionReader
        Throws:
        java.lang.Exception
      • checkLine

        protected boolean checkLine()
                             throws java.lang.Exception
        Valid blocks include [calculation] [atoms] [magres]; all magres entries must be prefaced with a corresponding unit; Use of < > instead of [ ] is allowed.
        Overrides:
        checkLine in class AtomSetCollectionReader
        Returns:
        true to read another line (some readers return false because they have over-read a line)
        Throws:
        java.lang.Exception
      • trimLine

        private boolean trimLine()
        All characters after hash ignored; lines are trimmed.
        Returns:
        true if line has content
      • checkBlock

        private int checkBlock()
        looking for tags here.
        Returns:
        currentBlock if not a tag or BLOCK_NEW otherwise
      • setUnits

        private boolean setUnits​(boolean isMagresBlock)
        catalog units
        Parameters:
        isMagresBlock -
        Returns:
        true
      • readSymmetry

        private boolean readSymmetry()
        not doing anything with this -- P1 assumed
        Returns:
        true
      • readCellParams

        private boolean readCellParams()
                                throws java.lang.Exception
        Returns:
        true;
        Throws:
        java.lang.Exception
      • readAtom

        private boolean readAtom()
        Allowing for BOHR units here; probably unnecessary.
        Returns:
        true
      • getAtomName

        private static java.lang.String getAtomName​(java.lang.String name,
                                                    java.lang.String index)
        combine name and index
        Parameters:
        name -
        index -
        Returns:
        name_index
      • readTensor

        private boolean readTensor()
                            throws java.lang.Exception
        Read a tensor line. Note that a corresponding unit line must have appeared first.
        Returns:
        true;
        Throws:
        java.lang.Exception