Is there any option to ignore lost rigid body atoms (in rigid/small molecule style) ?

Hi all,

I am trying to use lammps to model a sandpile of non-spherical grains.
I am using “fix rigid/small” molecule style with a molecule template made of several spheres. Now, obviously, I would like to have the possibility that molecules (non-spherical grains) can fall out of my system and leave the simulation domain. In a sandpile made of spheres, I could realize this with a “thermo modify lost ignore” option. In that case, spheres could leave the system and there was no complain/error. However, in the case of “fix rigid/small” style, I get the following error upon an atom leaving the system and the simulation terminates.

Error message:

Rigid body atoms # missing on proc # at step #

Please note that there is no complain from the single spheres list (because I am using “lost ignore”), but it is the “rigid/small body” list that is complaining and is not letting me do what I need to do.

I am using lammps ver 15-May-2015. I would be very grateful if anyone has a suggestion or could help. I would be happy to provide the simulation script if anybody interested to look at it.

Thank you.

Best regards,

Hi all,

I am trying to use lammps to model a sandpile of non-spherical grains.
I am using "fix rigid/small" molecule style with a molecule template made of
several spheres. Now, obviously, I would like to have the possibility that
molecules (non-spherical grains) can fall out of my system and leave the
simulation domain. In a sandpile made of spheres, I could realize this with
a “thermo modify lost ignore” option. In that case, spheres could leave the
system and there was no complain/error. However, in the case of “fix
rigid/small” style, I get the following error upon an atom leaving the
system and the simulation terminates.

Error message:

Rigid body atoms # missing on proc # at step #

Please note that there is no complain from the single spheres list (because
I am using "lost ignore”), but it is the “rigid/small body" list that is
complaining and is not letting me do what I need to do.

i don't think that thermo_modify lost ignore is the right way to
remove anything that is not individual particles from your system.

i would try to extend the box and set up an "annihilation zone". then
run MD for some steps at a time and in between use delete_atoms mol
yes or something similar.
the problem is that you do not only "lose" some atoms, but you'll have
to delete the entire "molecule" in one go to not confuse the rigid
body integrator. you may need to experiment to see, if you can get
away with "run pre no post no", but is suspect you may need "run pre
yes post no"

axel.

Hi Alex,

Thank you for your help and reply.
I tried your suggestion and implemented

delete_atoms region <name_region> mol yes

command in the script. However, it did not work. I received the following error:

Error:

Cannot delete_atoms mol yes for non-molecular systems

The problem is my non-spherical particles have atom_style sphere (to be able to treat them as granular materials with Hertz normal and frictional contacts), even though they are defined later with

fix rigid/small molecule mol

If there is no other suggestion, my current conclusion is that a fix to this issue is required in future versions of lammps. It basically cannot run granular non-spherical particle simulations with one free boundary condition, because of its problem with a single particle of a rigid molecule leaving the boundary and the fact that it is not able to find and delete the whole molecule in its updated molecule list.

Here are my scripts for further inspection if somebody interested:

https://www.dropbox.com/sh/kh47x3ps42un4bq/AAA7mJ3mgA8arKPIGOXgsUwta?dl=0

Thank you.

Kind regards,

bruce,

please note that what you describe you want to do is not exactly an
intentional feature in LAMMPS. while it may be possible to adapt the
code to handle your case, the way this usually works is that the
person who needs a specific feature implemented, either sits down and
does it himself/herself or finds a way to entice somebody to implement
it (e.g. finding a collaborator and/or student intern with the
required expertise or contracting an expert/consultant/freelancer). a
very large chunk of LAMMPS was implemented like this.

just have a look at the (long) list of contributing authors (and that
doesn't list the numerous people contributing smaller changes and
bugfixes): http://lammps.sandia.gov/authors.html

axel.

Thank you for your remark, Axel. I am aware of this.
While I myself do not have the research support to focus on further development of LAMMPS, I feel responsible to find and document its capabilities and limits and to point out what needs to be further implemented to make it a better open source code for granular simulations especially does that are directed toward earth science topics and studies.

Kind regards,

Thank you for your remark, Axel. I am aware of this.
While I myself do not have the research support to focus on further
development of LAMMPS, I feel responsible to find and document its
capabilities and limits and to point out what needs to be further
implemented to make it a better open source code for granular simulations
especially does that are directed toward earth science topics and studies.

i've heard this kind of argument many times, and it is flawed:
- you claim (without proof) that something that is of great personal
interest to you would be rather of great interest to the wider
community. if it was, there would have been others asking about it. so
either that community is very small, they don't use or care about
LAMMPS or don't need the feature.
- open source software is not improved by people going around and
pointing out its shortcomings, but by people that get up and do
something about it.

while it is perfectly fine, that you don't want to put any effort or
time or money into this, please don't paint yourself as the savior of
open source software.at the same time. that is rather insulting to the
many people in a similar situation like yours that *did* and *do* make
an effort and sometimes struggle hard because they don't have a lot of
training, experience, or time for it and do it anyway. LAMMPS has
benefitted massively from them and they have my greatest respect.

...and to end on a more positive note: there is something odd about
the error message you report: it is inconsistent, that you can use fix
rigid/small with the molecule flag, yet delete_atoms claims that you
have a non-molecular system. looking into the source code reveals that
a one line change is needed in the source to the delete_atoms command.

diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp
index d5a7a8a..1a52854 100644
--- a/src/delete_atoms.cpp
+++ b/src/delete_atoms.cpp
@@ -722,7 +722,7 @@ void DeleteAtoms::options(int narg, char **arg)
       iarg += 2;
     } else if (strcmp(arg[iarg],"mol") == 0) {
       if (iarg+2 > narg) error->all(FLERR,"Illegal delete_atoms command");
- if (atom->molecular == 0)
+ if (atom->molecule_flag == 0)
         error->all(FLERR,"Cannot delete_atoms mol yes for "
                    "non-molecular systems");
       if (strcmp(arg[iarg+1],"yes") == 0) mol_flag = 1;

axel.

Hi Axel,

Thank you for your nice message. I am not the type of person who would answer your message with its specific tone. I am a postdoc at a university and thus do not have money to put into this or hire staff. I have not said that I would not contribute, I will do that, but when I think I can do something positive to the developers community who are much ahead of me in coding experience as you yourself mentioned. As is the nature of academic environment, our questions are original, so it is not a surprise that nobody has asked this feature yet, but it may/will come up again as the interest in earth science community for looking at the discrete and granular nature of geophysical and geological phenomena increases.

yes, I noticed the inconsistency of the message and that was the whole point of my message. I could use molecule style, made of spheres, but it was not officially considered as molecule inside the code structure.

Do I need to change this in the delete_atoms command file and re-compile the lammps library?
Shall or can I implement this in the development version of lammps, or it is already reported by you or your colleagues when you replied?

Kind regards,

Hi Axel,

[...]

Do I need to change this in the delete_atoms command file and re-compile the
lammps library?

yes.

Shall or can I implement this in the development version of lammps, or it is
already reported by you or your colleagues when you replied?

the diff was made from my personal branch.
http://git.lammps.org/git/?p=lammps-icms.git;a=commitdiff;h=221673e6bf9d111d8f6e4fca4ef99da262dd954b
the change will eventually make it to the upstream LAMMPS version,
together with other bugfixes, improvements and new contributed
features that accumulate in my branch.

axel.

Fix evaporate does something like what Axel suggests and has

a “molecule” option that invokes the more complicated logic to make

sure the entire molecule is deleted.

Steve

The change will be in the next patch - probably in a day or 2.

Steve

Fix evaporate does something like what Axel suggests and has
a "molecule" option that invokes the more complicated logic to make
sure the entire molecule is deleted.

​but it also needs to be patched. since in this case atom->molecular is 0,
the simplified logic that "atom->molecular != 1" means "atom->molecular ==
2" is invalid and leads to segfaults.

​you need to add this one liner.

​diff --git a/src/MISC/fix_evaporate.cpp b/src/MISC/fix_evaporate.cpp
index cbaa50d..8eca5c6 100644
--- a/src/MISC/fix_evaporate.cpp
+++ b/src/MISC/fix_evaporate.cpp
@@ -311,7 +311,7 @@ void FixEvaporate::pre_exchange()
               }
             }

