ERROR: Must have an atom map for ndx2group command (src/EXTRA-COMMAND/ndx_group.cpp:85) Last command: ndx2group groups.ndx

Hi everyone, I am trying to group atoms using an ndx file using ndx2group command. I am getting the above error. I have attached my ndx file and command I used. Please address the error and guide me where I went wrong.

Thank you
grps.ndx (81 Bytes)

PS: ignore the difference in filenames in command and uploaded here. I can assure that I am doing right in that part.

###################################### Perfect #####################################

clear
log final.lammps
units		metal
dimension	3
boundary	p p p
atom_style	atomic

read_data data.txt

ndx2group groups.ndx 
#group top_atoms region top
#group bottom_atoms region bottom

#region vacuum block 0 ${x_length} 0 ${y_length} ${atoms_end} ${z_length} units box

#delete_atoms region vacuum
# --------------------- EAM POTENTIAL ---------------------

pair_style	eam/alloy
 pair_coeff * * "/home/labuser/snap/snapd-desktop-integration/178/potential_files/FeNiCr_Foster_Sills.setfl" Ni 
neighbor 2.0 bin 
# --------------------- SETTINGS ---------------------

compute peratom all pe/atom
compute total_energy all reduce sum c_peratom


####################### thermal properties output on screen ###################### 

thermo 10
thermo_style custom step pe lx ly lz press pxx pyy pzz c_total_energy 


#dump dump1 all cfg 1 dump_perfect/perfect_*.cfg mass type xs ys zs c_peratom 

# Dump for top atoms
#dump dump2 top_atoms cfg 1 dump_perfect/perfect_top_*.cfg mass type xs ys zs c_peratom 

# Dump for bottom atoms
#dump dump3 bottom_atoms cfg 1 dump_perfect/perfect_bottom_*.cfg mass type xs ys zs c_peratom


dump dump4 all custom 1 final.dat id type xs ys zs c_peratom 

min_style cg
minimize 1e-10 1e-10 5000 10000
variable tengperfect equal "c_total_energy"
variable natomsperfect equal "count(all)"
variable ecohperfect equal "v_tengperfect/v_natomsperfect"

variable ecohperfect_final equal "v_ecohperfect"

variable areaperfect equal "lx*ly"

print "cohesive energy of perfect ${ecohperfect}"
print "total energy of perfect ${tengperfect}"
print "perfect area equals ${areaperfect}"
print "No. of atoms in perfect ${natomsperfect}" ```

Hello, which version of LAMMPS are you using? In the most recent distributions, ndx_group.cpp is part of the COLVARS package.

Try adding a blank line at the end of the file grps.ndx to check if this is a parsing error.

Regarding the documentation, the above error is not reported in the Manual. Also, there is a typo in doc/src/group2ndx.rst, line 46:

The ndx2group command will create of update group definitions from those stored in an index file.

should read:

The ndx2group command will create or update group definitions from those stored in an index file.

1 Like

It has been moved to a new EXTRA-COMMAND package.

That is a typical “Kohlmeyer typo”. It happens quite a bit that I accidentally type “of” instead of “or”. That may be related to the local dialect spoken where I grew up, where the equivalents of “or” and “of” were the same word…

2 Likes

Thank you for the reply. But I still haven’t figured out the solution. I have tried adding blank line as suggested. Any other suggestions?

Have you considered searching the manual for the term “atom map”?
It should lead you to the atom_modify command where you can enable an atom map.