Unknown Identifier

So, there may be some blank lines that had to be filled and filled lines that had to be skipped?
I’ll check again.

The line it reported from the error is of any interest or not? I mean, I should begin checking around that line? Because, around that it seems to be well formatted to me.

Thanks

Michele

From: Michele Formica <[email protected]>
Date: 2013/5/27
Subject: Re: [lammps-users] Unknown Identifier
To: Axel Kohlmeyer <[email protected]>

So, there may be some blank lines that had to be filled and filled lines
that had to be skipped?
I'll check again.

The line it reported from the error is of any interest or not? I mean, I
should begin checking around that line? Because, around that it seems to be
well formatted to me.

no. the error must be *before* the line that is considered malformed.

axel.

Here the line before and after the line cited in the error:


50 12 22 24 27 26
51 7 22 24 27 29
52 12 23 24 27 25
53 12 23 24 27 26
54 7 23 24 27 29
55 1 24 27 29 28
56 10 24 27 29 284
57 1 24 27 29 30
58 4 25 27 29 28
59 2 25 27 29 284
60 4 25 27 29 30

Every section begins with:

Atoms
/blank line/



/blank line/
Bonds
/blank line/

Michele

The fact that it can be tricky to debug data files due to the weakness
of the format is the reason why people write scripts like topotools or
moltemplate to generate data files. at the very least, they always
create files that are syntactically correct. so you limit the number
of degrees of freedom that you have to debug significantly.

I created this with topotools.
By the way: there’s any difference between SPACE and TAB in the data formatting? Because in the lists I’ve written a half with space and the other with tab to separate values.

Michele

Here the line before and after the line cited in the error:

if it was so easy to tell, where it goes wrong, LAMMPS would have code
to tell you.

axel.

I created this with topotools.

have you checked the atom style?

By the way: there's any difference between SPACE and TAB in the data
formatting? Because in the lists I've written a half with space and the
other with tab to separate values.

huh? topotools doesn't do that. did you edit the file in a text editor
afterwards?

axel.

Yes. I had to copy some parts from another datafile carefully paying attention to sequential numbers and total atom/bond/angles number. The only difference is that the copied parts are separated with TAB.

Atom style is FULL.

I created this with topotools.
By the way: there's any difference between SPACE and TAB in the data
formatting? Because in the lists I've written a half with space and the
other with tab to separate values.

whitespace is whitespace when parsing with *scanf() as it is done in read_data.

axel.

p.s.: tabs are evil(tm)

Yes. I had to copy some parts from another datafile carefully paying
attention to sequential numbers and total atom/bond/angles number. The only

this is an invitation to introduce mistakes. you would be better off
to teach yourself a bit of VMD scripting and have VMD take care of
everything. its scripting language is very powerful and worth the
effort of learning it.

if you are certain, that all the numbers in the header match the
number of lines in the sections below, that each line is formatted
correctly and otherwise followed the format requirements correctly,
then there should be no error.

you *do* have an error, so something *is* wrong. i had to turn in my
crystal ball, so i don't know what.
...and i already explained that how i avoid running into this
situation altogether.

axel.

Ok, thanks.

I tried tha backward way. I used the readlammpsdata command with topotools reading my datafile; it reports me an error when parsing the LAMMPS Angles section: expected integer but got “”.

Ok, thanks.

I tried tha backward way. I used the readlammpsdata command with topotools
reading my datafile; it reports me an error when parsing the LAMMPS Angles
section: expected integer but got "".

that is not a bad idea. i'm doing this occasionally myself, but tend
to forget after a while. since the code in topotools is written in an
entirely different way than the one in LAMMPS, it chokes on
malformatted files differently. in a few special cases even, it can
correctly read files that read_data cannot (so just reading and then
writing can correct those files).

so have you checked whether your angles section has enough lines? or
is there a typo in the header?

axel.

There are 32520 angles and the Angles section ends with the 32520° line.
What kind of typo in the header?

Can you please give a fast check on my datafile?
It’s 8 MB, so I think it should be better to send it to you, right?

I’m sorry for asking you this, but I’m in a hurry with this work and you surely are faster than me in checking errors.

by that reasoning, 90% of the researchers should let the other 10% do
the work. you already have thoroughly exhausted all of the good will i
have and then some. in fact, *i* am in a hurry to get a decent dinner
(way overdue) and go back to do things that *i* care about, which do
not include problems that can be avoided by picking up a few
additional skills.

well, if you *do* want to contract me to correct what you messed up, i
may change my mind. since this is not the kind of thing i enjoy doing,
i won't be doing it just out of the kindness of my heart.
sorry. that ain't no escape from the blues...

axel.

If you are desperate, you can try using moltemplate to convert your
input scripts and data files into a moltemplate file, and then check
that file for errors. To do that, install the most recent version of
moltemplate (v 1.03 from www.moltemplate.org), and try the following
commands:

ltemplify.py file.IN file.DATA > system.lt
moltemplate.sh -atomstyle "full" system.lt

You must supply an input script as well containing all of the force
field styles and coeffs you need. (Any input scripts included by that
script must be present in that directory. ltemplify reads them too.)

If moltemplate can detect a problem with your files, it will try to
give you a detailed explanation where that problem is. Unfortunately,
the error messages will refer to problems in "system.lt" (the file
created by ltemplify), not in your original data file. So you will
have to infer where the problem was in your original data file (or
input scripts). It may also complain about other issues in your input
script and data file you did not know about (in addition to printing
warning messages which may not be relevant).

I doubt this will It's worth a try. I am curious to know if this is helpful.
Andrew

Thanks Andrew.
I let ltemplify.py read my data file and at the end of reading (It comes to “processing Impropers”, my last section) it says:

Traceback (most recent call last):
File “./ltemplify.py”, line 1723, in
if ((min_needed_impropertype == None) or
NameError: name ‘min_needed_impropertype’ is not defined

When LAMMPS performs a read_data command, it prints a line to the screen
for each big section of data it reads, e.g.

32000 atoms
32000 velocities
27723 bonds
40467 angles
56829 dihedrals
1034 impropers

That should let you infer which section it gets an error in. The most common
problem would be a section not having the same # of lines as the
header in the data file says it does. E.g. if there were not exactly 32000
lines in the Atoms section. If an individual line in the section has a bad
value (e.g. negative atom type), LAMMPS will catch that.

Steve

Traceback (most recent call last):
  File "./ltemplify.py", line 1723, in <module>
    if ((min_needed_impropertype == None) or
NameError: name 'min_needed_impropertype' is not defined

hmm... not good. (Sorry about that! I confess I don't really use
impropers, so they are not well tested.)

I don't know if this will help you. ... But can you help me? Please
copy the attached file (ltemplify.py) into your moltemplate/src
directory (overwriting the old version), and try again.

(Or, alternately, send me me your input script(s) and data file, it
will help me debug ltemplify.py. I completely understand if you don't
want to do this.)

I wish I got more bug reports. Thanks for the post!

Andrew

ltemplify.py (91.9 KB)