Revision: 20151
          http://sourceforge.net/p/jmol/code/20151
Author:   hansonr
Date:     2014-12-02 02:52:04 +0000 (Tue, 02 Dec 2014)
Log Message:
-----------
Jmol.___JmolVersion="14.3.11_2014.12.01"

bug fix: incommensurate magnetic CIF reading does not apply magnetic spin 
operation to spin modulations
bug fix: CIF reader can cycle infinitely if loop_ keywords are not followed by 
any data

Modified Paths:
--------------
    trunk/Jmol/src/javajs/util/CifDataParser.java
    trunk/Jmol/src/org/jmol/symmetry/SpaceGroup.java
    trunk/Jmol/src/org/jmol/symmetry/SymmetryDesc.java
    trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java
    trunk/Jmol/src/org/jmol/util/ModulationSet.java
    trunk/Jmol/src/org/jmol/viewer/Jmol.properties

Modified: trunk/Jmol/src/javajs/util/CifDataParser.java
===================================================================
--- trunk/Jmol/src/javajs/util/CifDataParser.java       2014-11-28 22:52:14 UTC 
(rev 20150)
+++ trunk/Jmol/src/javajs/util/CifDataParser.java       2014-12-02 02:52:04 UTC 
(rev 20151)
@@ -263,7 +263,7 @@
     for (int i = 0; i < fieldCount; ++i)
       if ((loopData[i] = getNextDataToken()) == null)
         return false;
-    return true;
+    return (fieldCount > 0);
   }
 
   /**

Modified: trunk/Jmol/src/org/jmol/symmetry/SpaceGroup.java
===================================================================
--- trunk/Jmol/src/org/jmol/symmetry/SpaceGroup.java    2014-11-28 22:52:14 UTC 
(rev 20150)
+++ trunk/Jmol/src/org/jmol/symmetry/SpaceGroup.java    2014-12-02 02:52:04 UTC 
(rev 20151)
@@ -112,7 +112,7 @@
 
   boolean doNormalize = true;
 
-  public boolean isBio;
+  boolean isBio;
 
   boolean isBilbao;
 
@@ -1449,7 +1449,7 @@
     "230;oh^10;i a -3 d;-i 4bd 2c 3",  
   };
   
-  public boolean addLatticeVectors(Lst<float[]> lattvecs) {
+  boolean addLatticeVectors(Lst<float[]> lattvecs) {
     if (latticeOp >= 0 || lattvecs.size() == 0)
       return false;
     int nOps = latticeOp = operationCount;
@@ -1479,7 +1479,7 @@
     return true;
   }
 
-  public int getSiteMultiplicity(P3 pt, UnitCell unitCell) {
+  int getSiteMultiplicity(P3 pt, UnitCell unitCell) {
     int n = finalOperations.length;
     Lst<P3> pts = new Lst<P3>();
     for (int i = n; --i >= 0;) {

Modified: trunk/Jmol/src/org/jmol/symmetry/SymmetryDesc.java
===================================================================
--- trunk/Jmol/src/org/jmol/symmetry/SymmetryDesc.java  2014-11-28 22:52:14 UTC 
(rev 20150)
+++ trunk/Jmol/src/org/jmol/symmetry/SymmetryDesc.java  2014-12-02 02:52:04 UTC 
(rev 20151)
@@ -484,7 +484,7 @@
       draw1
           .append(
               ("// " + op.xyzOriginal + "|" + xyzNew + "|" + info1).replace(
-                  '\n', ' ')).append("\n").append(drawid).append("* delete");
+                  '\n', ' ')).appendC('\n').append(drawid).append("* delete");
 
       // draw the initial frame
 
@@ -957,12 +957,12 @@
       if (sb.length() > 0)
         sb.appendC('\n');
       if (prettyMat) {
-        sb.append(SymmetryOperation.cleanMatrix((M4) infolist[i][10])).append(
-            "\t");
+        SymmetryOperation.getPrettyMatrix(sb, (M4) infolist[i][10]);
+        sb.appendC('\t');
       } else if (!labelOnly) {
         if (symOp < 0)
-          sb.appendI(i + 1).append("\t");
-        sb.append((String) infolist[i][0]).append("\t"); //xyz
+          sb.appendI(i + 1).appendC('\t');
+        sb.append((String) infolist[i][0]).appendC('\t'); //xyz
       }
       sb.append((String) infolist[i][2]); //desc
     }

Modified: trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java
===================================================================
--- trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java     2014-11-28 
22:52:14 UTC (rev 20150)
+++ trunk/Jmol/src/org/jmol/symmetry/SymmetryOperation.java     2014-12-02 
02:52:04 UTC (rev 20151)
@@ -77,7 +77,7 @@
   private Matrix sigma;
   int index;
   String subsystemCode;
-  public int timeReversal;
+  int timeReversal;
   
   void setSigma(String subsystemCode, Matrix sigma) {
     this.subsystemCode = subsystemCode;
@@ -668,13 +668,13 @@
     return PT.approx(f, 100);
   }
 
-  public static void normalizeTranslation(M4 operation) {
+  static void normalizeTranslation(M4 operation) {
     operation.m03 = ((int)operation.m03 + 12) % 12;
     operation.m13 = ((int)operation.m13 + 12) % 12;
     operation.m23 = ((int)operation.m23 + 12) % 12;    
   }
 
-  public static String getXYZFromRsVs(Matrix rs, Matrix vs, boolean is12ths) {
+  static String getXYZFromRsVs(Matrix rs, Matrix vs, boolean is12ths) {
     double[][] ra = rs.getArray();
     double[][] va = vs.getArray();
     int d = ra.length;
@@ -697,33 +697,47 @@
     return (rsvs == null ? super.toString() : super.toString() + " " + 
rsvs.toString());
   }
 
-  float magOp = Float.MAX_VALUE;
+  private boolean unCentered;
   boolean isCenteringOp;
-  private boolean unCentered;
-  public float getSpinOp() {
+
+  private float magOp = Float.MAX_VALUE;
+  /**
+   * Magnetic spin operations have a flag m=1 or m=-1 (m or -m)
+   * that indicates how the vector quantity changes with symmetry.
+   * This we call "timeReversal." 
+   * 
+   * To apply, timeReversal must be multiplied by the 3x3 determinant, which
+   * is always 1 (standard rotation) or -1 (rotation-inversion). This we store
+   * as magOp. 
+   * 
+   * For example, a vector perpendicular to a plane of symmetry (det=-1) will 
be
+   * flipped (m=1), while a vector parallel to that plane will not be flipped 
(m=-1)
+   * 
+   * @return +1, -1, or 0
+   */
+  float getSpinOp() {
     if (magOp == Float.MAX_VALUE)
       magOp = determinant3() * timeReversal;
     //System.out.println("sym op " + index + " " + xyz + " has tr " + 
timeReversal + " and magop " + magOp);
     return magOp;
   }
 
