float x = parseFloat(line, 16, 31);
float y = parseFloat(line, 31, 46);
float z = parseFloat(line, 46, 61);
if (Float.isNaN(x) || Float.isNaN(y) || Float.isNaN(z))
break;
Atom atom = atomSetCollection.addNewAtom();
atom.set(x, y, z);
atom.elementSymbol = getElementSymbol(parseInt(line.substring(11, 14)));
atom.atomName = atom.elementSymbol + (++n);
atomNames.add(atomName);
}
/*
During optimization, this will immediately appear after the
ab initio molecule
COORDINATES OF FRAGMENT MULTIPOLE CENTERS (ANGS)
MULTIPOLE NAME X Y Z
------------------------------------------------------------
FRAGNAME=H2ORHF
ZO1 -4.1459482636 0.4271933699 0.0417242924
ZH2 -3.4514529072 1.0596960013 -0.0504444399
ZH3 -4.5252917848 0.5632659571 0.8952236761
or for H2ODFT
COORDINATES OF FRAGMENT MULTIPOLE CENTERS (ANGS)
MULTIPOLE NAME X Y Z
------------------------------------------------------------
FRAGNAME=H2ODFT
O1 3.5571448937 -2.1158335714 -0.0044768463
H2 3.9520351868 -2.4002052098 -0.8132245708
H3 3.7885802785 -1.2074436330 0.1057222304
*/
// Now is the time to read Effective Fragments (EFP)
if (line.indexOf("COORDINATES OF FRAGMENT MULTIPOLE CENTERS (ANGS)") >= 0) {
readLine(); // MULTIPONE NAME X ...
readLine(); // ------------------------ ...
readLine(); // FRAGNAME=
//at least for FRAGNAME=H2ORHF, the atoms come out as ZO1, ZH2, ZH3
while (readLine() != null
&& (atomName = parseToken(line, 1, 2)) != null) {
if (parseToken(line,1,2).equals("Z")) //Z means nuclear position
atomName = parseToken(line, 2, 3);
else if (parseToken(line,1,9).equals("FRAGNAME"))//Z is a deprecated requirement
continue;
else
atomName = parseToken(line, 1, 2);
float x = parseFloat(line, 16, 31);
float y = parseFloat(line, 31, 46);
float z = parseFloat(line, 46, 61);
if (Float.isNaN(x) || Float.isNaN(y) || Float.isNaN(z))
break;
Atom atom = atomSetCollection.addNewAtom();
atom.atomName = atomName + (++n);
atom.set(x, y, z);
atomNames.add(atomName);
}
}
}