Share

Jmol

Tracker: Patches

5 file reader for CASTEP and AIMS input files - ID: 2841139
Last Update: Comment added ( hansonr )

I have added two readers for input files, which make use of the periodic
boundary conditions (PBC) infrastructure of Jmol
- CASTEP: http://www.castep.org (.cell files - only PBC)
- FHI-aims: http://www.fhi-berlin.mpg.de/aims/ (geometry.in files - both
cluster models and PBCs)
Using the signed applet, the readers can be tried here
http://w3.rz-berlin.mpg.de/~meyer/jmol-demo-20090819/


Joerg Meyer ( j-meyer ) - 2009-08-20 14:41

5

Open

None

Nobody/Anonymous

File IO

None

Public


Comments ( 13 )

Date: 2009-11-11 15:00
Sender: hansonrProject Admin

ok, that's in for Jmol 11.9.10 and 11.8.9 -- please check those.
Additional features should be introduced to Jmol 11.9.10 only, not 11.8.9,
please.


Date: 2009-11-07 16:59
Sender: j-meyer

I haven't given up on producing "CASTEP-CML", but the FoX libraries
(underlying XML engine) make some trouble with the available Fortran
compilers. Perhaps I need to start playing on another platform, but (again
and unfortunately) no time for that.
On the AIMS side I have added support for reading charges used for
electrostatic embedding
as given in "multipole" lines - see latest attached patch. Hope adding
that keyword to Resolver.java does not break other readers again...


Date: 2009-09-18 15:28
Sender: j-meyer

Sorry, still no time for wurtzite.cml. But at least AIMS and CASTEP readers
now correctly display the cell contents of cells which are not 'properly'
(i.e. the way Jmol expects that internally) aligned with the reference
coordinate system.


Date: 2009-09-06 19:50
Sender: hansonrProject Admin

Joerg, I need some help. I've added a file wurtzite.cml that appears to
have been created using CASTEP. The problem is in the transform3 fields.
These are the symmetry operations. Except the matricies appear to be
operating on Cartesian coordinates, not unit cell fractional coordintates.
This is very odd! I can't directly use these matrices to build symmetry
operations.

Q: Is this a file format you can produce with CASTEP?
Q: If so, can you get me some examples from other space groups -- in
particular monclinic and orthorhombic/tetragonal. I need to see what the
matrix looks like in those cases. Best would be some examples both in CIF
format and this CML format to compare.
Q: Do you know who knows how to properly work with these matrices?


Date: 2009-09-03 23:48
Sender: hansonrProject Admin

Here is what I settled on:

private static boolean checkAims(String[] lines) {

// use same tokenizing mechanism as in AimsReader.java to also
recognize
// AIMS geometry files with indented keywords
// "atom" is a VERY generic term; just "atom" breaks HIN reader.
for (int i = 0; i < lines.length; i++) {
String[] tokens = Parser.getTokens(lines[i]);
if (tokens.length == 5 && tokens[0].startsWith("atom")
|| tokens.length == 4 &&
tokens[0].startsWith("lattice_vector"))
return true;
}
return false;
}



Date: 2009-09-03 23:37
Sender: hansonrProject Admin

If the AIMS format is not finalized, I would like to suggest that it be
modified (I realize that could be a big deal) to
a) allow for comments in the form
#....
b) have a unique identifier such as

# FHI-AIMS (http://www.fhi-berlin.mpg.de/aims)

at the top.



Date: 2009-08-25 17:07
Sender: j-meyer

Just noticed that revision 11359 compiles nicely with sun-jdk-1.6.0_15-b03
(64bit)
including changes below, but crashes even without changes below (!) when
trying
to run java -jar Jmol.jar:

uncaught exception: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
at org.jmol.viewer.StateManager.<clinit>(StateManager.java:487)
at org.jmol.viewer.Viewer.<init>(Viewer.java:248)
at org.jmol.viewer.Viewer.allocateViewer(Viewer.java:310)
at org.jmol.api.JmolViewer.allocateViewer(JmolViewer.java:90)
at
org.openscience.jmol.app.jmolpanel.JmolPanel.<init>(JmolPanel.java:150)
at org.openscience.jmol.app.Jmol.<init>(Jmol.java:36)
at
org.openscience.jmol.app.jmolpanel.JmolPanel.getJmol(JmolPanel.java:358)
at
org.openscience.jmol.app.jmolpanel.JmolPanel.startJmol(JmolPanel.java:293)
at org.openscience.jmol.app.Jmol.main(Jmol.java:41)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of
range: 23
at java.lang.String.substring(String.java:1934)
at org.jmol.viewer.JmolConstants.<clinit>(JmolConstants.java:80)
... 9 more
Exception in thread "main" java.lang.NullPointerException
at
org.openscience.jmol.app.jmolpanel.JmolPanel.startJmol(JmolPanel.java:304)
at org.openscience.jmol.app.Jmol.main(Jmol.java:41)

Hence changes are untested!


Date: 2009-08-25 17:00
Sender: j-meyer

1.) Based on the files you checked into 11.8, I added some comments at the
top
as requested and did some further changes as detailed in the following.
Resulting files
CastepReader.20090825.java
AimsReader.20090825.java
are attached.

2.) Strange - for some reason it seemed to work in 11.6.
Looking at your change (which makes perfect sense to avoid the warning)
I wonder why it actually does...

