compute centroid/atom/stress will use cvatom from pair styles when available
This commit is contained in:
@ -173,12 +173,19 @@ void ComputeCentroidStressAtom::compute_peratom()
|
|||||||
// per-atom virial and per-atom centroid virial are the same for pairwise
|
// per-atom virial and per-atom centroid virial are the same for pairwise
|
||||||
// many-body pair styles not yet implemented
|
// many-body pair styles not yet implemented
|
||||||
if (pairflag && force->pair) {
|
if (pairflag && force->pair) {
|
||||||
double **vatom = force->pair->vatom;
|
if (force->pair->cntratmstressflag & 2) {
|
||||||
for (i = 0; i < npair; i++) {
|
double **cvatom = force->pair->cvatom;
|
||||||
for (j = 0; j < 6; j++)
|
for (i = 0; i < npair; i++)
|
||||||
stress[i][j] += vatom[i][j];
|
for (j = 0; j < 9; j++)
|
||||||
for (j = 6; j < 9; j++)
|
stress[i][j] += cvatom[i][j];
|
||||||
stress[i][j] += vatom[i][j-3];
|
} else {
|
||||||
|
double **vatom = force->pair->vatom;
|
||||||
|
for (i = 0; i < npair; i++) {
|
||||||
|
for (j = 0; j < 6; j++)
|
||||||
|
stress[i][j] += vatom[i][j];
|
||||||
|
for (j = 6; j < 9; j++)
|
||||||
|
stress[i][j] += vatom[i][j-3];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user