Delete Atoms

Hi everyone,
Suppose I have a simulation box that the substrate is made of Copper and Argon atoms on the surface. Also, there is a cubic box of Copper atoms among the Argon atoms. that I want to delete some of the Copper atoms in order to build a T-type shape. My problem is when I use the below code, Argon atoms around the cubic box are deleted, too.

region D1 block 0 42 0 90 19 30 units box
delete_atoms region D1

Before the above code, I have specified Cu and Ar atoms by grouping them as below:
group Ar type 1
group Cu type 2

How can I delete Copper atoms in region D1 without deleting Argon atoms?

Thanks a lot.
Hamed

You can try something like this. With the very latest version of LAMMPS (4 May 2022) you can skip the final group creation/deletion step as delete_atoms now accepts atom style variables directly.

group Ar type 1
group Cu type 2
region D1 block 0 42 0 90 19 30 units box
variable curegion atom grmask(Cu,D1)
group todelete variable curegion
delete_atoms group todelete
group todelete delete

Thanks a lot…very helpful.

The alternative is to not create the excess atoms in the first place and build a t-shaped region from the union of two block shape regions and then create the atoms in that.