changes for next patch, 2d disc options for spheres, fix external upgrade, bug fixes for fix ave/chunk for density calcs, Aidan doc page citation deconvolution
This commit is contained in:
25
src/set.cpp
25
src/set.cpp
@ -295,13 +295,20 @@ void Set::command(int narg, char **arg)
|
||||
set(DIAMETER);
|
||||
iarg += 2;
|
||||
|
||||
} else if (strcmp(arg[iarg],"density") == 0) {
|
||||
} else if (strcmp(arg[iarg],"density") == 0 ||
|
||||
(strcmp(arg[iarg],"density/disc") == 0)) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal set command");
|
||||
if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1);
|
||||
else dvalue = force->numeric(FLERR,arg[iarg+1]);
|
||||
if (!atom->rmass_flag)
|
||||
error->all(FLERR,"Cannot set this attribute for this atom style");
|
||||
if (dvalue <= 0.0) error->all(FLERR,"Invalid density in set command");
|
||||
discflag = 0;
|
||||
if (strcmp(arg[iarg],"density/disc") == 0) {
|
||||
discflag = 1;
|
||||
if (domain->dimension != 2)
|
||||
error->all(FLERR,"Density/disc option requires 2d simulation");
|
||||
}
|
||||
set(DENSITY);
|
||||
iarg += 2;
|
||||
|
||||
@ -678,8 +685,8 @@ void Set::set(int keyword)
|
||||
}
|
||||
|
||||
// set rmass via density
|
||||
// if radius > 0.0, treat as sphere
|
||||
// if shape > 0.0, treat as ellipsoid
|
||||
// if radius > 0.0, treat as sphere or disc
|
||||
// if shape > 0.0, treat as ellipsoid (or ellipse, when uncomment below)
|
||||
// if length > 0.0, treat as line
|
||||
// if area > 0.0, treat as tri
|
||||
// else set rmass to density directly
|
||||
@ -687,10 +694,18 @@ void Set::set(int keyword)
|
||||
else if (keyword == DENSITY) {
|
||||
if (dvalue <= 0.0) error->one(FLERR,"Invalid density in set command");
|
||||
if (atom->radius_flag && atom->radius[i] > 0.0)
|
||||
atom->rmass[i] = 4.0*MY_PI/3.0 *
|
||||
atom->radius[i]*atom->radius[i]*atom->radius[i] * dvalue;
|
||||
if (discflag)
|
||||
atom->rmass[i] = MY_PI*atom->radius[i]*atom->radius[i] * dvalue;
|
||||
else
|
||||
atom->rmass[i] = 4.0*MY_PI/3.0 *
|
||||
atom->radius[i]*atom->radius[i]*atom->radius[i] * dvalue;
|
||||
else if (atom->ellipsoid_flag && atom->ellipsoid[i] >= 0) {
|
||||
double *shape = avec_ellipsoid->bonus[atom->ellipsoid[i]].shape;
|
||||
// enable 2d ellipse (versus 3d ellipsoid) when time integration
|
||||
// options (fix nve/asphere, fix nh/asphere) are also implemented
|
||||
// if (discflag)
|
||||
// atom->rmass[i] = MY_PI*shape[0]*shape[1] * dvalue;
|
||||
// else
|
||||
atom->rmass[i] = 4.0*MY_PI/3.0 * shape[0]*shape[1]*shape[2] * dvalue;
|
||||
} else if (atom->line_flag && atom->line[i] >= 0) {
|
||||
double length = avec_line->bonus[atom->line[i]].length;
|
||||
|
||||
Reference in New Issue
Block a user