apply fix from balance command to fix balance
This commit is contained in:
@ -45,6 +45,7 @@ class Balance : public Command {
|
|||||||
int *bisection(int sortflag = 0);
|
int *bisection(int sortflag = 0);
|
||||||
void dumpout(bigint);
|
void dumpout(bigint);
|
||||||
|
|
||||||
|
static constexpr int BSTR_SIZE = 3;
|
||||||
private:
|
private:
|
||||||
int me, nprocs;
|
int me, nprocs;
|
||||||
|
|
||||||
@ -56,7 +57,6 @@ class Balance : public Command {
|
|||||||
|
|
||||||
int nitermax; // params for shift LB
|
int nitermax; // params for shift LB
|
||||||
double stopthresh;
|
double stopthresh;
|
||||||
static constexpr int BSTR_SIZE = 3;
|
|
||||||
char bstr[BSTR_SIZE+1];
|
char bstr[BSTR_SIZE+1];
|
||||||
|
|
||||||
int shift_allocate; // 1 if SHIFT vectors have been allocated
|
int shift_allocate; // 1 if SHIFT vectors have been allocated
|
||||||
|
|||||||
@ -64,14 +64,15 @@ FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
int iarg = 5;
|
int iarg = 5;
|
||||||
if (lbstyle == SHIFT) {
|
if (lbstyle == SHIFT) {
|
||||||
if (iarg+4 > narg) error->all(FLERR,"Illegal fix balance command");
|
if (iarg+4 > narg) error->all(FLERR,"Illegal fix balance command");
|
||||||
if (strlen(arg[iarg+1]) > 3)
|
if (strlen(arg[iarg+1]) > Balance::BSTR_SIZE)
|
||||||
error->all(FLERR,"Illegal fix balance command");
|
error->all(FLERR,"Illegal fix balance command");
|
||||||
strcpy(bstr,arg[iarg+1]);
|
strncpy(bstr,arg[iarg+1], Balance::BSTR_SIZE+1);
|
||||||
nitermax = utils::inumeric(FLERR,arg[iarg+2],false,lmp);
|
nitermax = utils::inumeric(FLERR,arg[iarg+2],false,lmp);
|
||||||
if (nitermax <= 0) error->all(FLERR,"Illegal fix balance command");
|
if (nitermax <= 0) error->all(FLERR,"Illegal fix balance command");
|
||||||
stopthresh = utils::numeric(FLERR,arg[iarg+3],false,lmp);
|
stopthresh = utils::numeric(FLERR,arg[iarg+3],false,lmp);
|
||||||
if (stopthresh < 1.0) error->all(FLERR,"Illegal fix balance command");
|
if (stopthresh < 1.0) error->all(FLERR,"Illegal fix balance command");
|
||||||
iarg += 4;
|
iarg += 4;
|
||||||
|
|
||||||
} else if (lbstyle == BISECTION) {
|
} else if (lbstyle == BISECTION) {
|
||||||
iarg++;
|
iarg++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user