Class MagresReader

java.lang.Object
org.jmol.adapter.smarter.AtomSetCollectionReader
org.jmol.adapter.readers.xtal.MagresReader
All Implemented Interfaces:
javajs.api.GenericLineReader

public class MagresReader extends AtomSetCollectionReader
  • Field Details

    • BLOCK_NEW

      private static final int BLOCK_NEW
      See Also:
    • BLOCK_NONE

      private static final int BLOCK_NONE
      See Also:
    • BLOCK_CALC

      private static final int BLOCK_CALC
      See Also:
    • BLOCK_ATOMS

      private static final int BLOCK_ATOMS
      See Also:
    • BLOCK_MAGRES

      private static final int BLOCK_MAGRES
      See Also:
    • currentBlock

      private int currentBlock
    • cellParams

      private float[] cellParams
    • magresUnits

      private Map<String,String> magresUnits
    • interactionTensors

      private javajs.util.Lst<Tensor> interactionTensors
  • Constructor Details

    • MagresReader

      public MagresReader()
  • Method Details

    • initializeReader

      protected void initializeReader()
      not sure how to work with symmetry here...
      Overrides:
      initializeReader in class AtomSetCollectionReader
    • finalizeSubclassReader

      protected void finalizeSubclassReader() throws 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:
      Exception
    • checkLine

      protected boolean checkLine() throws 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:
      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 Exception
      Returns:
      true;
      Throws:
      Exception
    • readAtom

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

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

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