silence warnings about cases, that cannot happen

(cherry picked from commit 60bf26bad9)
This commit is contained in:
Axel Kohlmeyer 2016-08-13 01:59:27 -04:00
parent 8492212c4b
commit 40fd97bd4c
3 changed files with 4 additions and 3 deletions

View File

@ -197,7 +197,7 @@ void FixController::end_of_step()
// invoke compute if not previously invoked // invoke compute if not previously invoked
double current; double current = 0.0;
if (pvwhich == COMPUTE) { if (pvwhich == COMPUTE) {
if (pvindex == 0) { if (pvindex == 0) {

View File

@ -59,8 +59,9 @@ void ImbalanceVar::compute(double *weight)
{ {
if (_id >= 0) { if (_id >= 0) {
const int all = _lmp->group->find("all"); const int all = _lmp->group->find("all");
const int nlocal = _lmp->atom->nlocal; if (all < 0) return;
const int nlocal = _lmp->atom->nlocal;
double *val = new double[nlocal]; double *val = new double[nlocal];
_lmp->input->variable->compute_atom(_id,all,val,1,0); _lmp->input->variable->compute_atom(_id,all,val,1,0);
for (int i = 0; i < nlocal; ++i) weight[i] *= val[i]; for (int i = 0; i < nlocal; ++i) weight[i] *= val[i];

View File

@ -898,7 +898,7 @@ double Variable::compute_equal(int ivar)
error->all(FLERR,"Variable has circular dependency"); error->all(FLERR,"Variable has circular dependency");
eval_in_progress[ivar] = 1; eval_in_progress[ivar] = 1;
double value; double value = 0.0;
if (style[ivar] == EQUAL) value = evaluate(data[ivar][0],NULL); if (style[ivar] == EQUAL) value = evaluate(data[ivar][0],NULL);
else if (style[ivar] == INTERNAL) value = dvalue[ivar]; else if (style[ivar] == INTERNAL) value = dvalue[ivar];
else if (style[ivar] == PYTHON) { else if (style[ivar] == PYTHON) {