ERROR: Group region ID does not exist

Submitted by krobot on Mon, 01/16/2023 - 16:50

Hello everybody, I am newbie in Liggghts. I am working on Particle insertation. My code failed after certain points. I couldn't figure out what to do:

variable dia1 equal 6
variable dia2 equal 2
variable rad1 equal ${dia1}/2
variable rad2 equal ${dia2}/2

variable startPercent equal 0.8

variable rad1_start equal ${rad1}*${startPercent}
variable rad2_start equal ${rad2}*${startPercent}

create_atoms 1 single 20 20 20 # The coordination of the first particle
create_atoms 1 single 25 20 20 # The coordination of the second particle

set atom 1 diameter ${dia1}
set atom 2 diameter ${dia2}

# These particles needs to be grouped. All the particles that are inside the group called par_group. all particles are in region insParticles

group g_reg region sim_reg # Error is coming here
group g_elec1 region regElectrode
group g_elec2 region regElectrode

fix pts1 all particletemplate/sphere ${seed1} atom_type 1 density constant ${rho_NMC} radius constant ${rad1_start}
fix pts2 all particletemplate/sphere ${seed2} atom_type 1 density constant ${rho_NMC} radius constant ${rad2_start}

fix pdd1 all particledistribution/discrete ${seed6} 1 pts1 1
fix pdd2 all particledistribution/discrete ${seed7} 1 pts2 1

variable insertAttempt equal 2000

fix ins1 g_electrode1 insert/pack seed ${seed11} distributiontemplate pdd1 maxattempt ${insertAttempt} insert_every once overlapcheck yes all_in yes vel constant 0. 0. 0. &
region regElectrode
fix ins2 g_electrode2 insert/pack seed ${seed12} distributiontemplate pdd2 maxattempt ${insertAttempt} insert_every once overlapcheck yes all_in yes vel constant 0. 0. 0. &
region regElectrode

fix integr all nve/sphere

But I am getting error:
Created 1 atoms
Created 1 atoms
Setting atom values ...
1 settings made for diameter
Setting atom values ...
1 settings made for diameter
2 atoms in group g_reg
ERROR: Group region ID does not exist

Can Someone help me with it?