git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@2480 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2009-01-14 21:27:33 +00:00
parent 55af408961
commit 0fb2adb73c
3 changed files with 15 additions and 11 deletions

View File

@ -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

View File

@ -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]);

View File

@ -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;
}