git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@547 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -391,6 +391,7 @@ int Input::execute_command()
|
|||||||
|
|
||||||
if (!strcmp(command,"clear")) clear();
|
if (!strcmp(command,"clear")) clear();
|
||||||
else if (!strcmp(command,"echo")) echo();
|
else if (!strcmp(command,"echo")) echo();
|
||||||
|
else if (!strcmp(command,"if")) ifthenelse();
|
||||||
else if (!strcmp(command,"include")) include();
|
else if (!strcmp(command,"include")) include();
|
||||||
else if (!strcmp(command,"jump")) jump();
|
else if (!strcmp(command,"jump")) jump();
|
||||||
else if (!strcmp(command,"label")) label();
|
else if (!strcmp(command,"label")) label();
|
||||||
@ -416,6 +417,7 @@ int Input::execute_command()
|
|||||||
else if (!strcmp(command,"dipole")) dipole();
|
else if (!strcmp(command,"dipole")) dipole();
|
||||||
else if (!strcmp(command,"dump")) dump();
|
else if (!strcmp(command,"dump")) dump();
|
||||||
else if (!strcmp(command,"dump_modify")) dump_modify();
|
else if (!strcmp(command,"dump_modify")) dump_modify();
|
||||||
|
// else if (!strcmp(command,"ellipsoid")) ellipsoid();
|
||||||
else if (!strcmp(command,"fix")) fix();
|
else if (!strcmp(command,"fix")) fix();
|
||||||
else if (!strcmp(command,"fix_modify")) fix_modify();
|
else if (!strcmp(command,"fix_modify")) fix_modify();
|
||||||
else if (!strcmp(command,"group")) group_command();
|
else if (!strcmp(command,"group")) group_command();
|
||||||
@ -503,6 +505,39 @@ void Input::echo()
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void Input::ifthenelse()
|
||||||
|
{
|
||||||
|
if (narg != 5 && narg != 7) error->all("Illegal if command");
|
||||||
|
|
||||||
|
int flag = 0;
|
||||||
|
if (strcmp(arg[1],"==") == 0) {
|
||||||
|
if (atof(arg[0]) == atof(arg[2])) flag = 1;
|
||||||
|
} else if (strcmp(arg[1],"!=") == 0) {
|
||||||
|
if (atof(arg[0]) != atof(arg[2])) flag = 1;
|
||||||
|
} else if (strcmp(arg[1],"<") == 0) {
|
||||||
|
if (atof(arg[0]) < atof(arg[2])) flag = 1;
|
||||||
|
} else if (strcmp(arg[1],"<=") == 0) {
|
||||||
|
if (atof(arg[0]) <= atof(arg[2])) flag = 1;
|
||||||
|
} else if (strcmp(arg[1],">") == 0) {
|
||||||
|
if (atof(arg[0]) > atof(arg[2])) flag = 1;
|
||||||
|
} else if (strcmp(arg[1],">=") == 0) {
|
||||||
|
if (atof(arg[0]) >= atof(arg[2])) flag = 1;
|
||||||
|
} else error->all("Illegal if command");
|
||||||
|
|
||||||
|
if (strcmp(arg[3],"then") != 0) error->all("Illegal if command");
|
||||||
|
if (narg == 7 && strcmp(arg[5],"else") != 0)
|
||||||
|
error->all("Illegal if command");
|
||||||
|
|
||||||
|
char str[128] = "\0";
|
||||||
|
if (flag) strcpy(str,arg[4]);
|
||||||
|
else if (narg == 7) strcpy(str,arg[6]);
|
||||||
|
strcat(str,"\n");
|
||||||
|
|
||||||
|
if (strlen(str) > 1) char *tmp = one(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void Input::include()
|
void Input::include()
|
||||||
{
|
{
|
||||||
if (narg != 1) error->all("Illegal include command");
|
if (narg != 1) error->all("Illegal include command");
|
||||||
@ -789,6 +824,18 @@ void Input::dump_modify()
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/*
|
||||||
|
void Input::ellipsoid()
|
||||||
|
{
|
||||||
|
if (narg != 4) error->all("Illegal ellipsoid command");
|
||||||
|
if (domain->box_exist == 0)
|
||||||
|
error->all("Ellipsoid command before simulation box is defined");
|
||||||
|
atom->set_radii3(narg,arg);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
void Input::fix()
|
void Input::fix()
|
||||||
{
|
{
|
||||||
modify->add_fix(narg,arg);
|
modify->add_fix(narg,arg);
|
||||||
|
|||||||
@ -52,6 +52,7 @@ class Input : protected Pointers {
|
|||||||
|
|
||||||
void clear(); // input script commands
|
void clear(); // input script commands
|
||||||
void echo();
|
void echo();
|
||||||
|
void ifthenelse();
|
||||||
void include();
|
void include();
|
||||||
void jump();
|
void jump();
|
||||||
void label();
|
void label();
|
||||||
@ -77,6 +78,7 @@ class Input : protected Pointers {
|
|||||||
void dipole();
|
void dipole();
|
||||||
void dump();
|
void dump();
|
||||||
void dump_modify();
|
void dump_modify();
|
||||||
|
// void ellipsoid();
|
||||||
void fix();
|
void fix();
|
||||||
void fix_modify();
|
void fix_modify();
|
||||||
void group_command();
|
void group_command();
|
||||||
|
|||||||
Reference in New Issue
Block a user