3.) I see your point. There are no official specs (yet) for FHI-aims
geometry.in files.
The code is written in Fortran, and hence you can easily exchange the tabs
for spaces
without the Fortran IO system (in list mode) bothering. In fact I just
convinced myself
that both "atom" and "lattice_vector" keywords must be lower case to be
accepted by
aims. To eliminate the collision with PBD, could you please change the
checkAims
method in Resolver.java accordingly, to e.g.

// FHI-aims only accepts keywords which are lower case -
// hence no conflict with PDB reader (which require upper case
"ATOM")
if ( tokens[0].startsWith("atom") ) return true;
if ( tokens[0].startsWith("lattice_vector") ) return true;



Date: 2009-08-25 14:05
Sender: hansonrProject Admin

The proposed AIMS reader breaks PDB format. We can't allow "atom" to be a
marker, because "ATOM" is a marker for PDB files. So, if you want to read
these files, you must force the filetype using

load "aims::xxxx.in"

I can't find specs for that file type. Why are there tabs in the line? Can
we specify that "atom" must be lower case? (PDB must be upper case ATOM)


Date: 2009-08-24 16:11
Sender: hansonrProject Admin

%BLOCK POSITIONS_ABS
ang

was causing a warning -- I've changed that. Please check out the 11.8.RC6
code that I have just checked in and work from that if you can now.


Date: 2009-08-24 15:36
Sender: hansonrProject Admin

OK, I'm onto this. Please provide some comment text with http references,
for example:

/**
* Gaussian cube file format
*
* http://www.cup.uni-muenchen.de/oc/zipse/lv18099/orb_MOLDEN.html
* this is good because it is source code
* http://ftp.ccl.net/cca/software/SOURCES/C/scarecrow/gcube2plt.c
*
*
http://www.nersc.gov/nusers/resources/software/apps/chemistry/gaussian/g98/00000430.htm
*
* distances are in Bohrs because we are reading Gaussian cube OUTPUT
files
* not Gaussian cube INPUT files.
*
* Miguel 2005 07 17
* a negative atom count means
* that it is molecular orbital (MO) data
* with MO data, the extra line contains the number
* of orbitals and the orbital number
*
* these orbitals are interspersed -- all orbital values are
* given together for each coordinate point.
*
* also used for JVXL and JVXL+ file format
*
*/



Date: 2009-08-24 11:59
Sender: j-meyer

Sorry - haven't thought about the fact that patch components
against empty files cannot be conveniently extracted when
trying to modify your current development version - I just
wanted to have the functionality added to a stable release
(which will be available from the AIMS web page quite soon).


Date: 2009-08-23 05:51
Sender: hansonrProject Admin

Please send the .java files; I have to patch these into 11.8, not 11.6.
Thanks.


Attached Files ( 12 )

Filename Description Download
jmol-11.6.27-CASTEP_AIMS_reader-20090819.diff patch against Jmol-11.6.27 Download
CASTEP.cell sample CASTEP .cell file Download
FHI-aims-cluster-geometry.in sample FHI-aims geometry.in file (cluster) Download
FHI-aims-pbc-geometry.in sample FHI-aims geometry.in file (periodic boundary conditions) Download
AimsReader.java to be added under "src/org/jmol/adapter/readers/more" ? Download
CastepReader.java to be added in "src/org/jmol/adapter/readers/more" Download
Resolver.java includes chnages for AIMS and CASTEP readers, based on 11.6.27 Download
CastepReader.20090825.java version 1.1: added comments Download
AimsReader.20090825.java version 1.1: added comments and changed to lower case keywords Download
wurtzite.cml CASTEP-generated CML file Download
jmol-11.8.5jm-patch_20090918-AIMS_CASTEP_readers_1.2.diff versions 1.2 of AIMS and CASTEP readers, based on 11.8.5 Download
jmol-11.8.8jm-patch_20091107-AIMS_CASTEP_readers_1.2_with_multipole_support.diff versions 1.2 of AIMS (with multipole support added) and CASTEP readers, based on 11.8.8 Download

Changes ( 12 )

Field Old Value Date By
File Added 349925: jmol-11.8.8jm-patch_20091107-AIMS_CASTEP_readers_1.2_with_multipole_support.diff 2009-11-07 16:52 j-meyer
File Added 343501: jmol-11.8.5jm-patch_20090918-AIMS_CASTEP_readers_1.2.diff 2009-09-18 15:25 j-meyer
File Added 341977: wurtzite.cml 2009-09-06 19:44 hansonr
File Added 340503: AimsReader.20090825.java 2009-08-25 17:02 j-meyer
File Added 340501: CastepReader.20090825.java 2009-08-25 17:02 j-meyer
File Added 340325: Resolver.java 2009-08-24 10:39 j-meyer
File Added 340324: CastepReader.java 2009-08-24 10:38 j-meyer
File Added 340323: AimsReader.java 2009-08-24 10:37 j-meyer
File Added 339934: FHI-aims-pbc-geometry.in 2009-08-20 14:43 j-meyer
File Added 339933: FHI-aims-cluster-geometry.in 2009-08-20 14:43 j-meyer
File Added 339932: CASTEP.cell 2009-08-20 14:42 j-meyer
File Added 339931: jmol-11.6.27-CASTEP_AIMS_reader-20090819.diff 2009-08-20 14:41 j-meyer