git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6154 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -117,23 +117,43 @@ void Force::init()
|
||||
create a pair style, called from input script or restart file
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Force::create_pair(const char *style)
|
||||
void Force::create_pair(const char *style, char *suffix)
|
||||
{
|
||||
delete [] pair_style;
|
||||
if (pair) delete pair;
|
||||
|
||||
pair = new_pair(style);
|
||||
pair = new_pair(style,suffix);
|
||||
int n = strlen(style) + 1;
|
||||
pair_style = new char[n];
|
||||
strcpy(pair_style,style);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
generate a pair class
|
||||
generate a pair class, first with suffix appended
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
Pair *Force::new_pair(const char *style)
|
||||
Pair *Force::new_pair(const char *style, char *suffix)
|
||||
{
|
||||
int success = 0;
|
||||
|
||||
if (suffix) {
|
||||
char estyle[256];
|
||||
sprintf(estyle,"%s/%s",style,suffix);
|
||||
success = 1;
|
||||
|
||||
if (0) return NULL;
|
||||
|
||||
#define PAIR_CLASS
|
||||
#define PairStyle(key,Class) \
|
||||
else if (strcmp(estyle,#key) == 0) return new Class(lmp);
|
||||
#include "style_pair.h"
|
||||
#undef PairStyle
|
||||
#undef PAIR_CLASS
|
||||
|
||||
else success = 0;
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
if (strcmp(style,"none") == 0) return NULL;
|
||||
|
||||
#define PAIR_CLASS
|
||||
@ -143,6 +163,8 @@ Pair *Force::new_pair(const char *style)
|
||||
#undef PAIR_CLASS
|
||||
|
||||
else error->all("Invalid pair style");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -64,8 +64,8 @@ class Force : protected Pointers {
|
||||
~Force();
|
||||
void init();
|
||||
|
||||
void create_pair(const char *);
|
||||
class Pair *new_pair(const char *);
|
||||
void create_pair(const char *, char *suffix = NULL);
|
||||
class Pair *new_pair(const char *, char *suffix = NULL);
|
||||
class Pair *pair_match(const char *, int);
|
||||
|
||||
void create_bond(const char *);
|
||||
|
||||
Reference in New Issue
Block a user