diff -Naur lammps-9Jan08/doc/variable.html lammps-10Jan08/doc/variable.html --- lammps-9Jan08/doc/variable.html 2008-01-08 16:13:53.000000000 -0700 +++ lammps-10Jan08/doc/variable.html 2008-01-08 16:23:02.000000000 -0700 @@ -24,7 +24,7 @@ world args = one string for each partition of processors universe args = one or more strings uloop args = N = integer size of loop - equal or atom args = one formula containing numbers, thermo keywords, math operations, group functions, atom values and vectors, compute and fix references, other variables + equal or atom args = one formula containing numbers, thermo keywords, math operations, group functions, atom values and vectors, compute/fix/variable references numbers = 0.0, 100, -5.4, 2.8e-4, etc thermo keywords = vol, ke, press, etc from thermo_style math operations = (), -x, x+y, x-y, x*y, x/y, x^y, sqrt(x), exp(x), ln(x) @@ -50,7 +50,7 @@ variable b equal xcm(mol1,x)/2.0 variable b equal c_myTemp variable b atom x*y/vol -variable temp world 300.0 310.0 320.0 $Tfinal +variable temp world 300.0 310.0 320.0 ${Tfinal} variable x universe 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 variable x uloop 15 diff -Naur lammps-9Jan08/doc/variable.txt lammps-10Jan08/doc/variable.txt --- lammps-9Jan08/doc/variable.txt 2008-01-08 16:13:53.000000000 -0700 +++ lammps-10Jan08/doc/variable.txt 2008-01-08 16:23:02.000000000 -0700 @@ -19,7 +19,7 @@ {world} args = one string for each partition of processors {universe} args = one or more strings {uloop} args = N = integer size of loop - {equal} or {atom} args = one formula containing numbers, thermo keywords, math operations, group functions, atom values and vectors, compute and fix references, other variables + {equal} or {atom} args = one formula containing numbers, thermo keywords, math operations, group functions, atom values and vectors, compute/fix/variable references numbers = 0.0, 100, -5.4, 2.8e-4, etc thermo keywords = vol, ke, press, etc from "thermo_style"_thermo_style.html math operations = (), -x, x+y, x-y, x*y, x/y, x^y, sqrt(x), exp(x), ln(x) @@ -44,7 +44,7 @@ variable b equal xcm(mol1,x)/2.0 variable b equal c_myTemp variable b atom x[]*y[]/vol -variable temp world 300.0 310.0 320.0 ${Tfinal} +variable temp world 300.0 310.0 320.0 $\{Tfinal\} variable x universe 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 variable x uloop 15 :pre diff -Naur lammps-9Jan08/src/MANYBODY/pair_airebo.cpp lammps-10Jan08/src/MANYBODY/pair_airebo.cpp --- lammps-9Jan08/src/MANYBODY/pair_airebo.cpp 2007-12-05 12:12:29.000000000 -0700 +++ lammps-10Jan08/src/MANYBODY/pair_airebo.cpp 2008-01-08 16:34:19.000000000 -0700 @@ -67,8 +67,8 @@ memory->sfree(REBO_firstneigh); for (int i = 0; i < maxpage; i++) memory->sfree(pages[i]); memory->sfree(pages); - delete [] nC; - delete [] nH; + memory->sfree(nC); + memory->sfree(nH); if (allocated) { memory->destroy_2d_int_array(setflag); @@ -309,14 +309,14 @@ maxlocal = atom->nmax; memory->sfree(REBO_numneigh); memory->sfree(REBO_firstneigh); - delete [] nC; - delete [] nH; + memory->sfree(nC); + memory->sfree(nH); REBO_numneigh = (int *) memory->smalloc(maxlocal*sizeof(int),"AIREBO:numneigh"); REBO_firstneigh = (int **) memory->smalloc(maxlocal*sizeof(int *),"AIREBO:firstneigh"); - nC = new double[maxlocal]; - nH = new double[maxlocal]; + nC = (double *) memory->smalloc(maxlocal*sizeof(double),"AIREBO:nC"); + nH = (double *) memory->smalloc(maxlocal*sizeof(double),"AIREBO:nH"); } inum = list->inum; @@ -4021,3 +4021,17 @@ Tf[2][2][1] = -0.035140; for (i = 2; i < 10; i++) Tf[2][2][i] = -0.0040480; } + +/* ---------------------------------------------------------------------- + memory usage of local atom-based arrays +------------------------------------------------------------------------- */ + +double PairAIREBO::memory_usage() +{ + double bytes = 0.0; + bytes += maxlocal * sizeof(int); + bytes += maxlocal * sizeof(int *); + bytes += maxpage * neighbor->pgsize * sizeof(int); + bytes += 2 * maxlocal * sizeof(double); + return bytes; +} diff -Naur lammps-9Jan08/src/MANYBODY/pair_airebo.h lammps-10Jan08/src/MANYBODY/pair_airebo.h --- lammps-9Jan08/src/MANYBODY/pair_airebo.h 2008-01-02 12:24:46.000000000 -0700 +++ lammps-10Jan08/src/MANYBODY/pair_airebo.h 2008-01-08 16:34:19.000000000 -0700 @@ -27,10 +27,7 @@ void coeff(int, char **); void init_style(); double init_one(int, int); - void write_restart(FILE *) {} - void read_restart(FILE *) {} - void write_restart_settings(FILE *) {} - void read_restart_settings(FILE *) {} + double memory_usage(); private: int me; @@ -52,7 +49,7 @@ int *REBO_numneigh; // # of pair neighbors for each atom int **REBO_firstneigh; // ptr to 1st neighbor of each atom - double *nC,*nH; // sum of weighing fns with REBO neighs + double *nC,*nH; // sum of weighting fns with REBO neighs double smin,Nmin,Nmax,NCmin,NCmax,thmin,thmax; double rcmin[2][2],rcmax[2][2],rcmaxsq[2][2],rcmaxp[2][2]; diff -Naur lammps-9Jan08/src/MEAM/pair_meam.cpp lammps-10Jan08/src/MEAM/pair_meam.cpp --- lammps-9Jan08/src/MEAM/pair_meam.cpp 2007-12-04 08:18:21.000000000 -0700 +++ lammps-10Jan08/src/MEAM/pair_meam.cpp 2008-01-08 16:34:19.000000000 -0700 @@ -904,10 +904,10 @@ double PairMEAM::memory_usage() { - double bytes = 7 * nmax * sizeof(double); + double bytes = 11 * nmax * sizeof(double); bytes += (3 + 6 + 10 + 3 + 3) * nmax * sizeof(double); bytes += 3*3 * nmax * sizeof(double); - bytes += 2 * maxneigh * sizeof(double); + bytes += 3 * maxneigh * sizeof(double); return bytes; } diff -Naur lammps-9Jan08/src/variable.cpp lammps-10Jan08/src/variable.cpp --- lammps-9Jan08/src/variable.cpp 2008-01-08 16:13:53.000000000 -0700 +++ lammps-10Jan08/src/variable.cpp 2008-01-09 08:39:05.000000000 -0700 @@ -565,9 +565,13 @@ // istop = end of number, including scientific notation int istart = i; - int istop = istart + strspn(&str[i],"0123456789eE.-") - 1; - while (str[istop] == '-') istop--; - i = istop + 1; + while (isdigit(str[i]) || str[i] == '.') i++; + if (str[i] == 'e' || str[i] == 'E') { + i++; + if (str[i] == '+' || str[i] == '-') i++; + while (isdigit(str[i])) i++; + } + int istop = i - 1; int n = istop - istart + 1; char *number = new char[n+1];