Molecule attributes do not match system attributes (src/molecule.cpp:1835)

Hello everyone
I’m having a hard time now, I’m doing a simulation of the deposition of Cd and Te2 molecules on CdTe crystals, and during my simulation, I was able to proceed, but the number of deposited atoms didn’t match what I set, and he would get a warning like “Molecule attributes do not match system attributes (src/molecule.cpp:1835)”
Here’s my molecular template
2 atoms
1 bonds
0 angles

Coords

1 0.0 0.0 0.0
2 2.62 -0.731 -0.328

Types

1 1
2 2

Charges

1 0.001
2 -0.001

Bonds

1 1 1 2
Here is my in-file
restart 10000 restart.*.equil
dimension 3
units metal
atom_style bond
boundary p p p
timestep 0.001
#创建底部CdTe模型
lattice custom 6.566 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 1.0 &
basis 0.0 0.0 0.0 &
basis 0.5 0.0 0.5 &
basis 0.0 0.5 0.5 &
basis 0.5 0.5 0.0 &
basis 0.25 0.25 0.25 &
basis 0.75 0.25 0.75 &
basis 0.25 0.75 0.75 &
basis 0.75 0.75 0.25
region box block 0 6 0 6 0 18 units lattice
create_box 5 box bond/types 1 extra/bond/per/atom 5 extra/special/per/atom 20
create_atoms 2 box basis 1 1 basis 2 1 basis 3 1 basis 4 1 basis 5 2 basis 6 2 basis 7 2 basis 8 2
mass 1 127.6
mass 2 112.41
mass 3 127.6 #Te
mass 4 127.6 #Te
mass 5 112.41 #Cd
group Te type 1
group Cd type 2
write_data total.data
#创建上部C原子生成区域
region lower block INF INF INF INF INF 39.396 units box
region empty block INF INF INF INF 39.396 INF units box
group empty region empty
delete_atoms group empty
reset_atoms id
#原子分组:底部固定部分和上部原子部分
region bot block INF INF INF INF INF 19.698 units box
group lower region lower
group bot region bot
group deposit subtract lower bot
molecule Te2 Te2.data toff 2
bond_style harmonic
bond_coeff 1 5.0 2.740
#group Te2 type 3
group addatoms_Te type 3 4
group addatoms_Cd type 5
#fix 3 all bond/create 1 3 3 2.74 12345
#fix 4 all bond/break 1 3 48279
#力场设置
pair_style bop save
pair_coeff * * …/potentials/CdTe.bop.table Te Cd Te Te Cd
comm_modify cutoff 15.7
#近邻列表参数设置
neighbor 0.3 bin
neigh_modify delay 1 check yes
#轨迹文件输出设置
dump 1 all custom 100 dump.sputter id type x y z vx vy vz
dump_modify 1 element Te Cd Te Te Cd
#屏幕输出信息设置
reset_timestep 0
compute deposit deposit temp
compute empty1 empty temp
compute empty all pressure empty1
thermo 10
thermo_style custom step pe ke etotal c_deposit c_empty1 temp vol press c_empty
#固定底部原子,防止在沉积过程中移动
velocity bot set 0 0 0
fix s1 bot setforce 0 0 0
#温度初始化
velocity deposit create 600 39849
#nvt系综下进行弛松弛
fix 10 all npt temp 600 600 0.1 iso 0 0 1
fix_modify 10 temp deposit
run 40000
change_box all boundary p p f
#沉积过程
#沉积原子类型
region sput block 0 19.698 0 19.698 37 47 units box
fix 40 addatoms_Te deposit 50 0 500 12345 region sput local 80 80 9 near 0.5 vz -8.5 -9.5 mol Te2 units box
fix 30 addatoms_Cd deposit 100 5 250 95485 region sput local 80 80 9 near 0.5 vz -12.5 -13.5 units box
#删除飞出box外的原子
thermo_modify lost ignore flush yes
run 25000
min_style cg
minimize 1e-10 1e-10 100000 100000

Thank you

I already told you that using bonds in combination with a BOP potential is an error.
What is the point in asking for advice when you don’t follow it.

The warning you get is because your molecule file sets charges for the atoms in the molecule template but the atom style you are using (bond) does not provide storage for charges. And, again, the BOP potential pays no attention to charges, so that information is superfluous. In fact, if you want to use the BOP potential via pair_style bop, you should be using atom style atomic.

You are having a hard time because you are not paying attention. In other words, you are your own problem and causing grief on yourself. Neither LAMMPS nor the advice given here are to blame.
That also means that you have added this post to the wrong category. It is not a problem of how LAMMPS is installed but how you use it and thus it is at best a LAMMPS Beginners post (since we don’t have a category for people that do not follow advice and do not study documentation carefully).

Thank you, your reply to me in the last post, I watched it carefully, so I canceled the key setting, and I used to set the charge to 0, but it still reported an error, and I need to deposit Te2 molecules, I don’t want to use the bond form, but I want to deposit two Te atoms at a time, if you don’t put it in the molecular template, I really can’t think of any way, I have also tried the information of the molecular template without chemical bonds, but the number of deposited atoms is still not right.

