Commit 960a975e authored by Aidan Thompson's avatar Aidan Thompson
Browse files

Added compact arrays, removed unused openmp stuff

parent 803e0631
Loading
Loading
Loading
Loading
+19 −44
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@
#include "comm.h"
#include "memory.h"
#include "error.h"
#include "openmp_snap.h"

using namespace LAMMPS_NS;

@@ -115,20 +114,10 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) :
    } else error->all(FLERR,"Illegal compute sna/atom command");
  }

  nthreads = comm->nthreads;
  snaptr = new SNA*[nthreads];
#if defined(_OPENMP)
#pragma omp parallel default(none) shared(lmp,rfac0,twojmax,rmin0,switchflag,bzeroflag)
#endif
  {
    int tid = omp_get_thread_num();

    // always unset use_shared_arrays since it does not work with computes
    snaptr[tid] = new SNA(lmp,rfac0,twojmax,diagonalstyle,
                          0 /*use_shared_arrays*/, rmin0,switchflag,bzeroflag);
  }
  snaptr = new SNA(lmp,rfac0,twojmax,diagonalstyle,
                   rmin0,switchflag,bzeroflag);

  ncoeff = snaptr[0]->ncoeff;
  ncoeff = snaptr->ncoeff;
  size_peratom_cols = ncoeff;
  if (quadraticflag) size_peratom_cols += (ncoeff*(ncoeff+1))/2;
  peratom_flag = 1;
@@ -136,7 +125,6 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) :
  nmax = 0;
  njmax = 0;
  sna = NULL;

}

/* ---------------------------------------------------------------------- */
@@ -147,9 +135,7 @@ ComputeSNAAtom::~ComputeSNAAtom()
  memory->destroy(radelem);
  memory->destroy(wjelem);
  memory->destroy(cutsq);
  for (int tid = 0; tid<nthreads; tid++)
    delete snaptr[tid];
  delete [] snaptr;
  delete snaptr;
}

/* ---------------------------------------------------------------------- */
@@ -176,13 +162,7 @@ void ComputeSNAAtom::init()
    if (strcmp(modify->compute[i]->style,"sna/atom") == 0) count++;
  if (count > 1 && comm->me == 0)
    error->warning(FLERR,"More than one compute sna/atom");
#if defined(_OPENMP)
#pragma omp parallel default(none)
#endif
  {
    int tid = omp_get_thread_num();
    snaptr[tid]->init();
  }
  snaptr->init();
}

/* ---------------------------------------------------------------------- */
@@ -223,11 +203,7 @@ void ComputeSNAAtom::compute_peratom()
  double** const x = atom->x;
  const int* const mask = atom->mask;

#if defined(_OPENMP)
#pragma omp parallel for default(none)
#endif
  for (int ii = 0; ii < inum; ii++) {
    const int tid = omp_get_thread_num();
    const int i = ilist[ii];
    if (mask[i] & groupbit) {

@@ -241,7 +217,7 @@ void ComputeSNAAtom::compute_peratom()

      // insure rij, inside, and typej  are of size jnum

      snaptr[tid]->grow_rij(jnum);
      snaptr->grow_rij(jnum);

      // rij[][3] = displacements between atom I and those neighbors
      // inside = indices of neighbors of I within cutoff
@@ -258,26 +234,26 @@ void ComputeSNAAtom::compute_peratom()
        const double rsq = delx*delx + dely*dely + delz*delz;
        int jtype = type[j];
        if (rsq < cutsq[itype][jtype] && rsq>1e-20) {
          snaptr[tid]->rij[ninside][0] = delx;
          snaptr[tid]->rij[ninside][1] = dely;
          snaptr[tid]->rij[ninside][2] = delz;
          snaptr[tid]->inside[ninside] = j;
          snaptr[tid]->wj[ninside] = wjelem[jtype];
          snaptr[tid]->rcutij[ninside] = (radi+radelem[jtype])*rcutfac;
          snaptr->rij[ninside][0] = delx;
          snaptr->rij[ninside][1] = dely;
          snaptr->rij[ninside][2] = delz;
          snaptr->inside[ninside] = j;
          snaptr->wj[ninside] = wjelem[jtype];
          snaptr->rcutij[ninside] = (radi+radelem[jtype])*rcutfac;
          ninside++;
        }
      }

      snaptr[tid]->compute_ui(ninside);
      snaptr[tid]->compute_zi();
      snaptr[tid]->compute_bi();
      snaptr[tid]->copy_bi2bvec();
      snaptr->compute_ui(ninside);
      snaptr->compute_zi();
      snaptr->compute_bi();
      snaptr->copy_bi2bvec();
      for (int icoeff = 0; icoeff < ncoeff; icoeff++)
        sna[i][icoeff] = snaptr[tid]->bvec[icoeff];
        sna[i][icoeff] = snaptr->bvec[icoeff];
      if (quadraticflag) {
        int ncount = ncoeff;
        for (int icoeff = 0; icoeff < ncoeff; icoeff++) {
          double bi = snaptr[tid]->bvec[icoeff];
          double bi = snaptr->bvec[icoeff];

          // diagonal element of quadratic matrix

@@ -286,7 +262,7 @@ void ComputeSNAAtom::compute_peratom()
          // upper-triangular elements of quadratic matrix

          for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++)
            sna[i][ncount++] = bi*snaptr[tid]->bvec[jcoeff];
            sna[i][ncount++] = bi*snaptr->bvec[jcoeff];
        }
      }
    } else {
@@ -305,7 +281,6 @@ double ComputeSNAAtom::memory_usage()
  double bytes = nmax*size_peratom_cols * sizeof(double);
  bytes += 3*njmax*sizeof(double);
  bytes += njmax*sizeof(int);
  bytes += snaptr[0]->memory_usage()*comm->nthreads;
  return bytes;
}
+1 −2
Original line number Diff line number Diff line
@@ -42,10 +42,9 @@ class ComputeSNAAtom : public Compute {
  double rcutfac;
  double *radelem;
  double *wjelem;
  class SNA** snaptr;
  class SNA* snaptr;
  double cutmax;
  int quadraticflag;
  int nthreads;
};

}
+38 −63
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@
#include "comm.h"
#include "memory.h"
#include "error.h"
#include "openmp_snap.h"

using namespace LAMMPS_NS;

@@ -113,20 +112,10 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) :
    } else error->all(FLERR,"Illegal compute snad/atom command");
  }

  nthreads = comm->nthreads;
  snaptr = new SNA*[nthreads];
#if defined(_OPENMP)
#pragma omp parallel default(none) shared(lmp,rfac0,twojmax,rmin0,switchflag,bzeroflag)
#endif
  {
    int tid = omp_get_thread_num();

    // always unset use_shared_arrays since it does not work with computes
    snaptr[tid] = new SNA(lmp,rfac0,twojmax,diagonalstyle,
                          0 /*use_shared_arrays*/, rmin0,switchflag,bzeroflag);
  }
  snaptr = new SNA(lmp,rfac0,twojmax,diagonalstyle,
                   rmin0,switchflag,bzeroflag);

  ncoeff = snaptr[0]->ncoeff;
  ncoeff = snaptr->ncoeff;
  nperdim = ncoeff;
  if (quadraticflag) nperdim += (ncoeff*(ncoeff+1))/2;
  yoffset = nperdim;
@@ -138,7 +127,6 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) :
  nmax = 0;
  njmax = 0;
  snad = NULL;

}

/* ---------------------------------------------------------------------- */
@@ -149,9 +137,7 @@ ComputeSNADAtom::~ComputeSNADAtom()
  memory->destroy(radelem);
  memory->destroy(wjelem);
  memory->destroy(cutsq);
  for (int tid = 0; tid<nthreads; tid++)
    delete snaptr[tid];
  delete [] snaptr;
  delete snaptr;
}

/* ---------------------------------------------------------------------- */
@@ -178,13 +164,7 @@ void ComputeSNADAtom::init()
    if (strcmp(modify->compute[i]->style,"snad/atom") == 0) count++;
  if (count > 1 && comm->me == 0)
    error->warning(FLERR,"More than one compute snad/atom");
#if defined(_OPENMP)
#pragma omp parallel default(none)
#endif
  {
    int tid = omp_get_thread_num();
    snaptr[tid]->init();
  }
  snaptr->init();
}

/* ---------------------------------------------------------------------- */
@@ -235,11 +215,7 @@ void ComputeSNADAtom::compute_peratom()
  double** const x = atom->x;
  const int* const mask = atom->mask;

