[Jmol-developers] ADFReader AtomType

2017-07-03 Thread Georg Eickerling
Dear all,

this is some kind of feature addon for the Jmol filters:

The ADF filter obviously assumes all element symbols to be simple
strings. This is not always true following the ADF user guide

https://www.scm.com/doc.2016/ADF/Input/Atomic_coordinates.html?highlight=atoms

 were "atom types" are

***
AtomType

The name of an atom type. It must begin with the standard one- or
two-character symbol for the chemical element (e.g. H, He, Li,...).
Optionally it may be appended by .text, where text is any string (not
containing delimiters). Examples: H, Mn.3, Cu.dz-new.
***

This feature is for example used in NMR coupling calculations when
re-defining special basis sets for some of the coupling atoms.

At the moment, the jmol parser apparently simply ignores atoms with
names such as "H.b" so they are just lacking in the final structure. I
suggest the following one line fix:

ADFReader.java

starting from line 159:

while (rd() != null && !line.startsWith(" -")) {
  tokens = getTokens();
  if (tokens.length < 5)
break;
  String symbol = tokens[1];
  /* +ADD THIS++ */
  if(symbol.contains("."))
  {
symbol = symbol.split("\\.")[0];
  }
  /* +ADD THIS++ */
  if (JmolAdapter.getElementNumber(symbol) < 1)
nXX++;
  else
addAtomXYZSymName(tokens, pt0, symbol, null);
}

This will just split off the things after the period and proceed with
the element symbol as usual and works for me on my local files with
"H.b" atoms.


best

Georg










-- 
~~~
 PD Dr. Georg Eickerling
 Universität Augsburg
 Institut für Physik
 Lehrstuhl für Chemische Physik und Materialwissenschaften
 ~~~

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


Re: [Jmol-developers] CrystalReader and external pressure

2015-07-08 Thread Georg Eickerling
Bob, I just want to confirm that it indeed works and 
thank you for the ultra-fast reply/fix!

cheers

Georg


--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers


[Jmol-developers] CrystalReader and external pressure

2015-07-07 Thread Georg Eickerling
Dear all,

this is a feature request for the CrystalReader of jmol. When doing
optimizations employing external pressure with CRYSTAL, the output contains
some additional lines starting with the string TOTAL ENERGY which jmol can
not cope with at the moment:


TOTAL ENERGY CORRECTED: EXTERNAL STRESS CONTRIBUTION =0.944E+00 

TOTAL ENERGY(DFT)(AU)( 27) -1.2874392471314E+04 DE (AU)   -5.323E-04

jmol does this ATM in src/org/jmol/adapter/readers/xtal/CrystalReader.java

line 239:

if (line.startsWith( TOTAL ENERGY)) {
  readEnergy();
  rd();
  if (line.startsWith( ))
discardLinesUntilContains(SYMMETRY ALLOWED);
  else if (line.startsWith( ))
discardLinesUntilContains2(PREDICTED ENERGY CHANGE, HHH);
  return true;
}


This will crash if the first of the above lines is present in addition to the
second as most likely readEnergy can not parse the EXTERNAL STRESS stuff. 

I am completely illiterate when it comes to java and even fail to build jmol
from the src using ant on Debian Jessie, so unfortunately I can not provide the
required 2-line fix to simply skip all the EXTERNAL STRESS lines in this case.

regards

Georg



pgpxl8Ly5qy45.pgp
Description: Digitale Signatur von OpenPGP
--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/___
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers