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

This commit is contained in:
sjplimp
2011-02-11 15:37:55 +00:00
parent b754d37a02
commit 557c982bf4
4 changed files with 13 additions and 7 deletions

View File

@ -397,10 +397,6 @@ void Velocity::set(int narg, char **arg)
// check variables
int dimension = domain->dimension;
if (dimension == 2 && zstyle)
error->all("Cannot set z velocity for 2d simulation");
if (xstr) {
xvar = input->variable->find(xstr);
if (xvar < 0) error->all("Variable name for velocity set does not exist");
@ -429,6 +425,15 @@ void Velocity::set(int narg, char **arg)
varflag = EQUAL;
else varflag = CONSTANT;
// error check for 2d models
if (domain->dimension == 2) {
if (zstyle == CONSTANT && vz != 0.0)
error->all("Cannot set non-zero z velocity for 2d simulation");
if (zstyle == EQUAL || zstyle == ATOM)
error->all("Cannot set varaible z velocity for 2d simulation");
}
// allocate vfield array if necessary
double **vfield = NULL;