#if defined(_OPENMP)
#pragma omp parallel for default(none)
#endif
  for (int ii = 0; ii < inum; ii++) {
    const int tid = omp_get_thread_num();
    const int i = ilist[ii];
    if (mask[i] & groupbit) {

@@ -258,7 +234,7 @@ void ComputeSNADAtom::compute_peratom()

      // insure rij, inside, and typej  are of size jnum

      snaptr[tid]->grow_rij(jnum);
      snaptr->grow_rij(jnum);

      // rij[][3] = displacements between atom I and those neighbors
      // inside = indices of neighbors of I within cutoff
@@ -276,30 +252,30 @@ void ComputeSNADAtom::compute_peratom()
        const double rsq = delx*delx + dely*dely + delz*delz;
        int jtype = type[j];
        if (rsq < cutsq[itype][jtype]&&rsq>1e-20) {
          snaptr[tid]->rij[ninside][0] = delx;
          snaptr[tid]->rij[ninside][1] = dely;
          snaptr[tid]->rij[ninside][2] = delz;
          snaptr[tid]->inside[ninside] = j;
          snaptr[tid]->wj[ninside] = wjelem[jtype];
          snaptr[tid]->rcutij[ninside] = (radi+radelem[jtype])*rcutfac;
          snaptr->rij[ninside][0] = delx;
          snaptr->rij[ninside][1] = dely;
          snaptr->rij[ninside][2] = delz;
          snaptr->inside[ninside] = j;
          snaptr->wj[ninside] = wjelem[jtype];
          snaptr->rcutij[ninside] = (radi+radelem[jtype])*rcutfac;
          ninside++;
        }
      }

      snaptr[tid]->compute_ui(ninside);
      snaptr[tid]->compute_zi();
      snaptr->compute_ui(ninside);
      snaptr->compute_zi();
      if (quadraticflag) {
        snaptr[tid]->compute_bi();
        snaptr[tid]->copy_bi2bvec();
        snaptr->compute_bi();
        snaptr->copy_bi2bvec();
      }

      for (int jj = 0; jj < ninside; jj++) {
        const int j = snaptr[tid]->inside[jj];
        snaptr[tid]->compute_duidrj(snaptr[tid]->rij[jj],
                                    snaptr[tid]->wj[jj],
                                    snaptr[tid]->rcutij[jj]);
        snaptr[tid]->compute_dbidrj();
        snaptr[tid]->copy_dbi2dbvec();
        const int j = snaptr->inside[jj];
        snaptr->compute_duidrj(snaptr->rij[jj],
                                    snaptr->wj[jj],
                                    snaptr->rcutij[jj]);
        snaptr->compute_dbidrj();
        snaptr->copy_dbi2dbvec();

        // Accumulate -dBi/dRi, -dBi/dRj

@@ -307,12 +283,12 @@ void ComputeSNADAtom::compute_peratom()
        double *snadj = snad[j]+typeoffset;

        for (int icoeff = 0; icoeff < ncoeff; icoeff++) {
          snadi[icoeff] += snaptr[tid]->dbvec[icoeff][0];
          snadi[icoeff+yoffset] += snaptr[tid]->dbvec[icoeff][1];
          snadi[icoeff+zoffset] += snaptr[tid]->dbvec[icoeff][2];
          snadj[icoeff] -= snaptr[tid]->dbvec[icoeff][0];
          snadj[icoeff+yoffset] -= snaptr[tid]->dbvec[icoeff][1];
          snadj[icoeff+zoffset] -= snaptr[tid]->dbvec[icoeff][2];
          snadi[icoeff] += snaptr->dbvec[icoeff][0];
          snadi[icoeff+yoffset] += snaptr->dbvec[icoeff][1];
          snadi[icoeff+zoffset] += snaptr->dbvec[icoeff][2];
          snadj[icoeff] -= snaptr->dbvec[icoeff][0];
          snadj[icoeff+yoffset] -= snaptr->dbvec[icoeff][1];
          snadj[icoeff+zoffset] -= snaptr->dbvec[icoeff][2];
        }

        if (quadraticflag) {
@@ -321,10 +297,10 @@ void ComputeSNADAtom::compute_peratom()
          snadj += quadraticoffset;
          int ncount = 0;
          for (int icoeff = 0; icoeff < ncoeff; icoeff++) {
            double bi = snaptr[tid]->bvec[icoeff];
            double bix = snaptr[tid]->dbvec[icoeff][0];
            double biy = snaptr[tid]->dbvec[icoeff][1];
            double biz = snaptr[tid]->dbvec[icoeff][2];
            double bi = snaptr->bvec[icoeff];
            double bix = snaptr->dbvec[icoeff][0];
            double biy = snaptr->dbvec[icoeff][1];
            double biz = snaptr->dbvec[icoeff][2];

            // diagonal elements of quadratic matrix

@@ -343,12 +319,12 @@ void ComputeSNADAtom::compute_peratom()
            // upper-triangular elements of quadratic matrix

            for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) {
              double dbxtmp = bi*snaptr[tid]->dbvec[jcoeff][0]
                + bix*snaptr[tid]->bvec[jcoeff];
              double dbytmp = bi*snaptr[tid]->dbvec[jcoeff][1]
                + biy*snaptr[tid]->bvec[jcoeff];
              double dbztmp = bi*snaptr[tid]->dbvec[jcoeff][2]
                + biz*snaptr[tid]->bvec[jcoeff];
              double dbxtmp = bi*snaptr->dbvec[jcoeff][0]
                + bix*snaptr->bvec[jcoeff];
              double dbytmp = bi*snaptr->dbvec[jcoeff][1]
                + biy*snaptr->bvec[jcoeff];
              double dbztmp = bi*snaptr->dbvec[jcoeff][2]
                + biz*snaptr->bvec[jcoeff];

              snadi[ncount] +=         dbxtmp;
              snadi[ncount+yoffset] += dbytmp;
@@ -408,6 +384,5 @@ double ComputeSNADAtom::memory_usage()
  bytes += 3*njmax*sizeof(double);
  bytes += njmax*sizeof(int);
  bytes += 3*nperdim*atom->ntypes;
  bytes += snaptr[0]->memory_usage()*comm->nthreads;
  return bytes;
}
+1 −2
Original line number Diff line number Diff line
@@ -44,10 +44,9 @@ class ComputeSNADAtom : public Compute {
  double rcutfac;
  double *radelem;
  double *wjelem;
  class SNA** snaptr;
  class SNA* snaptr;
  double cutmax;
  int quadraticflag;
  int nthreads;
};

}
+44 −68
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@
#include "comm.h"
#include "memory.h"
#include "error.h"
#include "openmp_snap.h"

using namespace LAMMPS_NS;

@@ -109,20 +108,10 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) :
    } else error->all(FLERR,"Illegal compute snav/atom command");
  }

  nthreads = comm->nthreads;
  snaptr = new SNA*[nthreads];
#if defined(_OPENMP)
#pragma omp parallel default(none) shared(lmp,rfac0,twojmax,rmin0,switchflag,bzeroflag)
#endif
  {
    int tid = omp_get_thread_num();

    // always unset use_shared_arrays since it does not work with computes
    snaptr[tid] = new SNA(lmp,rfac0,twojmax,diagonalstyle,
                          0 /*use_shared_arrays*/, rmin0,switchflag,bzeroflag);
  }
  snaptr = new SNA(lmp,rfac0,twojmax,diagonalstyle,
                   rmin0,switchflag,bzeroflag);

  ncoeff = snaptr[0]->ncoeff;
  ncoeff = snaptr->ncoeff;
  nperdim = ncoeff;
  if (quadraticflag) nperdim += (ncoeff*(ncoeff+1))/2;
  size_peratom_cols = 6*nperdim*atom->ntypes;
@@ -144,9 +133,7 @@ ComputeSNAVAtom::~ComputeSNAVAtom()
  memory->destroy(wjelem);
  memory->destroy(cutsq);

  for (int tid = 0; tid<nthreads; tid++)
    delete snaptr[tid];
  delete [] snaptr;
  delete snaptr;
}

/* ---------------------------------------------------------------------- */
@@ -174,13 +161,7 @@ void ComputeSNAVAtom::init()
    if (strcmp(modify->compute[i]->style,"snav/atom") == 0) count++;
  if (count > 1 && comm->me == 0)
    error->warning(FLERR,"More than one compute snav/atom");
#if defined(_OPENMP)
#pragma omp parallel default(none)
#endif
  {
    int tid = omp_get_thread_num();
    snaptr[tid]->init();
  }
  snaptr->init();
}

/* ---------------------------------------------------------------------- */
@@ -230,11 +211,7 @@ void ComputeSNAVAtom::compute_peratom()
  double** const x = atom->x;
  const int* const mask = atom->mask;

#if defined(_OPENMP)
#pragma omp parallel for default(none)
#endif
  for (int ii = 0; ii < inum; ii++) {
    const int tid = omp_get_thread_num();
    const int i = ilist[ii];
    if (mask[i] & groupbit) {

@@ -251,7 +228,7 @@ void ComputeSNAVAtom::compute_peratom()

      // insure rij, inside, and typej  are of size jnum

          snaptr[tid]->grow_rij(jnum);
      snaptr->grow_rij(jnum);

      // rij[][3] = displacements between atom I and those neighbors
      // inside = indices of neighbors of I within cutoff
@@ -269,31 +246,31 @@ void ComputeSNAVAtom::compute_peratom()
        const double rsq = delx*delx + dely*dely + delz*delz;
        int jtype = type[j];
        if (rsq < cutsq[itype][jtype]&&rsq>1e-20) {
          snaptr[tid]->rij[ninside][0] = delx;
          snaptr[tid]->rij[ninside][1] = dely;
          snaptr[tid]->rij[ninside][2] = delz;
          snaptr[tid]->inside[ninside] = j;
          snaptr[tid]->wj[ninside] = wjelem[jtype];
          snaptr[tid]->rcutij[ninside] = (radi+radelem[jtype])*rcutfac;
          snaptr->rij[ninside][0] = delx;
          snaptr->rij[ninside][1] = dely;
          snaptr->rij[ninside][2] = delz;
          snaptr->inside[ninside] = j;
          snaptr->wj[ninside] = wjelem[jtype];
          snaptr->rcutij[ninside] = (radi+radelem[jtype])*rcutfac;
          ninside++;
        }
      }

      snaptr[tid]->compute_ui(ninside);
      snaptr[tid]->compute_zi();
      snaptr->compute_ui(ninside);
      snaptr->compute_zi();
      if (quadraticflag) {
        snaptr[tid]->compute_bi();
        snaptr[tid]->copy_bi2bvec();
        snaptr->compute_bi();
        snaptr->copy_bi2bvec();
      }

      for (int jj = 0; jj < ninside; jj++) {
        const int j = snaptr[tid]->inside[jj];
        const int j = snaptr->inside[jj];

        snaptr[tid]->compute_duidrj(snaptr[tid]->rij[jj],
                                    snaptr[tid]->wj[jj],
                                    snaptr[tid]->rcutij[jj]);
        snaptr[tid]->compute_dbidrj();
        snaptr[tid]->copy_dbi2dbvec();
        snaptr->compute_duidrj(snaptr->rij[jj],
                                    snaptr->wj[jj],
                                    snaptr->rcutij[jj]);
        snaptr->compute_dbidrj();
        snaptr->copy_dbi2dbvec();

        // Accumulate -dBi/dRi*Ri, -dBi/dRj*Rj

@@ -301,18 +278,18 @@ void ComputeSNAVAtom::compute_peratom()
        double *snavj = snav[j]+typeoffset;

        for (int icoeff = 0; icoeff < ncoeff; icoeff++) {
          snavi[icoeff]           += snaptr[tid]->dbvec[icoeff][0]*xtmp;
          snavi[icoeff+nperdim]   += snaptr[tid]->dbvec[icoeff][1]*ytmp;
          snavi[icoeff+2*nperdim] += snaptr[tid]->dbvec[icoeff][2]*ztmp;
          snavi[icoeff+3*nperdim] += snaptr[tid]->dbvec[icoeff][1]*ztmp;
          snavi[icoeff+4*nperdim] += snaptr[tid]->dbvec[icoeff][0]*ztmp;
          snavi[icoeff+5*nperdim] += snaptr[tid]->dbvec[icoeff][0]*ytmp;
          snavj[icoeff]           -= snaptr[tid]->dbvec[icoeff][0]*x[j][0];
          snavj[icoeff+nperdim]   -= snaptr[tid]->dbvec[icoeff][1]*x[j][1];
          snavj[icoeff+2*nperdim] -= snaptr[tid]->dbvec[icoeff][2]*x[j][2];
          snavj[icoeff+3*nperdim] -= snaptr[tid]->dbvec[icoeff][1]*x[j][2];
          snavj[icoeff+4*nperdim] -= snaptr[tid]->dbvec[icoeff][0]*x[j][2];
          snavj[icoeff+5*nperdim] -= snaptr[tid]->dbvec[icoeff][0]*x[j][1];
          snavi[icoeff]           += snaptr->dbvec[icoeff][0]*xtmp;
          snavi[icoeff+nperdim]   += snaptr->dbvec[icoeff][1]*ytmp;
          snavi[icoeff+2*nperdim] += snaptr->dbvec[icoeff][2]*ztmp;
          snavi[icoeff+3*nperdim] += snaptr->dbvec[icoeff][1]*ztmp;
          snavi[icoeff+4*nperdim] += snaptr->dbvec[icoeff][0]*ztmp;
          snavi[icoeff+5*nperdim] += snaptr->dbvec[icoeff][0]*ytmp;
          snavj[icoeff]           -= snaptr->dbvec[icoeff][0]*x[j][0];
          snavj[icoeff+nperdim]   -= snaptr->dbvec[icoeff][1]*x[j][1];
          snavj[icoeff+2*nperdim] -= snaptr->dbvec[icoeff][2]*x[j][2];
          snavj[icoeff+3*nperdim] -= snaptr->dbvec[icoeff][1]*x[j][2];
          snavj[icoeff+4*nperdim] -= snaptr->dbvec[icoeff][0]*x[j][2];
          snavj[icoeff+5*nperdim] -= snaptr->dbvec[icoeff][0]*x[j][1];
        }

        if (quadraticflag) {
@@ -321,10 +298,10 @@ void ComputeSNAVAtom::compute_peratom()
          snavj += quadraticoffset;
          int ncount = 0;
          for (int icoeff = 0; icoeff < ncoeff; icoeff++) {
            double bi = snaptr[tid]->bvec[icoeff];
            double bix = snaptr[tid]->dbvec[icoeff][0];
            double biy = snaptr[tid]->dbvec[icoeff][1];
            double biz = snaptr[tid]->dbvec[icoeff][2];
            double bi = snaptr->bvec[icoeff];
            double bix = snaptr->dbvec[icoeff][0];
            double biy = snaptr->dbvec[icoeff][1];
            double biz = snaptr->dbvec[icoeff][2];

            // diagonal element of quadratic matrix

@@ -348,12 +325,12 @@ void ComputeSNAVAtom::compute_peratom()
            // upper-triangular elements of quadratic matrix

            for (int jcoeff = icoeff+1; jcoeff < ncoeff; jcoeff++) {
              double dbxtmp = bi*snaptr[tid]->dbvec[jcoeff][0]
                + bix*snaptr[tid]->bvec[jcoeff];
              double dbytmp = bi*snaptr[tid]->dbvec[jcoeff][1]
                + biy*snaptr[tid]->bvec[jcoeff];
              double dbztmp = bi*snaptr[tid]->dbvec[jcoeff][2]
                + biz*snaptr[tid]->bvec[jcoeff];
              double dbxtmp = bi*snaptr->dbvec[jcoeff][0]
                + bix*snaptr->bvec[jcoeff];
              double dbytmp = bi*snaptr->dbvec[jcoeff][1]
                + biy*snaptr->bvec[jcoeff];
              double dbztmp = bi*snaptr->dbvec[jcoeff][2]
                + biz*snaptr->bvec[jcoeff];
              snavi[ncount] +=           dbxtmp*xtmp;
              snavi[ncount+nperdim] +=   dbytmp*ytmp;
              snavi[ncount+2*nperdim] += dbztmp*ztmp;
@@ -419,6 +396,5 @@ double ComputeSNAVAtom::memory_usage()
  bytes += njmax*sizeof(int);
  bytes += 6*nperdim*atom->ntypes;
  if (quadraticflag) bytes += 6*nperdim*atom->ntypes;
  bytes += snaptr[0]->memory_usage()*comm->nthreads;
  return bytes;
}
Loading