Commit 0a64dff1 authored by Donatas Surblys's avatar Donatas Surblys
Browse files

add initial support to centroid virial in USER-OMP pair styles

parent 7937bec3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@ class ThrData {
  double **vatom_dihed;
  double **vatom_imprp;
  double **vatom_kspce;
  double **cvatom_pair;
  double **cvatom_angle;
  double **cvatom_dihed;
  double **cvatom_imprp;
+17 −0
Original line number Diff line number Diff line
@@ -82,6 +82,15 @@ void ThrOMP::ev_setup_thr(int eflag, int vflag, int nall, double *eatom,
      if (nall > 0)
        memset(&(thr->vatom_pair[0][0]),0,nall*6*sizeof(double));
    }
    // check cvatom_pair, because can't access cntratmstressflag
    if ((vflag & 8) && cvatom) {
      thr->cvatom_pair = cvatom + tid*nall;
      if (nall > 0)
        memset(&(thr->cvatom_pair[0][0]),0,nall*9*sizeof(double));
    } else {
      thr->cvatom_pair = NULL;
    }

  }

  if (thr_style & THR_BOND) {
@@ -234,6 +243,10 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
      if (vflag & 12) {
        data_reduce_thr(&(pair->vatom[0][0]), nall, nthreads, 6, tid);
      }
      // check cvatom_pair, because can't access cntratmstressflag
      if ((vflag & 8) && thr->cvatom_pair) {
        data_reduce_thr(&(pair->cvatom[0][0]), nall, nthreads, 9, tid);
      }
    }
  }
    break;
@@ -381,6 +394,10 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag,
      if (vflag & 12) {
        data_reduce_thr(&(pair->vatom[0][0]), nall, nthreads, 6, tid);
      }
      // check cvatom_pair, because can't access cntratmstressflag
      if ((vflag & 8) && thr->cvatom_pair) {
        data_reduce_thr(&(pair->cvatom[0][0]), nall, nthreads, 9, tid);
      }
    }
    break;