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

This commit is contained in:
sjplimp
2010-08-19 16:01:08 +00:00
parent ad1adc6474
commit 5ff00cfd0f
15 changed files with 118 additions and 8 deletions

View File

@ -53,6 +53,7 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
// set defaults
iregion = -1;
idregion = NULL;
globalflag = localflag = 0;
lo = hi = deltasq = 0.0;
nearsq = 0.0;
@ -142,6 +143,7 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
FixDeposit::~FixDeposit()
{
delete random;
delete [] idregion;
}
/* ---------------------------------------------------------------------- */
@ -153,6 +155,16 @@ int FixDeposit::setmask()
return mask;
}
/* ---------------------------------------------------------------------- */
void FixDeposit::init()
{
// set index and check validity of region
iregion = domain->find_region(idregion);
if (iregion == -1) error->all("Region ID for fix deposit does not exist");
}
/* ----------------------------------------------------------------------
perform particle insertion
------------------------------------------------------------------------- */
@ -350,7 +362,11 @@ void FixDeposit::options(int narg, char **arg)
if (strcmp(arg[iarg],"region") == 0) {
if (iarg+2 > narg) error->all("Illegal fix deposit command");
iregion = domain->find_region(arg[iarg+1]);
if (iregion == -1) error->all("Fix deposit region ID does not exist");
if (iregion == -1)
error->all("Region ID for fix deposit does not exist");
int n = strlen(arg[iarg+1]) + 1;
idregion = new char[n];
strcpy(idregion,arg[iarg+1]);
iarg += 2;
} else if (strcmp(arg[iarg],"global") == 0) {
if (iarg+3 > narg) error->all("Illegal fix deposit command");