git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8352 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -267,6 +267,7 @@ void ComputeAtomMolecule::compute_array()
|
||||
}
|
||||
}
|
||||
|
||||
if (array)
|
||||
MPI_Allreduce(&aone[0][0],&array[0][0],nvalues*nmolecules,
|
||||
MPI_DOUBLE,MPI_SUM,world);
|
||||
}
|
||||
@ -296,7 +297,8 @@ void ComputeAtomMolecule::compute_one(int m)
|
||||
peratom = compute->vector_atom;
|
||||
nstride = 1;
|
||||
} else {
|
||||
peratom = &compute->array_atom[0][aidx-1];
|
||||
if (compute->array_atom) peratom = &compute->array_atom[0][aidx-1];
|
||||
else peratom = NULL;
|
||||
nstride = compute->size_array_cols;
|
||||
}
|
||||
|
||||
|
||||
@ -627,6 +627,7 @@ void FixAveHisto::end_of_step()
|
||||
compute->compute_array();
|
||||
compute->invoked_flag |= INVOKED_ARRAY;
|
||||
}
|
||||
if (compute->array)
|
||||
bin_vector(compute->size_array_rows,&compute->array[0][j-1],
|
||||
compute->size_array_cols);
|
||||
}
|
||||
@ -638,7 +639,7 @@ void FixAveHisto::end_of_step()
|
||||
}
|
||||
if (j == 0)
|
||||
bin_atoms(compute->vector_atom,1);
|
||||
else
|
||||
else if (compute->array_atom)
|
||||
bin_atoms(compute->array_atom[j-1],
|
||||
compute->size_peratom_cols);
|
||||
|
||||
@ -649,7 +650,7 @@ void FixAveHisto::end_of_step()
|
||||
}
|
||||
if (j == 0)
|
||||
bin_vector(compute->size_local_rows,compute->vector_local,1);
|
||||
else
|
||||
else if (compute->array_local)
|
||||
bin_vector(compute->size_local_rows,&compute->array_local[0][j-1],
|
||||
compute->size_local_cols);
|
||||
}
|
||||
@ -675,11 +676,12 @@ void FixAveHisto::end_of_step()
|
||||
|
||||
} else if (kind == PERATOM) {
|
||||
if (j == 0) bin_atoms(fix->vector_atom,1);
|
||||
else bin_atoms(fix->array_atom[j-1],fix->size_peratom_cols);
|
||||
else if (fix->array_atom)
|
||||
bin_atoms(fix->array_atom[j-1],fix->size_peratom_cols);
|
||||
|
||||
} else if (kind == LOCAL) {
|
||||
if (j == 0) bin_vector(fix->size_local_rows,fix->vector_local,1);
|
||||
else
|
||||
else if (fix->array_local)
|
||||
bin_vector(fix->size_local_rows,&fix->array_local[0][j-1],
|
||||
fix->size_local_cols);
|
||||
}
|
||||
|
||||
@ -871,6 +871,7 @@ double Variable::evaluate(char *str, Tree **tree)
|
||||
compute->invoked_flag |= INVOKED_PERATOM;
|
||||
}
|
||||
|
||||
if (compute->array_atom)
|
||||
peratom2global(1,NULL,&compute->array_atom[0][index2-1],
|
||||
compute->size_peratom_cols,index1,
|
||||
tree,treestack,ntreestack,argstack,nargstack);
|
||||
@ -921,7 +922,10 @@ double Variable::evaluate(char *str, Tree **tree)
|
||||
|
||||
Tree *newtree = new Tree();
|
||||
newtree->type = ATOMARRAY;
|
||||
if (compute->array_atom)
|
||||
newtree->array = &compute->array_atom[0][index1-1];
|
||||
else
|
||||
newtree->array = NULL;
|
||||
newtree->nstride = compute->size_peratom_cols;
|
||||
newtree->left = newtree->middle = newtree->right = NULL;
|
||||
treestack[ntreestack++] = newtree;
|
||||
@ -1048,6 +1052,7 @@ double Variable::evaluate(char *str, Tree **tree)
|
||||
update->ntimestep % fix->peratom_freq)
|
||||
error->all(FLERR,"Fix in variable not computed at compatible time");
|
||||
|
||||
if (fix->array_atom)
|
||||
peratom2global(1,NULL,&fix->array_atom[0][index2-1],
|
||||
fix->size_peratom_cols,index1,
|
||||
tree,treestack,ntreestack,argstack,nargstack);
|
||||
@ -1086,7 +1091,10 @@ double Variable::evaluate(char *str, Tree **tree)
|
||||
|
||||
Tree *newtree = new Tree();
|
||||
newtree->type = ATOMARRAY;
|
||||
if (fix->array_atom)
|
||||
newtree->array = &fix->array_atom[0][index1-1];
|
||||
else
|
||||
newtree->array = NULL;
|
||||
newtree->nstride = fix->size_peratom_cols;
|
||||
newtree->left = newtree->middle = newtree->right = NULL;
|
||||
treestack[ntreestack++] = newtree;
|
||||
@ -2883,7 +2891,8 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
|
||||
"is accessed out-of-range");
|
||||
if (update->whichflag == 0) {
|
||||
if (compute->invoked_array != update->ntimestep)
|
||||
error->all(FLERR,"Compute used in variable between runs is not current");
|
||||
error->all(FLERR,
|
||||
"Compute used in variable between runs is not current");
|
||||
} else if (!(compute->invoked_flag & INVOKED_ARRAY)) {
|
||||
compute->compute_array();
|
||||
compute->invoked_flag |= INVOKED_ARRAY;
|
||||
@ -2910,7 +2919,8 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
|
||||
nstride = 1;
|
||||
} else if (index && fix->array_flag) {
|
||||
if (index > fix->size_array_cols)
|
||||
error->all(FLERR,"Variable formula fix array is accessed out-of-range");
|
||||
error->all(FLERR,
|
||||
"Variable formula fix array is accessed out-of-range");
|
||||
if (update->whichflag > 0 && update->ntimestep % fix->global_freq)
|
||||
error->all(FLERR,"Fix in variable not computed at compatible time");
|
||||
nvec = fix->size_array_rows;
|
||||
@ -2925,8 +2935,10 @@ int Variable::special_function(char *word, char *contents, Tree **tree,
|
||||
|
||||
if (compute) {
|
||||
double *vec;
|
||||
if (index) vec = &compute->array[0][index-1];
|
||||
else vec = compute->vector;
|
||||
if (index) {
|
||||
if (compute->array) vec = &compute->array[0][index-1];
|
||||
else vec = NULL;
|
||||
} else vec = compute->vector;
|
||||
|
||||
int j = 0;
|
||||
for (int i = 0; i < nvec; i++) {
|
||||
|
||||
Reference in New Issue
Block a user