From ae07e039c577a00c5ca5c71c3cfec8ad9b096f0e Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 20 May 2011 15:53:02 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6157 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/input.cpp | 24 ++++++++++++++++++++---- src/input.h | 3 ++- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 0861c96cc2..de4dcb97e9 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -42,6 +42,7 @@ #include "neighbor.h" #include "special.h" #include "variable.h" +#include "accelerator.h" #include "error.h" #include "memory.h" @@ -417,6 +418,7 @@ int Input::execute_command() else if (!strcmp(command,"shell")) shell(); else if (!strcmp(command,"variable")) variable_command(); + else if (!strcmp(command,"accelerator")) accelerator(); else if (!strcmp(command,"angle_coeff")) angle_coeff(); else if (!strcmp(command,"angle_style")) angle_style(); else if (!strcmp(command,"atom_modify")) atom_modify(); @@ -801,6 +803,20 @@ void Input::variable_command() one function for each LAMMPS-specific input script command ------------------------------------------------------------------------- */ +void Input::accelerator() +{ + if (domain->box_exist) + error->all("Accelerator command after simulation box is defined"); + if (narg < 1) error->all("Illegal accelerator command"); + if (strcmp(lmp->asuffix,arg[0]) != 0) + error->all("Accelerator command requires matching command-line -a switch"); + + if (strcmp(arg[0],"cuda") == 0) lmp->cuda->accelerator(narg-1,&arg[1]); + else error->all("Illegal accelerator command"); +} + +/* ---------------------------------------------------------------------- */ + void Input::angle_coeff() { if (domain->box_exist == 0) @@ -837,7 +853,7 @@ void Input::atom_style() if (narg < 1) error->all("Illegal atom_style command"); if (domain->box_exist) error->all("Atom_style command after simulation box is defined"); - atom->create_avec(arg[0],narg-1,&arg[1]); + atom->create_avec(arg[0],narg-1,&arg[1],lmp->asuffix); } /* ---------------------------------------------------------------------- */ @@ -884,7 +900,7 @@ void Input::communicate() void Input::compute() { - modify->add_compute(narg,arg); + modify->add_compute(narg,arg,lmp->asuffix); } /* ---------------------------------------------------------------------- */ @@ -962,7 +978,7 @@ void Input::dump_modify() void Input::fix() { - modify->add_fix(narg,arg); + modify->add_fix(narg,arg,lmp->asuffix); } /* ---------------------------------------------------------------------- */ @@ -1132,7 +1148,7 @@ void Input::pair_style() force->pair->settings(narg-1,&arg[1]); return; } - force->create_pair(arg[0]); + force->create_pair(arg[0],lmp->asuffix); if (force->pair) force->pair->settings(narg-1,&arg[1]); } diff --git a/src/input.h b/src/input.h index cbd27881ef..2aac7e9646 100644 --- a/src/input.h +++ b/src/input.h @@ -61,7 +61,8 @@ class Input : protected Pointers { void shell(); void variable_command(); - void angle_coeff(); // LAMMPS commands + void accelerator(); // LAMMPS commands + void angle_coeff(); void angle_style(); void atom_modify(); void atom_style();