From: <ha...@us...> - 2010-12-22 13:39:22
|
Revision: 14864 http://jmol.svn.sourceforge.net/jmol/?rev=14864&view=rev Author: hansonr Date: 2010-12-22 13:39:15 +0000 (Wed, 22 Dec 2010) Log Message: ----------- Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/readers/xtal/GulpReader.java Modified: trunk/Jmol/src/org/jmol/adapter/readers/xtal/GulpReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/readers/xtal/GulpReader.java 2010-12-22 13:31:48 UTC (rev 14863) +++ trunk/Jmol/src/org/jmol/adapter/readers/xtal/GulpReader.java 2010-12-22 13:39:15 UTC (rev 14864) @@ -55,6 +55,10 @@ readCellParameters(); return true; } + if (line.contains("Monopole - monopole (total)")) { + readEnergy(); + return true; + } if (line.contains("Fractional coordinates of asymmetric unit :") || line.contains("Final asymmetric unit coordinates") @@ -76,10 +80,6 @@ readFinalCell(); return true; } - if (line.contains("Monopole - monopole (total)")) { - readEnergy(); - return true; - } //if (line.contains(" Phonon Calculation : ")) { // readFrequency(); @@ -149,18 +149,16 @@ private void newAtomSet(boolean doSetUnitCell) { atomSetCollection.newAtomSet(); if (doSetUnitCell) - setUnitCell(); + setModelParameters(); } - private void setUnitCell() { + private void setModelParameters() { setSpaceGroupName(spaceGroup); - if (a == 0 && primitiveData == null) - return; - if (a == 0) { + if (primitiveData != null) { addPrimitiveLatticeVector(0, primitiveData, 0); addPrimitiveLatticeVector(1, primitiveData, 3); addPrimitiveLatticeVector(2, primitiveData, 6); - } else { + } else if (a != 0) { if (isSlab) { c = -1; if (beta == 0) @@ -171,6 +169,8 @@ } setUnitCell(a, b, c, alpha, beta, gamma); } + if (totEnergy != null) + setEnergy(); } /* @@ -226,7 +226,7 @@ String tokens[]; while (readLine() != null && (tokens = getTokens()).length >= 2) setParameter(tokens[0], parseFloat(tokens[1])); - setUnitCell(); + setModelParameters(); applySymmetryAndSetTrajectory(); } @@ -328,7 +328,6 @@ totEnergy = Double.valueOf(Double.parseDouble(tokens[1])); energyUnits = tokens[2]; discardLinesUntilContains(sep); - setEnergy(); } private void setEnergy() { @@ -336,6 +335,7 @@ atomSetCollection.setAtomSetAuxiliaryInfo("Energy", totEnergy); atomSetCollection.setAtomSetCollectionAuxiliaryInfo("Energy", totEnergy); atomSetCollection.setAtomSetName("E = " + totEnergy + " " + energyUnits); + totEnergy = null; } /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |