ERROR: Fix gcmc molecule command requires that atoms have molecule attributes (src/MC/fix_gcmc.cpp:538)

Dear LAMMPS users,

Greetings!

I am trying to add DMSO (C2H6OS) molecule into zeolite templated carbon structure using fix gcmc command, however, I am continuously getting the error below;

"ERROR: Fix gcmc molecule command requires that atoms have molecule attributes (src/MC/fix_gcmc.cpp:538)’’

Here is given my input script. Kindly guide me how to resolve this issue.

-------------------- Init Section -----------------------

units real
boundary p p p
atom_style charge
pair_style lj/cut/coul/long 12.8
kspace_style ewald 1.0e-5
kspace_modify gewald 1.0e5

-------------------- Atom Definition Section ------------

region cathode block -9.870000 30.310000 -10.352500 29.123502 -6.588499 19.695501
read_data MFI.data #extra/bond/types 1 extra/angle/types 1 extra/dihedral/types 1 extra/improper/types 1 extra/bond/per/atom 4 extra/angle/per/atom 2 extra/dihedral/per/atom 2 extra/improper/per/atom 2 extra/special/per/atom 2 #extra/atom/types 1 # YOU CAN CHANGE IT FOR YOUR MATERIAL
replicate 2 2 2

group C type 1 # MAKE A GROUP WITH THE ATOMS OF THE METAL SURFACE

molecule elec dmso.txt offset 1 0 0 0 0 #INCLUDE YOUR DESIRED MOLECULES
group dmso type 2 3 4 5 #MAKE SURE THE NUMBERS CORRELATES WITH THE LIST IN THE DATA.IN FILE
group S type 2
group O_solvent type 3
group C_solvent type 4
group H_solvent type 5

group elecdyn dynamic dmso every 1

#group C1 type 1 # C(MOF) ;THESE GROUPS ARE FOR SET CHARGES TO THE ADSORBENT ATOMS

#set group C1 charge 0.01

pair_coeff * * 0.0 0.0 # rigid MOF ==> no LJ interaction between ztc atoms
pair_coeff 1 2 0.139499 3.7 # C(ztc)-S(dmso) LJ ;
pair_coeff 1 3 0.081682 3.4 # C(ztc)-O(dmso) LJ
pair_coeff 1 4 0.065854 3.74 # C(ztc)-C(dmso) LJ
pair_coeff 1 5 0.036529 3.04 # C(ztc)-H(dmso) LJ
#pair_coeff 2 2 0.350 4.0 # S(dmso)-S(dmso) LJ
#pair_coeff 3 3 0.120 3.4 # O(dmso)-O(dmso) LJ
#pair_coeff 4 4 0.078 4.08 # C(dmso)-C(dmso) LJ
#pair_coeff 5 5 0.024 2.68 # H(dmso)-H(dmso) LJ

-------------------- Settings Section -------------------

compute_modify thermo_temp dynamic yes
neighbor 3 bin
neigh_modify every 1 delay 0 check no one 100000 page 5000000
neigh_modify exclude group C C
variable numatomad equal (atoms-1680) #COUNTING THE NUMBER OF ATOMS INCLUDED IN THE BOX WITHOUT THE ztc
variable elecad equal count(elecdyn)/10 # CALCULTING THE NUMBER OF MOLECULES INSTEAD OF THE NUMBER OF ATOMS

-------------------- Run Section ------------------------

fix 1 C rigid single force 1 off off off torque 1 off off off
#fix myrigid dmso rigid/small
#fix 2 dmso deposit 300 0 10 12456 mol elec region cathode

fix fxgc dmso gcmc 1 1 1 0 124356789 100.0 -0.5 0.5 mol elec pressure 1000 full_energy

thermo 100
thermo_style custom step epair temp press density v_elecad

dump 1 all custom 100 gcmc*.lammpstrj id type x y z

run 3500 #RUN THE SIMULATION FOR 500 STEPS

write_data MFI_dmso1.out


Looking forward to hear back.

Regards
Khizar Hayat

This error message is pretty self-explanatory. To use fix gcmc with molecules defined via the molecule command, you need to have molecule IDs. However those are not included in atom style “charge”. Thus you either need to use atom style “full” (and update your data file) or use fix property/atom to have molecule IDs available.

Dear akohlmey,

Thank you. It’s working now.

Regards

Hello Khizar,

could you share with me how did you change your file with fix property/atom command? Thanks so much.

Best,
Nicole

Dear Nicole,

Basically, I updated my data file with respect to atom style “full”. This would eliminate the error of molecule attributes. Further you can share your data file and input file to fix the error.

Regards
Khizar

Dear Khizar,

Thank you for the reply. Here is my input script file. I am trying to use a machine learning potential, which only works for in the atomic atom_style, the ‘full’ type won’t work. Does anyone know how to solve this issue with the fix propery/atom command? Thanks so much.

units metal
atom_style atomic
dimension 3
boundary p p p
processors * * *

read_data start.lmp

mass 1 26.982
mass 2 15.999
mass 3 12.011
mass 4 01.008
mass 5 01.008
mass 6 14.007

molecule gas H2.txt
group mof type 1 2 3 4 6
group gas type 5

configuration for runs

pair_style mlip mlip.ini
pair_coeff * *

dump info

dump 1 all atom 10 dump_H2_MC.lammpstrj

GCMC

#variable tfac equal 5.0/3.0 # (3 trans + 2 rot)/(3 trans)
fix fgcmc gas gcmc 10 10 10 0 65899 300 -0.2 0.1 mol gas pressure 10.0

output

#thermo_style custom step etotal temp lx vol press
thermo 100
run 200

#write_restart Restart.final
write_data mofwithH2.data

Dear @SP_Liu,

Please don’t ask the same question multiple times in different threads.
And please have a look at the guidelines https://www.lammps.org/guidelines.html

Unless you spend the time to do a more careful read of the documentation and learn how to teach yourself from the information provided by making experiments and following the discussions and examples, you are not likely to get much help. There is a lot of information out there and people often don’t look kindly on those that request to explain to them what has been explained in detail already.

Thanks so much for the reply.
Sorry to open a new thread for this problem. Will go back to the manual.

Thanks again.