Questions using bond segmental repulsive potential pair_style srp

Dear lammps users,

I am trying to use the segmental repulsive potential between bonds: pair_style srp.
In the documentation, an example is given as the following:

pair_style hybrid dpd 1.0 1.0 12345 srp 0.8 1 mid exclude yes
pair_coeff 1 1 dpd 60.0 4.5 1.0 
pair_coeff 1 2 none 
pair_coeff 2 2 srp 100.0 0.8 
In this example, since there is only 1 type of atom and 1 type of bond, the bptype is 2 (later explained in the documentation: where bptype is the largest atom type in the system).
My question is that what if I have 3 types atoms and 3 types of bonds in my system? How should I specify the type for the bonds of bptype? For example, what should I put the for the question marks in the following?

Dear lammps users,

I am trying to use the segmental repulsive potential between bonds:
pair_style srp.
In the documentation, an example is given as the following:

pair_style hybrid dpd 1.0 1.0 12345 srp 0.8 1 mid exclude yes
pair_coeff 1 1 dpd 60.0 4.5 1.0
pair_coeff 1 2 none
pair_coeff 2 2 srp 100.0 0.8

In this example, since there is only 1 type of atom and 1 type of bond, the
bptype is 2 (later explained in the documentation: where bptype is the
largest atom type in the system).

My question is that what if I have 3 types atoms and 3 types of bonds in my
system? How should I specify the type for the bonds of bptype? For example,
what should I put the for the question marks in the following?

pair_style hybrid dpd 1.0 1.0 12345 srp 0.8 * mid exclude yes

here is already a problem. you cannot do this. pair style srp requires
a numerical bond type. thus for multiple bond types, things become
complex and you would have to specify the srp style multiple times.
the rest should follow automatically. check out the hybrid style
documentation.

i don't think that this is an expected scenario, so you will be well
advised to set up some very simple test systems and validate the
correctness at each step or get back to the mailing list with test
examples that fail unexpectedly.

axel.

HI Aiqun - this patch will let srp forces be defined for all bonds (of any bond type) by a wildcard.

In the pair style command, use an asterisk instead of the integer bond type.

Tim

— …/fix_srp.cpp 2015-06-15 12:42:58.000000000 -0400
+++ fix_srp.cpp 2015-06-15 12:58:43.000000000 -0400
@@ -178,7 +178,9 @@
for (int n = 0; n < nbondlist; n++) {

// consider only the user defined bond type

  • if(bondlist[n][2] != btype) continue;
  • // btype of zero considers all bonds
  • if(btype > 0 && bondlist[n][2] != btype)
  • continue;

i = bondlist[n][0];
j = bondlist[n][1];
— …/pair_srp.cpp 2015-06-15 13:48:20.000000000 -0400
+++ pair_srp.cpp 2015-06-15 13:42:06.000000000 -0400
@@ -336,8 +336,16 @@
error->all(FLERR,“Illegal pair_style command”);

cut_global = force->numeric(FLERR,arg[0]);

  • btype = force->inumeric(FLERR,arg[1]);
  • if (btype > atom->nbondtypes) error->all(FLERR,“Illegal pair_style command”);
  • // wildcard
  • if (strcmp(arg[1],"*") == 0)
  • btype = 0;
  • else{
  • btype = force->inumeric(FLERR,arg[1]);
  • if (btype > atom->nbondtypes)
  • error->all(FLERR,“Illegal pair_style command”);
  • if (btype <= 0)
  • error->all(FLERR,“Illegal pair_style command”);
  • }

// settings
midpoint = 0;
@@ -702,4 +710,3 @@
}
MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world);
}

HI Aiqun - this patch will let srp forces be defined for all bonds (of any
bond type) by a wildcard.

hi tim,

since steve is extremely busy these days, i'm integrating this change
into LAMMPS-ICMS to feed it to him at a later point, when he has time
to integrate stuff into the upstream version.

while looking through the code, i noticed that pair_srp.cpp doesn't
seem to be compatible with defining it in a hybrid style multiple
times, since the matching fix always has the same name. but it also
doesn't check for it. is there are reason why it should not work to
define srp multiple times? it would be fairly straightforward to
generate a unique name for the fix id and then one could handle more
complex cases where multiple, but not all bond types need to be dealt
with. i'd be happy to integrate this as well, if you agree.

cheers,
      axel.

Hi Axel,

yes i do think pair srp would benefit from being more flexible, instead of a ‘one or all’ approach to the bond types. defining pair srp multiple times seems like a good approach. i think the code could do that, but it would need work in a couple places other than the fix id. the issue is that from the beginning only one atom type (for ‘bond particles’) was assumed to be needed. to use pair srp multiple times, multiple atom types of bond particles would need to be allowed, so that i-i, i-j, j-j, etc could be defined. along those lines, there is at least a consistency check in the fix, and some assumptions with neighbor exclusions and groups that would need to allow for other atom types. as you pointed out earlier, this wasn’t the expected usage. but it would be a nice upgrade. thanks - yes - i’d appreciate if you could add this patch to LAMMPS-ICMS. i’ll look through the code more carefully and possibly send another patch.

Tim

Hi Axel,

yes i do think pair srp would benefit from being more flexible, instead of a
'one or all' approach to the bond types. defining pair srp multiple times
seems like a good approach. i think the code could do that, but it would
need work in a couple places other than the fix id. the issue is that from
the beginning only one atom type (for 'bond particles') was assumed to be
needed. to use pair srp multiple times, multiple atom types of bond
particles would need to be allowed, so that i-i, i-j, j-j, etc could be
defined. along those lines, there is at least a consistency check in the
fix, and some assumptions with neighbor exclusions and groups that would
need to allow for other atom types. as you pointed out earlier, this wasn't
the expected usage. but it would be a nice upgrade. thanks - yes - i'd
appreciate if you could add this patch to LAMMPS-ICMS. i'll look through the
code more carefully and possibly send another patch.

check out what is available here. this already include the change for
unique fix ids.
http://git.lammps.org/git/?p=lammps-icms.git;a=tree;f=src/USER-MISC;hb=HEAD