diff --git a/src/USER-OMP/fix_shear_history_omp.cpp b/src/USER-OMP/fix_shear_history_omp.cpp index b5aa41b90b..d410f6363c 100644 --- a/src/USER-OMP/fix_shear_history_omp.cpp +++ b/src/USER-OMP/fix_shear_history_omp.cpp @@ -147,5 +147,6 @@ void FixShearHistoryOMP::pre_exchange() int flag_all; MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world); - if (flag_all) error->all(FLERR,"Too many touching neighbors - boost MAXTOUCH"); + if (flag_all) + error->all(FLERR,"Too many touching neighbors - boost MAXTOUCH"); } diff --git a/src/USER-OMP/fix_wall_gran_omp.cpp b/src/USER-OMP/fix_wall_gran_omp.cpp index 030bf12679..e131acc0fa 100644 --- a/src/USER-OMP/fix_wall_gran_omp.cpp +++ b/src/USER-OMP/fix_wall_gran_omp.cpp @@ -23,8 +23,7 @@ using namespace LAMMPS_NS; using namespace FixConst; - -enum{XPLANE,YPLANE,ZPLANE,ZCYLINDER}; // XYZ PLANE need to be 0,1,2 +enum{XPLANE=0,YPLANE=1,ZPLANE=2,ZCYLINDER}; // XYZ PLANE need to be 0,1,2 enum{HOOKE,HOOKE_HISTORY,HERTZ_HISTORY}; #define BIG 1.0e20 @@ -75,8 +74,7 @@ void FixWallGranOMP::post_force(int vflag) const int * const mask = atom->mask; const int nlocal = atom->nlocal; - if (update->ntimestep > laststep) shearupdate = 1; - else shearupdate = 0; + shearupdate = (update->setupflag) ? 0 : 1; int i; #if defined(_OPENMP) @@ -140,8 +138,6 @@ void FixWallGranOMP::post_force(int vflag) } } } - - laststep = update->ntimestep; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-OMP/pair_gran_hertz_history_omp.cpp b/src/USER-OMP/pair_gran_hertz_history_omp.cpp index 4de7f12bad..7c30321735 100644 --- a/src/USER-OMP/pair_gran_hertz_history_omp.cpp +++ b/src/USER-OMP/pair_gran_hertz_history_omp.cpp @@ -41,12 +41,13 @@ void PairGranHertzHistoryOMP::compute(int eflag, int vflag) ev_setup(eflag,vflag); } else evflag = vflag_fdotr = 0; - const int shearupdate = (update->ntimestep > laststep) ? 1 : 0; - const int nall = atom->nlocal + atom->nghost; const int nthreads = comm->nthreads; const int inum = list->inum; + computeflag = 1; + const int shearupdate = (update->setupflag) ? 0 : 1; + #if defined(_OPENMP) #pragma omp parallel default(none) shared(eflag,vflag) #endif @@ -66,7 +67,6 @@ void PairGranHertzHistoryOMP::compute(int eflag, int vflag) reduce_thr(this, eflag, vflag, thr); } // end of omp parallel region - laststep = update->ntimestep; } template diff --git a/src/USER-OMP/pair_gran_hooke_history_omp.cpp b/src/USER-OMP/pair_gran_hooke_history_omp.cpp index dc298de7e5..7fcfd5d0da 100644 --- a/src/USER-OMP/pair_gran_hooke_history_omp.cpp +++ b/src/USER-OMP/pair_gran_hooke_history_omp.cpp @@ -46,7 +46,8 @@ void PairGranHookeHistoryOMP::compute(int eflag, int vflag) ev_setup(eflag,vflag); } else evflag = vflag_fdotr = 0; - const int shearupdate = (update->ntimestep > laststep) ? 1 : 0; + computeflag = 1; + const int shearupdate = (update->setupflag) ? 0 : 1; const int nall = atom->nlocal + atom->nghost; const int nthreads = comm->nthreads; @@ -71,7 +72,6 @@ void PairGranHookeHistoryOMP::compute(int eflag, int vflag) reduce_thr(this, eflag, vflag, thr); } // end of omp parallel region - laststep = update->ntimestep; } template @@ -89,7 +89,7 @@ void PairGranHookeHistoryOMP::eval(int iifrom, int iito, ThrData * const thr) double shrmag,rsht; int *ilist,*jlist,*numneigh,**firstneigh; int *touch,**firsttouch; - double *shear,*allshear,**firstshear; + double *allshear,**firstshear; const double * const * const x = atom->x; const double * const * const v = atom->v;