From: <ha...@us...> - 2011-09-11 11:11:47
|
Revision: 16054 http://jmol.svn.sourceforge.net/jmol/?rev=16054&view=rev Author: hansonr Date: 2011-09-11 11:11:40 +0000 (Sun, 11 Sep 2011) Log Message: ----------- Castep reader phonon Modified Paths: -------------- trunk/Jmol/src/org/jmol/adapter/readers/xtal/CastepReader.java trunk/Jmol/src/org/jmol/api/SymmetryInterface.java trunk/Jmol/src/org/jmol/symmetry/Symmetry.java trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java Modified: trunk/Jmol/src/org/jmol/adapter/readers/xtal/CastepReader.java =================================================================== --- trunk/Jmol/src/org/jmol/adapter/readers/xtal/CastepReader.java 2011-09-10 22:06:50 UTC (rev 16053) +++ trunk/Jmol/src/org/jmol/adapter/readers/xtal/CastepReader.java 2011-09-11 11:11:40 UTC (rev 16054) @@ -390,8 +390,13 @@ private Point3f[] atomPts; + private String lastQPt; + private void readPhononFrequencies() throws Exception { String[] tokens = getTokens(); + if (tokens[1].equals(lastQPt)) + return; + lastQPt = tokens[1]; Vector3f qvec = new Vector3f(parseFloat(tokens[2]), parseFloat(tokens[3]), parseFloat(tokens[4])); boolean isGammaPoint = (qvec.length() == 0); @@ -416,6 +421,7 @@ return; havePhonons = true; applySymmetryAndSetTrajectory(); + String qname = "q-pt=" + lastQPt + " (" + getSymmetry().fcoord(qvec) + ")"; if (isGammaPoint) qvec = null; List<Float> freqs = new ArrayList<Float>(); @@ -427,6 +433,7 @@ int frequencyCount = freqs.size(); float[] data = new float[8]; Vector3f v = new Vector3f(); + atomSetCollection.setCollectionName(qname); for (int i = 0; i < frequencyCount; i++) { if (!doGetVibration(++vibrationNumber)) { for (int j = 0; j < atomCount; j++) @@ -441,7 +448,7 @@ float freq = freqs.get(i).floatValue(); atomSetCollection.setAtomSetFrequency(null, null, "" + freq, null); atomSetCollection.setAtomSetName(TextFormat.formatDecimal(freq, 2) - + " cm-1"); + + " cm-1 " + qname); Atom[] atoms = atomSetCollection.getAtoms(); int aCount = atomSetCollection.getAtomCount(); for (int j = 0; j < atomCount; j++) { Modified: trunk/Jmol/src/org/jmol/api/SymmetryInterface.java =================================================================== --- trunk/Jmol/src/org/jmol/api/SymmetryInterface.java 2011-09-10 22:06:50 UTC (rev 16053) +++ trunk/Jmol/src/org/jmol/api/SymmetryInterface.java 2011-09-11 11:11:40 UTC (rev 16054) @@ -7,6 +7,7 @@ import javax.vecmath.Matrix4f; import javax.vecmath.Point3f; import javax.vecmath.Point3i; +import javax.vecmath.Tuple3f; import javax.vecmath.Vector3f; import org.jmol.modelset.Atom; @@ -148,4 +149,6 @@ public abstract Point3f getFractionalOffset(); + public abstract String fcoord(Tuple3f p); + } Modified: trunk/Jmol/src/org/jmol/symmetry/Symmetry.java =================================================================== --- trunk/Jmol/src/org/jmol/symmetry/Symmetry.java 2011-09-10 22:06:50 UTC (rev 16053) +++ trunk/Jmol/src/org/jmol/symmetry/Symmetry.java 2011-09-11 11:11:40 UTC (rev 16054) @@ -32,6 +32,7 @@ import javax.vecmath.Matrix4f; import javax.vecmath.Point3f; import javax.vecmath.Point3i; +import javax.vecmath.Tuple3f; import javax.vecmath.Vector3f; import org.jmol.api.SymmetryInterface; @@ -375,4 +376,8 @@ iRange, jRange, kRange, ptOffset)); } + public String fcoord(Tuple3f p) { + return SymmetryOperation.fcoord(p); + } + } Modified: trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java =================================================================== --- trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java 2011-09-10 22:06:50 UTC (rev 16053) +++ trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java 2011-09-11 11:11:40 UTC (rev 16054) @@ -1177,7 +1177,7 @@ .append(" color ").append(color); } - private static String fcoord(Tuple3f p) { + static String fcoord(Tuple3f p) { return fc(p.x) + " " + fc(p.y) + " " + fc(p.z); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |