Hello, actually the nwchem manual says: "If the tag begins with characters that cannot be matched against an atom, and those characters are not BQ or X, then a fatal error is generated. "
Please find attached some code that obeys the logic: compare the two letter prefix of tag with (chemical symbol | bq) or compare the one letter prefix of tag with (chemical symbol | x) or error. The following points are pending, mostly because I do not know openbabel habits: 1. what to do of bq,x? I put atno=0 2. how to silence the failing attempts to match 2 letter prefix against table symbols. 3. what to do when no match? Fulvio From: Michael Banck <mba...@gmx.net> Subject: Re: [OpenBabel-Devel] nwchem (nwo) parsing bug Date: Wed, 16 Oct 2013 23:31:12 +0200 > Hi, > > On Wed, Oct 16, 2013 at 06:39:50PM +0200, fulvio ciriaco wrote: >> there is a bug in nwchem output parsing of geometry. >> In nwchem the geometry is composed of lines >> tag q x y z >> where tag may or may not share anything with the chemical >> symbol. > > From my reading, it is always related to the chemical symbol, but not > necessarily identical, i.e. it can be "H", "H1", "H15" or "Hydrogen". > It can be something else entirely if you put it as such in the NWChem > input file, but then it is treated as a dummy (or some random element if > that element happens to match the first two characters). > >> OpenBabel assumes tag is the chemical symbol. >> The attached patch sets the nuclear charge from >> round(q), as for gamess. > > This is indeed probably better, but I would like to point out that > NWChem supports setting point charges, which turn up like (from the > NWChem testsuite): > > No. Tag Charge X Y Z > ---- ---------------- ---------- -------------- -------------- -------------- > 1 O 8.0000 2.04500000 1.01100000 -1.50500000 > 2 H1 1.0000 1.91200000 0.06200000 -1.31400000 > 3 H2 1.0000 1.11900000 1.31800000 -1.54400000 > 4 Bq -0.9000 2.38400000 1.73800000 1.38000000 > 5 Bq 0.4500 2.44800000 1.60800000 0.41600000 > 6 Bq 0.4500 1.56000000 1.26800000 1.60800000 > > AIUI, we will not parse the "Bq" tag correctly either right now. > > Maybe it makes sense to check for "Bq" and set the charge to zero then, > in order to avoid confusion about H atoms popping up from nowhere. > > > Michael
openbabel.diff.gz
Description: Binary data
------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________ OpenBabel-Devel mailing list OpenBabel-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-devel