Revision: 18365
          http://sourceforge.net/p/jmol/code/18365
Author:   hansonr
Date:     2013-06-27 07:57:27 +0000 (Thu, 27 Jun 2013)
Log Message:
-----------
___JmolVersion="13.1.17_dev_2013.06.26"

new feature: CASTEP reader filter option q=all

Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/adapter/readers/xtal/CastepReader.java

Modified: trunk/Jmol/src/org/jmol/adapter/readers/xtal/CastepReader.java
===================================================================
--- trunk/Jmol/src/org/jmol/adapter/readers/xtal/CastepReader.java      
2013-06-26 22:26:39 UTC (rev 18364)
+++ trunk/Jmol/src/org/jmol/adapter/readers/xtal/CastepReader.java      
2013-06-27 07:57:27 UTC (rev 18365)
@@ -59,14 +59,18 @@
  * CASTEP (http://www.castep.org) .cell file format relevant section of .cell
  * file are included as comments below
  * 
- * preliminary .castep, .phonon frequency reader -- hans...@stolaf.edu 9/2011 
-- Many
- * thanks to Keith Refson for his assistance with this implementation -- atom's
- * mass is encoded as bfactor -- FILTER options include "q=n" where n is an
- * integer or "q={1/4 1/4 0}" -- for non-simple fractions, you must use the
- * exact form of the wavevector description: -- load "xxx.phonon" FILTER
- * "q=(-0.083333 0.083333 0.500000) -- for simple fractions, you can also just
- * specify SUPERCELL {a b c} where -- the number of cells matches a given
- * wavevector -- SUPERCELL {4 4 1}, for example 
+ * preliminary .castep, .phonon frequency reader 
+ * -- hans...@stolaf.edu 9/2011 
+ * -- Many thanks to Keith Refson for his assistance with this implementation 
+ * -- atom's mass is encoded as bfactor 
+ * -- FILTER options include 
+ *      "q=n" where n is an integer 
+ *      "q={1/4 1/4 0}" 
+ *      "q=ALL"
+ * -- for non-simple fractions, you must use the exact form of the wavevector 
description: 
+ * -- load "xxx.phonon" FILTER "q=(-0.083333 0.083333 0.500000) 
+ * -- for simple fractions, you can also just specify SUPERCELL {a b c} where 
+ *    the number of cells matches a given wavevector  -- SUPERCELL {4 4 1}, 
for example 
  * 
  * note: following was never implemented?
  * 
@@ -103,6 +107,8 @@
 
   private String chargeType = "MULL";
 
+  private boolean isAllQ;
+
   @Override
   public void initializeReader() throws Exception {
     if (filter != null) {
@@ -113,7 +119,8 @@
       }
       filter = filter.replace('(', '{').replace(')', '}');
       filter = TextFormat.simpleReplace(filter, "  ", " ");
-      if (filter.indexOf("{") >= 0)
+      isAllQ = (filter.indexOf("Q=ALL") >= 0);
+      if (!isAllQ && filter.indexOf("{") >= 0)
         setDesiredQpt(filter.substring(filter.indexOf("{")));
       filter = TextFormat.simpleReplace(filter, "-PT", "");
     }
@@ -714,13 +721,13 @@
       fcoord = qtoks;
     else
       fcoord = "{" + fcoord + "}";
-    boolean isOK = false;
+    boolean isOK = isAllQ;
     boolean isSecond = (tokens[1].equals(lastQPt));
     qpt2 = (isSecond ? qpt2 + 1 : 1);
 
     lastQPt = tokens[1];
     //TODO not quite right: can have more than two options. 
-    if (filter != null && checkFilterKey("Q=")) {
+    if (!isOK && filter != null && checkFilterKey("Q=")) {
       // check for an explicit q=n or q={1/4 1/2 1/4}
       if (desiredQpt != null) {
         v.sub2(desiredQpt, qvec);
@@ -757,7 +764,7 @@
       return;
     if (!isOK && (ptSupercell == null) == !isGammaPoint)
       return;
-    if (havePhonons)
+    if (havePhonons && !isAllQ)
       return;
     havePhonons = true;
     String qname = "q=" + lastQPt + " " + fcoord;

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


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to