make use of Compute::is_initialized() and Compute::init_flags()
This commit is contained in:
@ -1505,8 +1505,8 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
|
||||
if (nbracket == 0 && compute->scalar_flag && lowercase) {
|
||||
|
||||
if (update->first_update == 0)
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before first run",ivar);
|
||||
if (!compute->is_initialized())
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before initialized by run",ivar);
|
||||
if (!(compute->invoked_flag & Compute::INVOKED_SCALAR)) {
|
||||
compute->compute_scalar();
|
||||
compute->invoked_flag |= Compute::INVOKED_SCALAR;
|
||||
@ -1527,8 +1527,8 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
if (index1 > compute->size_vector &&
|
||||
compute->size_vector_variable == 0)
|
||||
print_var_error(FLERR,"Variable formula compute vector is accessed out-of-range",ivar,0);
|
||||
if (update->first_update == 0)
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before first run",ivar);
|
||||
if (!compute->is_initialized())
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before initialized by run",ivar);
|
||||
if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) {
|
||||
compute->compute_vector();
|
||||
compute->invoked_flag |= Compute::INVOKED_VECTOR;
|
||||
@ -1553,8 +1553,8 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
print_var_error(FLERR,"Variable formula compute array is accessed out-of-range",ivar,0);
|
||||
if (index2 > compute->size_array_cols)
|
||||
print_var_error(FLERR,"Variable formula compute array is accessed out-of-range",ivar,0);
|
||||
if (update->first_update == 0)
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before first run",ivar);
|
||||
if (!compute->is_initialized())
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before initialized by run",ivar);
|
||||
if (!(compute->invoked_flag & Compute::INVOKED_ARRAY)) {
|
||||
compute->compute_array();
|
||||
compute->invoked_flag |= Compute::INVOKED_ARRAY;
|
||||
@ -1580,8 +1580,8 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
print_var_error(FLERR,"Compute global vector in atom-style variable formula",ivar);
|
||||
if (compute->size_vector == 0)
|
||||
print_var_error(FLERR,"Variable formula compute vector is zero length",ivar);
|
||||
if (update->first_update == 0)
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before first run",ivar);
|
||||
if (!compute->is_initialized())
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before initialized by run",ivar);
|
||||
if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) {
|
||||
compute->compute_vector();
|
||||
compute->invoked_flag |= Compute::INVOKED_VECTOR;
|
||||
@ -1604,8 +1604,8 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
print_var_error(FLERR,"Compute global vector in atom-style variable formula",ivar);
|
||||
if (compute->size_array_rows == 0)
|
||||
print_var_error(FLERR,"Variable formula compute array is zero length",ivar);
|
||||
if (update->first_update == 0)
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before first run",ivar);
|
||||
if (!compute->is_initialized())
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before initialized by run",ivar);
|
||||
if (!(compute->invoked_flag & Compute::INVOKED_ARRAY)) {
|
||||
compute->compute_array();
|
||||
compute->invoked_flag |= Compute::INVOKED_ARRAY;
|
||||
@ -1623,8 +1623,8 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
} else if (nbracket == 1 && compute->peratom_flag &&
|
||||
compute->size_peratom_cols == 0) {
|
||||
|
||||
if (update->first_update == 0)
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before first run",ivar);
|
||||
if (!compute->is_initialized())
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before initialized by run",ivar);
|
||||
if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) {
|
||||
compute->compute_peratom();
|
||||
compute->invoked_flag |= Compute::INVOKED_PERATOM;
|
||||
@ -1640,8 +1640,8 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
|
||||
if (index2 > compute->size_peratom_cols)
|
||||
print_var_error(FLERR,"Variable formula compute array is accessed out-of-range",ivar,0);
|
||||
if (update->first_update == 0)
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before first run",ivar);
|
||||
if (!compute->is_initialized())
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before initialized by run",ivar);
|
||||
if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) {
|
||||
compute->compute_peratom();
|
||||
compute->invoked_flag |= Compute::INVOKED_PERATOM;
|
||||
@ -1663,8 +1663,8 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
print_var_error(FLERR,"Per-atom compute in equal-style variable formula",ivar);
|
||||
if (treetype == VECTOR)
|
||||
print_var_error(FLERR,"Per-atom compute in vector-style variable formula",ivar);
|
||||
if (update->first_update == 0)
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before first run",ivar);
|
||||
if (!compute->is_initialized())
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before initialized by run",ivar);
|
||||
if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) {
|
||||
compute->compute_peratom();
|
||||
compute->invoked_flag |= Compute::INVOKED_PERATOM;
|
||||
@ -1687,8 +1687,8 @@ double Variable::evaluate(char *str, Tree **tree, int ivar)
|
||||
print_var_error(FLERR,"Per-atom compute in vector-style variable formula",ivar);
|
||||
if (index1 > compute->size_peratom_cols)
|
||||
print_var_error(FLERR,"Variable formula compute array is accessed out-of-range",ivar,0);
|
||||
if (update->first_update == 0)
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before first run",ivar);
|
||||
if (!compute->is_initialized())
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before initialized by run",ivar);
|
||||
if (!(compute->invoked_flag & Compute::INVOKED_PERATOM)) {
|
||||
compute->compute_peratom();
|
||||
compute->invoked_flag |= Compute::INVOKED_PERATOM;
|
||||
@ -4163,8 +4163,8 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree **t
|
||||
print_var_error(FLERR,mesg,ivar);
|
||||
}
|
||||
if (index == 0 && compute->vector_flag) {
|
||||
if (update->first_update == 0)
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before first run",ivar);
|
||||
if (!compute->is_initialized())
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before initialized by run",ivar);
|
||||
if (!(compute->invoked_flag & Compute::INVOKED_VECTOR)) {
|
||||
compute->compute_vector();
|
||||
compute->invoked_flag |= Compute::INVOKED_VECTOR;
|
||||
@ -4174,8 +4174,8 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree **t
|
||||
} else if (index && compute->array_flag) {
|
||||
if (index > compute->size_array_cols)
|
||||
print_var_error(FLERR,"Variable formula compute array is accessed out-of-range",ivar,0);
|
||||
if (update->first_update == 0)
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before first run",ivar);
|
||||
if (!compute->is_initialized())
|
||||
print_var_error(FLERR,"Variable formula compute cannot be invoked before initialized by run",ivar);
|
||||
if (!(compute->invoked_flag & Compute::INVOKED_ARRAY)) {
|
||||
compute->compute_array();
|
||||
compute->invoked_flag |= Compute::INVOKED_ARRAY;
|
||||
|
||||
Reference in New Issue
Block a user