git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14157 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2015-10-21 23:13:53 +00:00
parent 4ce32a301c
commit 46e7b64176
2 changed files with 6 additions and 3 deletions

View File

@ -198,10 +198,11 @@ Pair *Force::pair_creator(LAMMPS *lmp)
return ptr to Pair class if matches word or matches hybrid sub-style return ptr to Pair class if matches word or matches hybrid sub-style
if exact, then style name must be exact match to word if exact, then style name must be exact match to word
if not exact, style name must contain word if not exact, style name must contain word
return NULL if no match or multiple sub-styles match if nsub > 0, match Nth hybrid sub-style
return NULL if no match or if nsub=0 and multiple sub-styles match
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
Pair *Force::pair_match(const char *word, int exact) Pair *Force::pair_match(const char *word, int exact, int nsub)
{ {
int iwhich,count; int iwhich,count;
@ -216,6 +217,7 @@ Pair *Force::pair_match(const char *word, int exact)
(!exact && strstr(hybrid->keywords[i],word))) { (!exact && strstr(hybrid->keywords[i],word))) {
iwhich = i; iwhich = i;
count++; count++;
if (nsub == count) return hybrid->styles[iwhich];
} }
if (count == 1) return hybrid->styles[iwhich]; if (count == 1) return hybrid->styles[iwhich];
@ -227,6 +229,7 @@ Pair *Force::pair_match(const char *word, int exact)
(!exact && strstr(hybrid->keywords[i],word))) { (!exact && strstr(hybrid->keywords[i],word))) {
iwhich = i; iwhich = i;
count++; count++;
if (nsub == count) return hybrid->styles[iwhich];
} }
if (count == 1) return hybrid->styles[iwhich]; if (count == 1) return hybrid->styles[iwhich];
} }

View File

@ -80,7 +80,7 @@ class Force : protected Pointers {
void create_pair(const char *, int); void create_pair(const char *, int);
class Pair *new_pair(const char *, int, int &); class Pair *new_pair(const char *, int, int &);
class Pair *pair_match(const char *, int); class Pair *pair_match(const char *, int, int nsub=0);
void create_bond(const char *, int); void create_bond(const char *, int);
class Bond *new_bond(const char *, int, int &); class Bond *new_bond(const char *, int, int &);