flag error when trying to compute an average of an empty vector

This commit is contained in:
Axel Kohlmeyer
2020-07-03 22:35:53 -04:00
parent 53415592d2
commit c37b5e50b1

View File

@ -4205,6 +4205,9 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
if (eval_in_progress[ivar])
print_var_error(FLERR,"Variable has circular dependency",ivar);
if ((method == AVE) && (nvec == 0))
print_var_error(FLERR,"Cannot compute average of empty vector",ivar);
double *vec;
nvec = compute_vector(ivar,&vec);
nstride = 1;