git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@781 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -58,14 +58,12 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
options(narg-7,&arg[7]);
|
options(narg-7,&arg[7]);
|
||||||
|
|
||||||
// error check on region
|
// error check on region and its extent being inside simulation box
|
||||||
|
|
||||||
if (iregion == -1) error->all("Must specify a region in fix deposit");
|
if (iregion == -1) error->all("Must specify a region in fix deposit");
|
||||||
if (domain->regions[iregion]->interior == 0)
|
if (domain->regions[iregion]->interior == 0)
|
||||||
error->all("Must use region with side = in with fix deposit");
|
error->all("Must use region with side = in with fix deposit");
|
||||||
|
|
||||||
// store extent of region
|
|
||||||
|
|
||||||
xlo = domain->regions[iregion]->extent_xlo;
|
xlo = domain->regions[iregion]->extent_xlo;
|
||||||
xhi = domain->regions[iregion]->extent_xhi;
|
xhi = domain->regions[iregion]->extent_xhi;
|
||||||
ylo = domain->regions[iregion]->extent_ylo;
|
ylo = domain->regions[iregion]->extent_ylo;
|
||||||
@ -73,6 +71,18 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
zlo = domain->regions[iregion]->extent_zlo;
|
zlo = domain->regions[iregion]->extent_zlo;
|
||||||
zhi = domain->regions[iregion]->extent_zhi;
|
zhi = domain->regions[iregion]->extent_zhi;
|
||||||
|
|
||||||
|
if (domain->triclinic == 0) {
|
||||||
|
if (xlo < domain->boxlo[0] || xhi > domain->boxhi[0] ||
|
||||||
|
ylo < domain->boxlo[1] || yhi > domain->boxhi[1] ||
|
||||||
|
zlo < domain->boxlo[2] || zhi > domain->boxhi[2])
|
||||||
|
error->all("Deposition region extends outside simulation box");
|
||||||
|
} else {
|
||||||
|
if (xlo < domain->boxlo_bound[0] || xhi > domain->boxhi_bound[0] ||
|
||||||
|
ylo < domain->boxlo_bound[1] || yhi > domain->boxhi_bound[1] ||
|
||||||
|
zlo < domain->boxlo_bound[2] || zhi > domain->boxhi_bound[2])
|
||||||
|
error->all("Deposition region extends outside simulation box");
|
||||||
|
}
|
||||||
|
|
||||||
// setup scaling
|
// setup scaling
|
||||||
|
|
||||||
if (scaleflag && domain->lattice == NULL)
|
if (scaleflag && domain->lattice == NULL)
|
||||||
@ -106,15 +116,6 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
vzlo *= zscale;
|
vzlo *= zscale;
|
||||||
vzhi *= zscale;
|
vzhi *= zscale;
|
||||||
|
|
||||||
// store extent of region
|
|
||||||
|
|
||||||
xlo = domain->regions[iregion]->extent_xlo;
|
|
||||||
xhi = domain->regions[iregion]->extent_xhi;
|
|
||||||
ylo = domain->regions[iregion]->extent_ylo;
|
|
||||||
yhi = domain->regions[iregion]->extent_yhi;
|
|
||||||
zlo = domain->regions[iregion]->extent_zlo;
|
|
||||||
zhi = domain->regions[iregion]->extent_zhi;
|
|
||||||
|
|
||||||
// random number generator, same for all procs
|
// random number generator, same for all procs
|
||||||
|
|
||||||
random = new RanPark(lmp,seed);
|
random = new RanPark(lmp,seed);
|
||||||
|
|||||||
@ -19,51 +19,59 @@
|
|||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
|
#define BIG 1.0e20
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
|
RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
|
||||||
{
|
{
|
||||||
options(narg-8,&arg[8]);
|
options(narg-8,&arg[8]);
|
||||||
|
|
||||||
if (strcmp(arg[2],"INF") == 0) {
|
if (strcmp(arg[2],"INF") == 0 || strcmp(arg[2],"EDGE") == 0) {
|
||||||
if (domain->box_exist == 0)
|
if (domain->box_exist == 0)
|
||||||
error->all("Cannot use region INF when box does not exist");
|
error->all("Cannot use region INF or EDGE when box does not exist");
|
||||||
if (domain->triclinic == 0) xlo = domain->boxlo[0];
|
if (strcmp(arg[2],"INF") == 0) xlo = -BIG;
|
||||||
|
else if (domain->triclinic == 0) xlo = domain->boxlo[0];
|
||||||
else xlo = domain->boxlo_bound[0];
|
else xlo = domain->boxlo_bound[0];
|
||||||
} else xlo = xscale*atof(arg[2]);
|
} else xlo = xscale*atof(arg[2]);
|
||||||
|
|
||||||
if (strcmp(arg[3],"INF") == 0) {
|
if (strcmp(arg[3],"INF") == 0 || strcmp(arg[3],"EDGE") == 0) {
|
||||||
if (domain->box_exist == 0)
|
if (domain->box_exist == 0)
|
||||||
error->all("Cannot use region INF when box does not exist");
|
error->all("Cannot use region INF or EDGE when box does not exist");
|
||||||
if (domain->triclinic == 0) xhi = domain->boxhi[0];
|
if (strcmp(arg[3],"INF") == 0) xhi = BIG;
|
||||||
|
else if (domain->triclinic == 0) xhi = domain->boxhi[0];
|
||||||
else xhi = domain->boxhi_bound[0];
|
else xhi = domain->boxhi_bound[0];
|
||||||
} else xhi = xscale*atof(arg[3]);
|
} else xhi = xscale*atof(arg[3]);
|
||||||
|
|
||||||
if (strcmp(arg[4],"INF") == 0) {
|
if (strcmp(arg[4],"INF") == 0 || strcmp(arg[4],"EDGE") == 0) {
|
||||||
if (domain->box_exist == 0)
|
if (domain->box_exist == 0)
|
||||||
error->all("Cannot use region INF when box does not exist");
|
error->all("Cannot use region INF or EDGE when box does not exist");
|
||||||
if (domain->triclinic == 0) ylo = domain->boxlo[1];
|
if (strcmp(arg[4],"INF") == 0) ylo = -BIG;
|
||||||
|
else if (domain->triclinic == 0) ylo = domain->boxlo[1];
|
||||||
else ylo = domain->boxlo_bound[1];
|
else ylo = domain->boxlo_bound[1];
|
||||||
} else ylo = yscale*atof(arg[4]);
|
} else ylo = yscale*atof(arg[4]);
|
||||||
|
|
||||||
if (strcmp(arg[5],"INF") == 0) {
|
if (strcmp(arg[5],"INF") == 0 || strcmp(arg[5],"EDGE") == 0) {
|
||||||
if (domain->box_exist == 0)
|
if (domain->box_exist == 0)
|
||||||
error->all("Cannot use region INF when box does not exist");
|
error->all("Cannot use region INF or EDGE when box does not exist");
|
||||||
if (domain->triclinic == 0) yhi = domain->boxhi[1];
|
if (strcmp(arg[5],"INF") == 0) yhi = BIG;
|
||||||
|
else if (domain->triclinic == 0) yhi = domain->boxhi[1];
|
||||||
else yhi = domain->boxhi_bound[1];
|
else yhi = domain->boxhi_bound[1];
|
||||||
} else yhi = yscale*atof(arg[5]);
|
} else yhi = yscale*atof(arg[5]);
|
||||||
|
|
||||||
if (strcmp(arg[6],"INF") == 0) {
|
if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
|
||||||
if (domain->box_exist == 0)
|
if (domain->box_exist == 0)
|
||||||
error->all("Cannot use region INF when box does not exist");
|
error->all("Cannot use region INF or EDGE when box does not exist");
|
||||||
if (domain->triclinic == 0) zlo = domain->boxlo[2];
|
if (strcmp(arg[6],"INF") == 0) zlo = -BIG;
|
||||||
|
else if (domain->triclinic == 0) zlo = domain->boxlo[2];
|
||||||
else zlo = domain->boxlo_bound[2];
|
else zlo = domain->boxlo_bound[2];
|
||||||
} else zlo = zscale*atof(arg[6]);
|
} else zlo = zscale*atof(arg[6]);
|
||||||
|
|
||||||
if (strcmp(arg[7],"INF") == 0) {
|
if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) {
|
||||||
if (domain->box_exist == 0)
|
if (domain->box_exist == 0)
|
||||||
error->all("Cannot use region INF when box does not exist");
|
error->all("Cannot use region INF or EDGE when box does not exist");
|
||||||
if (domain->triclinic == 0) zhi = domain->boxhi[2];
|
if (strcmp(arg[7],"INF") == 0) zhi = BIG;
|
||||||
|
else if (domain->triclinic == 0) zhi = domain->boxhi[2];
|
||||||
else zhi = domain->boxhi_bound[2];
|
else zhi = domain->boxhi_bound[2];
|
||||||
} else zhi = zscale*atof(arg[7]);
|
} else zhi = zscale*atof(arg[7]);
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,8 @@
|
|||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
|
#define BIG 1.0e20
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
|
RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
|
||||||
@ -43,19 +45,22 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
}
|
}
|
||||||
radius = xscale*atof(arg[5]);
|
radius = xscale*atof(arg[5]);
|
||||||
|
|
||||||
if (strcmp(arg[6],"INF") == 0) {
|
if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
|
||||||
if (domain->box_exist == 0)
|
if (domain->box_exist == 0)
|
||||||
error->all("Cannot use region INF when box does not exist");
|
error->all("Cannot use region INF or EDGE when box does not exist");
|
||||||
if (axis == 'x') {
|
if (axis == 'x') {
|
||||||
if (domain->triclinic == 0) lo = domain->boxlo[0];
|
if (strcmp(arg[6],"INF") == 0) lo = -BIG;
|
||||||
|
else if (domain->triclinic == 0) lo = domain->boxlo[0];
|
||||||
else lo = domain->boxlo_bound[0];
|
else lo = domain->boxlo_bound[0];
|
||||||
}
|
}
|
||||||
if (axis == 'y') {
|
if (axis == 'y') {
|
||||||
if (domain->triclinic == 0) lo = domain->boxlo[1];
|
if (strcmp(arg[6],"INF") == 0) lo = -BIG;
|
||||||
|
else if (domain->triclinic == 0) lo = domain->boxlo[1];
|
||||||
else lo = domain->boxlo_bound[1];
|
else lo = domain->boxlo_bound[1];
|
||||||
}
|
}
|
||||||
if (axis == 'z') {
|
if (axis == 'z') {
|
||||||
if (domain->triclinic == 0) lo = domain->boxlo[2];
|
if (strcmp(arg[6],"INF") == 0) lo = -BIG;
|
||||||
|
else if (domain->triclinic == 0) lo = domain->boxlo[2];
|
||||||
else lo = domain->boxlo_bound[2];
|
else lo = domain->boxlo_bound[2];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -64,19 +69,22 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (axis == 'z') lo = zscale*atof(arg[6]);
|
if (axis == 'z') lo = zscale*atof(arg[6]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(arg[7],"INF") == 0) {
|
if (strcmp(arg[7],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
|
||||||
if (domain->box_exist == 0)
|
if (domain->box_exist == 0)
|
||||||
error->all("Cannot use region INF when box does not exist");
|
error->all("Cannot use region INF or EDGE when box does not exist");
|
||||||
if (axis == 'x') {
|
if (axis == 'x') {
|
||||||
if (domain->triclinic == 0) hi = domain->boxhi[0];
|
if (strcmp(arg[7],"INF") == 0) hi = BIG;
|
||||||
|
else if (domain->triclinic == 0) hi = domain->boxhi[0];
|
||||||
else hi = domain->boxhi_bound[0];
|
else hi = domain->boxhi_bound[0];
|
||||||
}
|
}
|
||||||
if (axis == 'y') {
|
if (axis == 'y') {
|
||||||
|
if (strcmp(arg[7],"INF") == 0) hi = BIG;
|
||||||
if (domain->triclinic == 0) hi = domain->boxhi[1];
|
if (domain->triclinic == 0) hi = domain->boxhi[1];
|
||||||
else hi = domain->boxhi_bound[1];
|
else hi = domain->boxhi_bound[1];
|
||||||
}
|
}
|
||||||
if (axis == 'z') {
|
if (axis == 'z') {
|
||||||
if (domain->triclinic == 0) hi = domain->boxhi[2];
|
if (strcmp(arg[7],"INF") == 0) hi = BIG;
|
||||||
|
else if (domain->triclinic == 0) hi = domain->boxhi[2];
|
||||||
else hi = domain->boxhi_bound[2];
|
else hi = domain->boxhi_bound[2];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
|
#define BIG 1.0e20
|
||||||
|
|
||||||
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
|
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
|
||||||
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
|
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
|
||||||
|
|
||||||
@ -33,40 +35,46 @@ RegPrism::RegPrism(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg)
|
|||||||
{
|
{
|
||||||
options(narg-11,&arg[11]);
|
options(narg-11,&arg[11]);
|
||||||
|
|
||||||
if (strcmp(arg[2],"INF") == 0) {
|
if (strcmp(arg[2],"INF") == 0 || strcmp(arg[2],"EDGE") == 0) {
|
||||||
if (domain->box_exist == 0)
|
if (domain->box_exist == 0)
|
||||||
error->all("Cannot use region INF when box does not exist");
|
error->all("Cannot use region INF or EDGE when box does not exist");
|
||||||
xlo = domain->boxlo[0];
|
if (strcmp(arg[2],"INF") == 0) xlo = -BIG;
|
||||||
|
else xlo = domain->boxlo[0];
|
||||||
} else xlo = xscale*atof(arg[2]);
|
} else xlo = xscale*atof(arg[2]);
|
||||||
|
|
||||||
if (strcmp(arg[3],"INF") == 0) {
|
if (strcmp(arg[3],"INF") == 0 || strcmp(arg[3],"EDGE") == 0) {
|
||||||
if (domain->box_exist == 0)
|
if (domain->box_exist == 0)
|
||||||
error->all("Cannot use region INF when box does not exist");
|
error->all("Cannot use region INF or EDGE when box does not exist");
|
||||||
xhi = domain->boxhi[0];
|
if (strcmp(arg[3],"INF") == 0) xhi = BIG;
|
||||||
|
else xhi = domain->boxhi[0];
|
||||||
} else xhi = xscale*atof(arg[3]);
|
} else xhi = xscale*atof(arg[3]);
|
||||||
|
|
||||||
if (strcmp(arg[4],"INF") == 0) {
|
if (strcmp(arg[4],"INF") == 0 || strcmp(arg[4],"EDGE") == 0) {
|
||||||
if (domain->box_exist == 0)
|
if (domain->box_exist == 0)
|
||||||
error->all("Cannot use region INF when box does not exist");
|
error->all("Cannot use region INF or EDGE when box does not exist");
|
||||||
ylo = domain->boxlo[1];
|
if (strcmp(arg[4],"INF") == 0) ylo = -BIG;
|
||||||
|
else ylo = domain->boxlo[1];
|
||||||
} else ylo = yscale*atof(arg[4]);
|
} else ylo = yscale*atof(arg[4]);
|
||||||
|
|
||||||
if (strcmp(arg[5],"INF") == 0) {
|
if (strcmp(arg[5],"INF") == 0 || strcmp(arg[5],"EDGE") == 0) {
|
||||||
if (domain->box_exist == 0)
|
if (domain->box_exist == 0)
|
||||||
error->all("Cannot use region INF when box does not exist");
|
error->all("Cannot use region INF or EDGE when box does not exist");
|
||||||
yhi = domain->boxhi[1];
|
if (strcmp(arg[5],"INF") == 0) yhi = BIG;
|
||||||
|
else yhi = domain->boxhi[1];
|
||||||
} else yhi = yscale*atof(arg[5]);
|
} else yhi = yscale*atof(arg[5]);
|
||||||
|
|
||||||
if (strcmp(arg[6],"INF") == 0) {
|
if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) {
|
||||||
if (domain->box_exist == 0)
|
if (domain->box_exist == 0)
|
||||||
error->all("Cannot use region INF when box does not exist");
|
error->all("Cannot use region INF or EDGE when box does not exist");
|
||||||
zlo = domain->boxlo[0];
|
if (strcmp(arg[6],"INF") == 0) zlo = -BIG;
|
||||||
|
else zlo = domain->boxlo[2];
|
||||||
} else zlo = zscale*atof(arg[6]);
|
} else zlo = zscale*atof(arg[6]);
|
||||||
|
|
||||||
if (strcmp(arg[7],"INF") == 0) {
|
if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) {
|
||||||
if (domain->box_exist == 0)
|
if (domain->box_exist == 0)
|
||||||
error->all("Cannot use region INF when box does not exist");
|
error->all("Cannot use region INF or EDGE when box does not exist");
|
||||||
zhi = domain->boxhi[1];
|
if (strcmp(arg[7],"INF") == 0) zhi = BIG;
|
||||||
|
else zhi = domain->boxhi[2];
|
||||||
} else zhi = zscale*atof(arg[7]);
|
} else zhi = zscale*atof(arg[7]);
|
||||||
|
|
||||||
xy = xscale*atof(arg[8]);
|
xy = xscale*atof(arg[8]);
|
||||||
|
|||||||
Reference in New Issue
Block a user