-  public void setTimeReversal(int magRev) {
+  void setTimeReversal(int magRev) {
     timeReversal = magRev;
     if (xyz.indexOf("m") >= 0)
       xyz = xyz.substring(0, xyz.indexOf("m"));
     xyz += (magRev == 1 ? ",m" : magRev == -1 ? ",-m" : "");
   }
 
-  public static String cleanMatrix(M4 m4) {
-    SB sb = new SB();
+  static String getPrettyMatrix(SB sb, M4 m4) {
     sb.append("[ ");
     float[] row = new float[4];
     for (int i = 0; i < 3; i++) {
       m4.getRow(i, row);
       sb.append("[ ")
-        .appendI((int)row[0]).append(" ")
-        .appendI((int)row[1]).append(" ")
-        .appendI((int)row[2]).append(" ");      
+        .appendI((int)row[0]).appendC(' ')
+        .appendI((int)row[1]).appendC(' ')
+        .appendI((int)row[2]).appendC(' ');      
       sb.append(twelfthsOf(row[3]*12)).append(" ]");
     }
     return sb.append(" ]").toString();
@@ -737,7 +751,7 @@
    *        TODO
    * @return centering
    */
-  public V3 setCentering(V3 c, boolean isFinal) {
+  V3 setCentering(V3 c, boolean isFinal) {
     if (centering == null && !unCentered) {
       if (modDim == 0 && index > 1 && m00 == 1 && m11 == 1 && m22 == 1
           && m01 == 0 && m02 == 0 && m10 == 0 && m12 == 0 && m20 == 0

Modified: trunk/Jmol/src/org/jmol/util/ModulationSet.java
===================================================================
--- trunk/Jmol/src/org/jmol/util/ModulationSet.java     2014-11-28 22:52:14 UTC 
(rev 20150)
+++ trunk/Jmol/src/org/jmol/util/ModulationSet.java     2014-12-02 02:52:04 UTC 
(rev 20151)
@@ -61,6 +61,7 @@
 
   private Matrix tFactorInv;
   private Matrix rsvs;
+  private float spinOp;
 
   @Override
   public float getScale() {
@@ -250,6 +251,8 @@
     gammaIinv = rsvs.getSubmatrix(3, 3, d, d).inverse();
     Matrix gammaM = rsvs.getSubmatrix(3, 0, d, 3);
     Matrix sI = rsvs.getSubmatrix(3, 3 + d, d, 1);
+    spinOp = symmetry.getSpinOp(iop);
+    System.out.println("spinOp " + iop + " " + strop + " " + spinOp);
 
     tau = gammaIinv.mul(sigma.mul(vR0).sub(gammaM.mul(vR00)).sub(sI));
 
@@ -322,8 +325,11 @@
       mods.get(i).apply(this, arI);
     // rotate by R3 rotation
     gammaE.rotate(this);
-    if (mxyz != null)
+    if (mxyz != null){
       gammaE.rotate(mxyz);
+      if (spinOp < 0)
+        mxyz.scale(spinOp);
+    }
     return this;
   }
 
@@ -451,6 +457,7 @@
       modTemp = new ModulationSet();
       modTemp.id = id;
       modTemp.tau = tau;
+      modTemp.spinOp = spinOp;
       modTemp.mods = mods;
       modTemp.gammaE = gammaE;
       modTemp.modDim = modDim;

Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties
===================================================================
--- trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2014-11-28 22:52:14 UTC 
(rev 20150)
+++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties      2014-12-02 02:52:04 UTC 
(rev 20151)
@@ -15,8 +15,14 @@
 TODO: design and implement sidechain mutation -- MUTATE command ?
 TODO: remove HTML5 dependency on synchronous file loading (check SCRIPT 
command for problems)
 
-Jmol.___JmolVersion="14.3.11_2014.11.28"
+Jmol.___JmolVersion="14.3.11_2014.12.01"
 
+bug fix: incommensurate magnetic CIF reading does not apply magnetic spin 
operation to spin modulations
+bug fix: CIF reader can cycle infinitely if loop_ keywords are not followed by 
any data
+
+
+JmolVersion="14.3.11_2014.11.28"
+
 new feature: readers for ESS input types: CFILE, VFILE, MOPAC, NWChem, 
Gaussian, GAMESS, Orca, PQS
   -- CFILE and VFILE require CFI:: and VFI:: (or C:: and V::)
   -- MOPAC requires MND::  

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to