Help with fix-phonon for LAMMPS


I am having problem using fix_phonon, and I tried emailing the creator of the compute, but I didn’t get any response, so I was thinking of trying my luck here. I am trying to use LAMMPS to simulate and obtain phonon DOS (density of states) for polyethylene. For my simulation I am using the AIREBO potential provided on the LAMMPS website as a benchmark. The unit cell contains 60 atoms (and to get big enough structure I have used replicate 9 8 1 command, which gives in total 4320 atoms in the simulation box), and I have provided the input file, data file and file for the simulation in the attachments. My problem is that even though I think I have created the file correctly, I get an error saying :
“ERROR: The mapping is incomplete! (…/fix_phonon.cpp:612)”.
I was wondering if you could help me resolve my problem, or at least point me in the right direction because I have checked my file multiple times, and can’t see what’s wrong with it. Any help will be appreciated.

Thank in advance,

data.airebo (2.82 KB)

in.airebo (401 Bytes) (53.8 KB)

Why don’t you just go back to the source and troubleshoot your numbers. The error you cite

is the result of the comparison done on line 611. The “if” statement there breaks due to two possible conditions.

tag2surf.size() != surf2tag.size() OR tag2surf.size() != static_caststd::size_t(ngroup)

you could start by printing those numbers and see which condition is triggering the error. Then you can go back to lines 606 and 607 and see how tag2surf and surf2tag are defined. That should get you going while waiting for the developer to answer your Q.

Probably the answer to your Q is simple but I never used this fix thus I can’t really tell you from you a quick look at your files.


Dear Carlos,
Thanks for the idea, but I am not sure if I know how to implement it, my coding skills are not that great. Is there anyone else I could contact regarding the compute fix_phonon?

Thanks in advance,


All I suggested was adding a couple of print statements here and there for you to see which condition was breaking the code execution. This is easy to do (adding the print statements) but you’ll have to recompile the code to get those changes added to the binary (a bit more involved than adding the print changes). Any C++ tutorial on the web will show you how to add the simple changes mentioned, and the Lammps manual has plenty of info about compiling the sources. Learning these few things today will save you time in the future when similar issues arise. Furthermore, you’ll gain the most important thing that one could wish to have: CONTROL. Having control over things is the ultimate tool to set you free. And this is a universal statement that goes way beyond coding.

If the above doesn’t work for you then move onto the next line below.
Don’t you have a friend/colleague with better coding skills that could assist you?

I don’t know of anyone else who can help you regarding your Q.


I would second this advice, to do some debugging.

This error is in the readmap() function which is reading your
map file and storing the info in a couple of simple lookup hashes.

The error is b/c at the end, the number of values stored in the 2
hashes isn’t the same, and it should be, since they are the
inverse of each other (if I understand the code).

If you start with a small non-replicated system, you can print
out the values in each hash (as you put them in), and see why
they are mis-matched at the end. I am guessing you have duplicated
values in your map file, which is causing one of the hashes to overwrite
itself when you insert, and creating the mis-matched counts.


I have been able to solve the problem, thank you all. After Steve’s suggestion that I might have duplicated the values, I went back and checked, and found that I did indeed do that in one part, but the error was also in the way I defined my file. The fourth column should contain the k_th atom inside a unit cell (so in my cases 0 to 59, because indices go from 0 to n-1), but instead of that previously i have inputted the atom id so 0 for Carbon and 1s for Hydrogen. Thanks again all for the help.