- } else {
+ } else if (molecular == 2) {
             if (molatom[i] == 0) {
               index = molindex[i];
               ndeltopo[0] += onemols[index]->nbonds;

​axel.​

this was added to yesterday’s patch …

good catch - thanks,

Steve

this was added to yesterday's patch ...

​don't see it in the git/svn repo, though.

axel.​

will be in the next patch …

Steve

Thank you, Steve and Axel, for your help.

I implemented the delete_atoms approach in my simulation script. It did not give any error, but was not able to remove atoms from the system. I suspect it is related to the way granular molecules are treated. I will look at it further to find out and will write back about it.

The other approach, fix evaporate, suggested by Steve with the patch suggested by Axel, works perfectly and solves the issue. Without the patch, it gives segmentation fault.

Thank you.

Kind regards,
Bruce

Thank you, Steve and Axel, for your help.

I implemented the delete_atoms approach in my simulation script. It did
not give any error, but was not able to remove atoms from the system. I
suspect it is related to the way granular molecules are treated. I will
look at it further to find out and will write back about it.

​no, it has nothing to do with granular media. it is primarily a result of
not paying enough attention to details in my previous e-mails and to when
and how certain things are executed in LAMMPS. if you put a delete_atoms
command somewhere, it will be executed *right away* and then never again.
so you have to use a loop or use the every flag with run so it is being
called regularly. i got it to work with something like this:

run 200000 pre yes post no every 20
​&
                ​
"delete_atoms region
​ ​
del1 mol yes"
​&
                ​
"delete_atoms region del2 mol yes"
​&
                ​
"fix 3 all
​ ​
rigid/small molecule mol object"​

​that said. steve's suggestion of using fix evaporate is the better
solution​. LAMMPS has too many features...

​axel.​