Charge

Hi, every one

I have a simple problem.

I have a data file for 144 carbon atoms and I want to assign a charge to each individual atoms. but when I type q x y z amounts in the data file, an error occurs and say : incorrect atom format in data file…

please…

thanks.

Hi, every one

I have a simple problem.

I have a data file for 144 carbon atoms and I want to assign a charge to each individual atoms. but when I type q x y z amounts in the data file, an error occurs and say : incorrect atom format in data file…

please…

Please what?

See the atom_style and read_data commands.
They give the format of the data file for styles
that include per-atom charge. If you don’t
follow those instuctions you will get an error.

Steve

Defintely do read that documentation. Here are the links:
http://lammps.sandia.gov/doc/atom_style.html
http://lammps.sandia.gov/doc/read_data.html

Check to make sure you are using the correct atom_style (eg
"atom_style atom" or "atom_style full"). Also be sure to check that
the number of atoms declared at the top of the data file matches the
number of (non-blank) lines in the "Atoms" section.

Andrew

P.S.
   If you are really stuck, try editing the code to the "atom.cpp"
file (from the LAMMPS source code, on lines 699, 760, and 764, so that
it prints out the line where the error occurred). Then recompile
LAMMPS and run it again using your input files. For example, replace:
  error->all(FLERR,"Incorrect atom format in data file");
with something like this (I think):
  char err_msg[4096];
  sprintf(err_msg,"Incorrect atom format in data file\n\"%s\"\n", buff);
  error->all(FLERR, err_msg);

  Alternately, try reading the data file in some other program which
reads data files, like topotools or moltemplate/ltemplify.

  For example moltemplate comes with a data-file parser "ltemplify.py"
which can sometimes catch errors in your data file. This requires two
steps.
Step 1) importing the DATA file into moltemplate format (.LT) using
"ltemplify.py".
        You will need an input script for this step.
Step 2) Then try running moltemplate.sh on that LT file to see if it
catches any mistakes.
   For an example, see this post:
   http://lammps.sandia.gov/threads/msg43982.html
   Unfortunately this will be slow and use a lot of memory on a system
with more than 200000 atoms. And I doubt moltemplate will help, given
the error message you are having.

Sometimes, I also find that using topotools in VMD to read the file
prints useful error messages:
topo readlammpsdata MY_DATA_FILE full
(You may have to replace "full" with some other atom-style-name to get
this to work. In so doing, you will figure out what's wrong.)

Dear Andrew

Firs I must say that thank you for all your kind response and excellent comments.
I saw the pages you mentioned and I found the correct way of which I must be in. Now, the error has gone and I really appreciate your notes.

Thanks,