How do I fix my data file to fit the hybrid atom_style?

Dear all,

I want to modify the data file I am getting from VMD in full atom_style, so I can use it with the atome_style hybrid edpd full. I have tried to create the following:

atom-ID atom-type x y z sub-style1 sub-style2 …

as explained in LAMMPS documentation.

for atom_style edpd: atom-ID atom-type edpd_temp edpd_cv x y z
for atom_style full: atom-ID molecule-ID atom-type q x y z

So I assume for ( atom_style hybrid edpd full) , my data file should be like:

atom-ID atom-type x y z edpd_temp edpd_cv molecule-ID q

Is this correct?

my other question is if I do not have any charge is it fine to get rid of the q column, or do I need to have it zero?

Is the data file sensitive to spacing between columns?

I am asking all these because I have tried multiple formats and still I am getting the error: Incorrect atom format in data file

Thank you so much

part of input file :
atom_style hybrid edpd full

region edpd block -50 50 -50 30 -22 23 units box

create_atoms 2 random 16000 276438 NULL

part of initial file:

280 atoms
405 bonds
780 angles
1510 dihedrals
250 impropers
2 atom types
1 bond types
1 angle types
1 dihedral types
1 improper types
-50.000000 50.000000 xlo xhi
-50.000000 50.000000 ylo yhi
-0.267977 22.242075 zlo zhi


1 1.2 # CA
2 1

Atoms # AtomID Atomtype x y z edpd_temp edpd_cv moleculeID q

1 1 5.162323 0.464617 8.843235 1 1 1 0
2 1 4.852682 1.821242 9.111212 1 1 1 0
3 1 4.669892 2.248901 10.451096 1 1 1 0
4 1 3.903312 3.410221 10.719072 1 1 1 0
5 1 5.099893 0.925494 6.431444 1 1 1 0

When asking about situations where you get error, please always report which LAMMPS version you are using, what platform you are on and - ideally - provide a minimal input deck that can reproduce the error. This will help enormously to provide correct and meaningful advice.

It sounds about right. At least for the current LAMMPS release version.

If you don’t want to include charges, you need to use atom_style hybrid edpd molecular (or build a hybrid with angle or bond if you don’t need dihedrals and impropers, or also don’t need angles). Otherwise the charge data must be present in the data file. Whether data must be present is determined by the atom style; whether it is used is determined by the pair style (and bond/angle/dihedral/improper style etc.).

No. At least not in recent version.

It would really help to see an example that produces the error.

This one works for me for atom_style hybrid edpd full with charges , for example:

# Comment
2 atoms
2 atom types

-10.0 10.0  xlo xhi
-10.0 10.0  ylo yhi
-10.0 10.0  zlo zhi


1 1.0
2 2.0

Atoms # hybrid

1 1 2.0 0.0 0.0 5.0 0.2 1 -1.0
2 2 0.0 2.0 0.0 4.0 0.1 1  1.0

Thank you so much for your quick and explanatory reply. my lammps version is LAMMPS (29 Sep 2021 - Update 3). I will try the format you told me. I’m editting my question to include some part of the data file.

Dear akohlmey.

With the data file I have I am getting the error: " Expected floating point parameter instead of ‘5.091559 1’ in input script or data file (…/atom.cpp:1171)

Check your file very carefully. LAMMPS requires that all input is using ASCII characters.
There are non-ASCII characters (in UTF-8 encording) that look exactly or almost the same. This applies to blanks, too. If they are not ASCII characters, LAMMPS may not be able to correctly parse such files.

1 Like

FYI, you can use grep to check for lines with non-ASCII characters:

env LC_ALL=C grep -n '[^ -~]' some.file

Thanks a lot

Thanks a lot akohlmey. What do you recommend to modify the data file? I modified my data file from VMD with excel but saving it as text it seems it changes the format. Is there any better way to modify data files without messing up with it?

You have to use the tools that you are familiar with and then just make sure you use them correctly and request the correct changes.

There are many different ways to introduce additional or move existing columns. I probably would do this with the emacs text editor, because that is what I am most familiar with and that has a functionality for cutting and pasting rectangular regions. If I had to work on a machine where emacs is not available, I would probably split the file into 3 segments (1: up to and including the Atoms keyword, 2: the Atoms section w/o the header, 3: after the Atoms section), then process the middle section with either “awk” or “perl” or “python”, and then paste this modified middle section together with the preserved first and last section.

1 Like

Than you so much, very helpful.