Remove Atom(s) or Particle(s) after certain time

Dear LAMMPS-developers and users:

I am looking for a way to remove some particles (SPH particles) after some
time. I am able to change the main code of the SPH model (cpp/h files) to
change the force calculation or integration approach. *I was not able to
remove particles if they are having certain criteria. *I tried to change
their positions far away from the system (in the end of pair_compute) but
they still somehow connected with the neighbor list.

The problem is a solid mechanics problem with bounce back after reflection
for a solid substrate. So, for the reflected particles, I don't want them
to interact with each other or interact with the new particles heading to
the substrate.

Please let me know if you have any suggestions.

Waiting for your kindly reply!
Regards.

Dear LAMMPS-developers and users:

I am looking for a way to remove some particles (SPH particles) after some time. I am able to change the main code of the SPH model (cpp/h files) to change the force calculation or integration approach. I was not able to remove particles if they are having certain criteria. I tried to change their positions far away from the system (in the end of pair_compute) but they still somehow connected with the neighbor list.

there are quite a few steps required to make LAMMPS remove atoms from
its system. you can see from the source code of the delete_atoms
command.

if you are willing to write your own source code, then I would suggest
to implement the deleting of atoms as part of a fix that could be
based on fix evaporate.
that fix will remove atoms in a region randomly, instead you could do
this based on some condition. depending on the complexity of the
condition, you could define some atom style variable or a custom
property via fix property/atom and then set the value for all atoms
you want to be deleted to 1 and all others to 0. the fix will then
remove those atoms in a single pass at the designated step. the fix
also has the example code to signal to the neighbor list build code to
request a new neighbor list build after atoms have been deleted. that
would need to be adapted according to how you actually implement the
procedure, but it is imperative to force a neighborlist rebuild after
removing atoms.

if it is simple to detect atom that should be deleted, e.g. by
deleting all atoms in a given region or a given property that can be
computed in an atom style variable or by a per-atom compute, then you
can just do piecewise runs and then run the delete_atoms command on a
group of flagged atoms and continue the run.

The problem is a solid mechanics problem with bounce back after reflection for a solid substrate. So, for the reflected particles, I don't want them to interact with each other or interact with the new particles heading to the substrate.

this sentence makes no sense to me. perhaps if you can explain the
issue, or better yet provide a minimal (small, fast to run and
complete) input deck to demonstrate/reproduce the issue, it may be
easier to suggest the most suitable option to achieve what you are
looking for.

axel.

Dear Dr. Axel:

As usual, your comment was so helpful. I used the variable loop along with the delete_atoms in the input file to remove the rebound parts. For the last part of my question, I was just letting you and others know what I am doing.

Again, thank you so much.

Regards.