Commit f4a07cf2 authored by Donatas Surblys's avatar Donatas Surblys
Browse files

update USER-OMP to compute per-atom virial for pairs when vflag=8

parent 9301fc6b
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -75,7 +75,9 @@ void ThrOMP::ev_setup_thr(int eflag, int vflag, int nall, double *eatom,
      if (nall > 0)
        memset(&(thr->eatom_pair[0]),0,nall*sizeof(double));
    }
    if (vflag & 4) {
    // per-atom virial and per-atom centroid virial are the same for pairwise
    // many-body pair styles not yet implemented
    if (vflag & 12) {
      thr->vatom_pair = vatom + tid*nall;
      if (nall > 0)
        memset(&(thr->vatom_pair[0][0]),0,nall*6*sizeof(double));
@@ -227,7 +229,9 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
      if (eflag & 2) {
        data_reduce_thr(&(pair->eatom[0]), nall, nthreads, 1, tid);
      }
      if (vflag & 4) {
      // per-atom virial and per-atom centroid virial are the same for pairwise
      // many-body pair styles not yet implemented
      if (vflag & 12) {
        data_reduce_thr(&(pair->vatom[0][0]), nall, nthreads, 6, tid);
      }
    }
@@ -368,11 +372,15 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
      }
      if (vflag & 4) {
        data_reduce_thr(&(dihedral->vatom[0][0]), nall, nthreads, 6, tid);
        data_reduce_thr(&(pair->vatom[0][0]), nall, nthreads, 6, tid);
      }
      if (vflag & 8) {
        data_reduce_thr(&(dihedral->cvatom[0][0]), nall, nthreads, 9, tid);
      }
      // per-atom virial and per-atom centroid virial are the same for pairwise
      // many-body pair styles not yet implemented
      if (vflag & 12) {
        data_reduce_thr(&(pair->vatom[0][0]), nall, nthreads, 6, tid);
      }
    }
    break;