Commit 61a286a0 authored by Donatas Surblys's avatar Donatas Surblys
Browse files

compute centroid/atom/stress will use cvatom from pair styles when available

parent 3258a149
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -173,6 +173,12 @@ void ComputeCentroidStressAtom::compute_peratom()
  // per-atom virial and per-atom centroid virial are the same for pairwise
  // many-body pair styles not yet implemented
  if (pairflag && force->pair) {
    if (force->pair->cntratmstressflag & 2) {
      double **cvatom = force->pair->cvatom;
      for (i = 0; i < npair; i++)
        for (j = 0; j < 9; j++)
          stress[i][j] += cvatom[i][j];
    } else {
      double **vatom = force->pair->vatom;
      for (i = 0; i < npair; i++) {
        for (j = 0; j < 6; j++)
@@ -181,6 +187,7 @@ void ComputeCentroidStressAtom::compute_peratom()
          stress[i][j] += vatom[i][j-3];
      }
    }
  }

  // per-atom virial and per-atom centroid virial are the same for bonds
  if (bondflag && force->bond) {