Piere,
Something like that. See if you can't fit it into the general pattern of
those files. I think of all of them, the Wien2kReader is probably the most
straightforward.
On Thu, Feb 11, 2010 at 12:40 PM, P.Canepa <pc...@kent.ac.uk> wrote:
> HI Bob,
>
> 1) when I want to read cell parameter a b c ... from formatted output, like
> that you see below, could something like this work ?
>
> do{
> readLine();
> if(line.startsWith("PRIMITIVE CELL")){
> readLine();
> readLine();
> readLine();
> a = parseFloat(line.substring(0,17)) ;
> b = parseFloat(line.substring(18,33)) ;
> c = parseFloat(line.substring(34,42)) ;
> alpha = parseFloat(line.substring(43,60)) ;
> beta = parseFloat(line.substring(61,71)) ;
> gamma = parseFloat(line.substring(72,82)) ;
>
> setUnitCell(a, b, c, alpha, beta, gamma);
> break;
> }
> }while (line == null);
>
>
Not sure why you would want to loop only while the line is null. In fact,
that won't work because if line == null, then line.StartsWith... will throw
an error.
Have you figured out how to put in breakpoints and step through the code
using the debugger? That's essential.
> 2) is the method setAtomCoord(atom, x, y, z); which input atom by atom?
yes. You create a new atom, add properties, then do that. Make sure you have
told Jmol if these are fractional coordinates or not.
> Jmol likes atomic numbers or atomic Symbols?
>
You can use either. In AtomSetCollection you will find:
public String getElementSymbol() {
if (elementSymbol == null)
if (atomName != null) {
int len = atomName.length();
int ichFirst = 0;
char chFirst = 0;
while (ichFirst < len &&
!isValidFirstSymbolChar(chFirst = atomName.charAt(ichFirst)))
++ichFirst;
switch(len - ichFirst) {
case 0:
break;
default:
char chSecond = atomName.charAt(ichFirst + 1);
if (isValidElementSymbolNoCaseSecondChar(chFirst, chSecond)) {
elementSymbol = "" + chFirst + chSecond;
break;
}
// fall into
case 1:
if (isValidElementSymbol(chFirst))
elementSymbol = "" + chFirst;
break;
}
}
return elementSymbol;
}
This is used by the ModelLoader class to get the element symbol from what
you have indicated in the reader as either the element symbol or the atomic
number.
Bob
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers