diff --git a/src/compute_centro_atom.cpp b/src/compute_centro_atom.cpp index dc51ba7ad1..c534b91541 100644 --- a/src/compute_centro_atom.cpp +++ b/src/compute_centro_atom.cpp @@ -100,7 +100,7 @@ void ComputeCentroAtom::compute_peratom() memory->sfree(centro); nmax = atom->nmax; centro = (double *) - memory->smalloc(nmax*sizeof(double),"compute/centro/atom:centro"); + memory->smalloc(nmax*sizeof(double),"compute/centro:centro"); scalar_atom = centro; } @@ -137,9 +137,9 @@ void ComputeCentroAtom::compute_peratom() memory->sfree(nearest); maxneigh = jnum; distsq = (double *) memory->smalloc(maxneigh*sizeof(double), - "compute/centro/atom:distsq"); + "compute/centro:distsq"); nearest = (int *) memory->smalloc(maxneigh*sizeof(int), - "compute/centro/atom:nearest"); + "compute/centro:nearest"); } // loop over list of all neighbors within force cutoff diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp index f2b725177d..fe0b08edcb 100644 --- a/src/compute_reduce.cpp +++ b/src/compute_reduce.cpp @@ -29,6 +29,7 @@ using namespace LAMMPS_NS; enum{SUM,MINN,MAXX}; enum{X,V,F,COMPUTE,FIX,VARIABLE}; +enum{DUMMY0,INVOKED_SCALAR,INVOKED_VECTOR,DUMMMY3,INVOKED_PERATOM}; #define MIN(A,B) ((A) < (B)) ? (A) : (B) #define MAX(A,B) ((A) > (B)) ? (A) : (B) @@ -284,15 +285,18 @@ double ComputeReduce::compute_one(int m) // invoke compute if not previously invoked } else if (which[m] == COMPUTE) { - if (modify->compute[n]->invoked_peratom != update->ntimestep) - modify->compute[n]->compute_peratom(); + Compute *compute = modify->compute[n]; + if (!(compute->invoked_flag & INVOKED_PERATOM)) { + compute->compute_peratom(); + compute->invoked_flag |= INVOKED_PERATOM; + } if (j == 0) { - double *compute_scalar = modify->compute[n]->scalar_atom; + double *compute_scalar = compute->scalar_atom; for (i = 0; i < nlocal; i++) if (mask[i] & groupbit) combine(one,compute_scalar[i]); } else { - double **compute_vector = modify->compute[n]->vector_atom; + double **compute_vector = compute->vector_atom; int jm1 = j - 1; for (i = 0; i < nlocal; i++) if (mask[i] & groupbit) combine(one,compute_vector[i][jm1]); diff --git a/src/integrate.cpp b/src/integrate.cpp index 372a5f8227..eaabb24c8e 100644 --- a/src/integrate.cpp +++ b/src/integrate.cpp @@ -105,8 +105,8 @@ void Integrate::ev_set(int ntimestep) if (elist_atom[i]->matchstep(ntimestep)) break; if (i < nelist_atom) eflag_atom = 2; - if (eflag_global) update->eflag_global = update->ntimestep; - if (eflag_atom) update->eflag_atom = update->ntimestep; + if (eflag_global) update->eflag_global = ntimestep; + if (eflag_atom) update->eflag_atom = ntimestep; eflag = eflag_global + eflag_atom; int vflag_global = 0; @@ -119,7 +119,7 @@ void Integrate::ev_set(int ntimestep) if (vlist_atom[i]->matchstep(ntimestep)) break; if (i < nvlist_atom) vflag_atom = 4; - if (vflag_global) update->vflag_global = update->ntimestep; - if (vflag_atom) update->vflag_atom = update->ntimestep; + if (vflag_global) update->vflag_global = ntimestep; + if (vflag_atom) update->vflag_atom = ntimestep; vflag = vflag_global + vflag_atom; }