git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15324 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -38,6 +38,7 @@ using namespace MathConst;
|
|||||||
|
|
||||||
enum{ATOM,MOLECULE};
|
enum{ATOM,MOLECULE};
|
||||||
enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED}; // several files
|
enum{LAYOUT_UNIFORM,LAYOUT_NONUNIFORM,LAYOUT_TILED}; // several files
|
||||||
|
enum{DIST_UNIFORM,DIST_GAUSSIAN};
|
||||||
|
|
||||||
#define EPSILON 1.0e6
|
#define EPSILON 1.0e6
|
||||||
|
|
||||||
@ -169,6 +170,10 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
vyhi *= yscale;
|
vyhi *= yscale;
|
||||||
vzlo *= zscale;
|
vzlo *= zscale;
|
||||||
vzhi *= zscale;
|
vzhi *= zscale;
|
||||||
|
xmid *= xscale;
|
||||||
|
ymid *= yscale;
|
||||||
|
zmid *= zscale;
|
||||||
|
sigma *= xscale; // same as in region sphere
|
||||||
tx *= xscale;
|
tx *= xscale;
|
||||||
ty *= yscale;
|
ty *= yscale;
|
||||||
tz *= zscale;
|
tz *= zscale;
|
||||||
@ -336,15 +341,19 @@ void FixDeposit::pre_exchange()
|
|||||||
attempt++;
|
attempt++;
|
||||||
|
|
||||||
// choose random position for new particle within region
|
// choose random position for new particle within region
|
||||||
|
if (distflag == DIST_UNIFORM) {
|
||||||
coord[0] = xlo + random->uniform() * (xhi-xlo);
|
do {
|
||||||
coord[1] = ylo + random->uniform() * (yhi-ylo);
|
coord[0] = xlo + random->uniform() * (xhi-xlo);
|
||||||
coord[2] = zlo + random->uniform() * (zhi-zlo);
|
coord[1] = ylo + random->uniform() * (yhi-ylo);
|
||||||
while (domain->regions[iregion]->match(coord[0],coord[1],coord[2]) == 0) {
|
coord[2] = zlo + random->uniform() * (zhi-zlo);
|
||||||
coord[0] = xlo + random->uniform() * (xhi-xlo);
|
} while (domain->regions[iregion]->match(coord[0],coord[1],coord[2]) == 0);
|
||||||
coord[1] = ylo + random->uniform() * (yhi-ylo);
|
} else if (distflag == DIST_GAUSSIAN) {
|
||||||
coord[2] = zlo + random->uniform() * (zhi-zlo);
|
do {
|
||||||
}
|
coord[0] = xmid + random->gaussian() * sigma;
|
||||||
|
coord[1] = ymid + random->gaussian() * sigma;
|
||||||
|
coord[2] = zmid + random->gaussian() * sigma;
|
||||||
|
} while (domain->regions[iregion]->match(coord[0],coord[1],coord[2]) == 0);
|
||||||
|
} else error->all(FLERR,"Unknown particle distribution in fix deposit");
|
||||||
|
|
||||||
// adjust vertical coord by offset
|
// adjust vertical coord by offset
|
||||||
|
|
||||||
@ -644,6 +653,9 @@ void FixDeposit::options(int narg, char **arg)
|
|||||||
maxattempt = 10;
|
maxattempt = 10;
|
||||||
rateflag = 0;
|
rateflag = 0;
|
||||||
vxlo = vxhi = vylo = vyhi = vzlo = vzhi = 0.0;
|
vxlo = vxhi = vylo = vyhi = vzlo = vzhi = 0.0;
|
||||||
|
distflag = DIST_UNIFORM;
|
||||||
|
sigma = 1.0;
|
||||||
|
xmid = ymid = zmid = 0.0;
|
||||||
scaleflag = 1;
|
scaleflag = 1;
|
||||||
targetflag = 0;
|
targetflag = 0;
|
||||||
|
|
||||||
@ -759,6 +771,14 @@ void FixDeposit::options(int narg, char **arg)
|
|||||||
else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
|
else if (strcmp(arg[iarg+1],"lattice") == 0) scaleflag = 1;
|
||||||
else error->all(FLERR,"Illegal fix deposit command");
|
else error->all(FLERR,"Illegal fix deposit command");
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
|
} else if (strcmp(arg[iarg],"gaussian") == 0) {
|
||||||
|
if (iarg+5 > narg) error->all(FLERR,"Illegal fix deposit command");
|
||||||
|
xmid = force->numeric(FLERR,arg[iarg+1]);
|
||||||
|
ymid = force->numeric(FLERR,arg[iarg+2]);
|
||||||
|
zmid = force->numeric(FLERR,arg[iarg+3]);
|
||||||
|
sigma = force->numeric(FLERR,arg[iarg+4]);
|
||||||
|
distflag = DIST_GAUSSIAN;
|
||||||
|
iarg += 5;
|
||||||
} else if (strcmp(arg[iarg],"target") == 0) {
|
} else if (strcmp(arg[iarg],"target") == 0) {
|
||||||
if (iarg+4 > narg) error->all(FLERR,"Illegal fix deposit command");
|
if (iarg+4 > narg) error->all(FLERR,"Illegal fix deposit command");
|
||||||
tx = force->numeric(FLERR,arg[iarg+1]);
|
tx = force->numeric(FLERR,arg[iarg+1]);
|
||||||
|
|||||||
@ -39,10 +39,10 @@ class FixDeposit : public Fix {
|
|||||||
private:
|
private:
|
||||||
int ninsert,ntype,nfreq,seed;
|
int ninsert,ntype,nfreq,seed;
|
||||||
int iregion,globalflag,localflag,maxattempt,rateflag,scaleflag,targetflag;
|
int iregion,globalflag,localflag,maxattempt,rateflag,scaleflag,targetflag;
|
||||||
int mode,rigidflag,shakeflag,idnext;
|
int mode,rigidflag,shakeflag,idnext,distflag;
|
||||||
double lo,hi,deltasq,nearsq,rate;
|
double lo,hi,deltasq,nearsq,rate,sigma;
|
||||||
double vxlo,vxhi,vylo,vyhi,vzlo,vzhi;
|
double vxlo,vxhi,vylo,vyhi,vzlo,vzhi;
|
||||||
double xlo,xhi,ylo,yhi,zlo,zhi;
|
double xlo,xhi,ylo,yhi,zlo,zhi,xmid,ymid,zmid;
|
||||||
double tx,ty,tz;
|
double tx,ty,tz;
|
||||||
char *idregion;
|
char *idregion;
|
||||||
char *idrigid,*idshake;
|
char *idrigid,*idshake;
|
||||||
|
|||||||
@ -133,7 +133,7 @@ void Compute::modify_params(int narg, char **arg)
|
|||||||
while (iarg < narg) {
|
while (iarg < narg) {
|
||||||
if (strcmp(arg[iarg],"extra") == 0) {
|
if (strcmp(arg[iarg],"extra") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal compute_modify command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal compute_modify command");
|
||||||
extra_dof = force->inumeric(FLERR,arg[iarg+1]);
|
extra_dof = force->numeric(FLERR,arg[iarg+1]);
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
} else if (strcmp(arg[iarg],"dynamic") == 0) {
|
} else if (strcmp(arg[iarg],"dynamic") == 0) {
|
||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal compute_modify command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal compute_modify command");
|
||||||
|
|||||||
@ -147,7 +147,7 @@ class Compute : protected Pointers {
|
|||||||
int instance_me; // which Compute class instantiation I am
|
int instance_me; // which Compute class instantiation I am
|
||||||
|
|
||||||
double natoms_temp; // # of atoms used for temperature calculation
|
double natoms_temp; // # of atoms used for temperature calculation
|
||||||
int extra_dof; // extra DOF for temperature computes
|
double extra_dof; // extra DOF for temperature computes
|
||||||
int fix_dof; // DOF due to fixes
|
int fix_dof; // DOF due to fixes
|
||||||
int dynamic; // recount atoms for temperature computes
|
int dynamic; // recount atoms for temperature computes
|
||||||
int dynamic_user; // user request for temp compute to be dynamic
|
int dynamic_user; // user request for temp compute to be dynamic
|
||||||
|
|||||||
@ -262,7 +262,7 @@ void Info::command(int narg, char **arg)
|
|||||||
fprintf(out,"Communication cutoff for type %d = %g\n", i, cut);
|
fprintf(out,"Communication cutoff for type %d = %g\n", i, cut);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf(out,"Nprocs = %d Nthreads = %d\n",
|
fprintf(out,"Nprocs = %d, Nthreads = %d\n",
|
||||||
comm->nprocs, comm->nthreads);
|
comm->nprocs, comm->nthreads);
|
||||||
fprintf(out,"Processor grid = %d x %d x %d\n",comm->procgrid[0],
|
fprintf(out,"Processor grid = %d x %d x %d\n",comm->procgrid[0],
|
||||||
comm->procgrid[1], comm->procgrid[2]);
|
comm->procgrid[1], comm->procgrid[2]);
|
||||||
@ -411,7 +411,7 @@ void Info::command(int narg, char **arg)
|
|||||||
fprintf(out,"\nVariable information:\n");
|
fprintf(out,"\nVariable information:\n");
|
||||||
for (int i=0; i < nvar; ++i) {
|
for (int i=0; i < nvar; ++i) {
|
||||||
int ndata = 1;
|
int ndata = 1;
|
||||||
fprintf(out,"Variable[%3d]: %-10s style = %-10s def =",
|
fprintf(out,"Variable[%3d]: %-10s, style = %-10s, def =",
|
||||||
i,names[i],varstyles[style[i]]);
|
i,names[i],varstyles[style[i]]);
|
||||||
if ((style[i] != LOOP) && (style[i] != ULOOP))
|
if ((style[i] != LOOP) && (style[i] != ULOOP))
|
||||||
ndata = input->variable->num[i];
|
ndata = input->variable->num[i];
|
||||||
|
|||||||
Reference in New Issue
Block a user