You are not thinking logically here. The problem is because of the “Charges” field not because of the charge values you set. A charge of 0.0 is still a charge value, but with an atom style that does not store charges you cannot set any charge values at all.

You can deposit pairs of atoms with a molecule template just as well.

This is a very different issue. You are conflating multiple problems into one. The number of deposited atoms is probably as programmed. You can confirm this by creating a custom thermo output which includes f_40 and f_30. I would suspect that the number of atoms is changed without noticing due to this setting:

thermo_modify lost ignore

So atoms leaving the box will not cause an error.
To confirm, you can dump your atom positions and visualize the results.

In general, please don’t just use settings and commands uncritically and without understanding its side effects. The point is that you can easily suppress some errors, but that does not make your simulation correct. LAMMPS allows the suppression of certain errors, because there are situations where those are intentional and thus not an error. Using then in a different scenario would then hide but not fix the error.

Hello
I followed your suggestion, modified atom_style to atomic, and removed charges, removed the chemical bonds between Te2 molecules, still used molecule to define Te2 molecules, and visualized every frame, but the deposition process did not follow the set parameters.
BEGIN:Loop time of 707.533 on 1 procs for 40000 steps with 1728 atoms
END:Loop time of 3.06234 on 1 procs for 98 steps with 1747 atoms
Modified file
atom_style atomic
boundary p p p
timestep 0.001
#创建底部CdTe模型
lattice custom 6.566 a1 1.0 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 1.0 &
basis 0.0 0.0 0.0 &
basis 0.5 0.0 0.5 &
basis 0.0 0.5 0.5 &
basis 0.5 0.5 0.0 &
basis 0.25 0.25 0.25 &
basis 0.75 0.25 0.75 &
basis 0.25 0.75 0.75 &
basis 0.75 0.75 0.25
region box block 0 6 0 6 0 18 units lattice
#create_box 5 box bond/types 1 extra/bond/per/atom 5 extra/special/per/atom 20
create_box 5 box
create_atoms 2 box basis 1 1 basis 2 1 basis 3 1 basis 4 1 basis 5 2 basis 6 2 basis 7 2 basis 8 2
mass 1 127.6
mass 2 112.41
mass 3 127.6 #Te
mass 4 127.6 #Te
mass 5 112.41 #Cd
group Te type 1
group Cd type 2
write_data total.data
#创建上部C原子生成区域
region lower block INF INF INF INF INF 39.396 units box
region empty block INF INF INF INF 39.396 INF units box
group empty region empty
delete_atoms group empty
reset_atoms id
#原子分组:底部固定部分和上部原子部分
region bot block INF INF INF INF INF 19.698 units box
group lower region lower
group bot region bot
group deposit subtract lower bot
molecule Te2 Te2-1.data toff 2
#bond_style harmonic
#bond_coeff 1 5.0 2.740
#group Te2 type 3
group addatoms_Te type 3 4
group addatoms_Cd type 5
#力场设置
pair_style bop save
pair_coeff * * …/potentials/CdTe.bop.table Te Cd Te Te Cd
comm_modify cutoff 20
#近邻列表参数设置
neighbor 0.3 bin
neigh_modify delay 1 check yes
#轨迹文件输出设置
dump 1 all custom 1 dump.sputter id type x y z vx vy vz
dump_modify 1 element Te Cd Te Te Cd
#屏幕输出信息设置
reset_timestep 0
compute deposit deposit temp
compute empty1 empty temp
compute empty all pressure empty1
thermo 10
thermo_style custom step pe ke etotal c_deposit c_empty1 temp vol press c_empty
#固定底部原子,防止在沉积过程中移动
velocity bot set 0 0 0
fix s1 bot setforce 0 0 0
#温度初始化
velocity deposit create 600 39849
#nvt系综下进行弛松弛
fix 10 all npt temp 600 600 0.1 iso 0 0 1
fix_modify 10 temp deposit
run 40000
change_box all boundary p p f
#沉积过程
#沉积原子类型
region sput block 0 19.698 0 19.698 37 47 units box
fix 40 addatoms_Te deposit 500 0 500 12345 region sput local 80 80 9 near 0.5 vz -8.5 -9.5 mol Te2 units box
fix 30 addatoms_Cd deposit 1000 5 250 95485 region sput local 80 80 9 near 0.5 vz -12.5 -13.5 units box
#删除飞出box外的原子
thermo_modify lost ignore flush yes
run 25000
min_style cg
minimize 1e-10 1e-10 100000 100000
Modified file
2 atoms
0 bonds
0 angles

Coords

1 0.0 0.0 0.0
2 2.62 -0.731 -0.328

Types

1 1
2 2
Such a warning appeared during the operation:Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. (src/comm_brick.cpp:210)

You haven’t followed all my suggestions since you didn’t remove this which is crucial.
How can you claim that the deposition is not as programmed, when you ignore when atoms leave the simulation box?

Also you didn’t follow my suggestion to monitor the depositions in the thermo output.

So please do not claim that you followed my suggestions.