diff -Naur lammps-24Nov08/src/min_cg.cpp lammps-29Nov08/src/min_cg.cpp --- lammps-24Nov08/src/min_cg.cpp 2008-11-24 08:02:29.000000000 -0700 +++ lammps-29Nov08/src/min_cg.cpp 2008-11-24 20:33:32.000000000 -0700 @@ -279,7 +279,9 @@ int i,fail,ntimestep; double beta,gg,dot[2],dotall[2]; + double *x = NULL; double *f = NULL; + if (ndof) f = atom->f[0]; for (i = 0; i < ndof; i++) h[i] = g[i] = f[i]; @@ -296,7 +298,8 @@ // line minimization along direction h from current atom->x eprevious = ecurrent; - fail = (this->*linemin)(ndof,atom->x[0],h,ecurrent,dmax,alpha_final,neval); + if (ndof) x = atom->x[0]; + fail = (this->*linemin)(ndof,x,h,ecurrent,dmax,alpha_final,neval); if (fail) return FAIL; // function evaluation criterion @@ -305,7 +308,7 @@ // energy tolerance criterion - if (fabs(ecurrent-eprevious) <= + if (fabs(ecurrent-eprevious) < update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY)) return ETOL; @@ -435,7 +438,8 @@ // return updated ptrs to caller since atoms may have migrated *pndof = ndof; - *px = atom->x[0]; + if (ndof) *px = atom->x[0]; + else *px = NULL; *ph = h; *peng = ecurrent; } diff -Naur lammps-24Nov08/src/min_sd.cpp lammps-29Nov08/src/min_sd.cpp --- lammps-24Nov08/src/min_sd.cpp 2008-11-24 08:02:29.000000000 -0700 +++ lammps-29Nov08/src/min_sd.cpp 2008-11-24 20:33:32.000000000 -0700 @@ -38,7 +38,9 @@ int i,fail,ntimestep; double dot,dotall; + double *x = NULL; double *f = NULL; + if (ndof) f = atom->f[0]; for (i = 0; i < ndof; i++) h[i] = f[i]; @@ -51,7 +53,8 @@ // line minimization along direction h from current atom->x eprevious = ecurrent; - fail = (this->*linemin)(ndof,atom->x[0],h,ecurrent,dmax,alpha_final,neval); + if (ndof) x = atom->x[0]; + fail = (this->*linemin)(ndof,x,h,ecurrent,dmax,alpha_final,neval); if (fail) return FAIL; // function evaluation criterion @@ -60,7 +63,7 @@ // energy tolerance criterion - if (fabs(ecurrent-eprevious) <= + if (fabs(ecurrent-eprevious) < update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY)) return ETOL; diff -Naur lammps-24Nov08/tools/matlab/readEAM.m lammps-29Nov08/tools/matlab/readEAM.m --- lammps-24Nov08/tools/matlab/readEAM.m 2008-02-29 17:06:37.000000000 -0700 +++ lammps-29Nov08/tools/matlab/readEAM.m 2008-12-01 08:19:10.000000000 -0700 @@ -143,7 +143,7 @@ end % Pair Potentials - n_pair = ntypes + (factorial(ntypes)/2); + n_pair = ntypes * (ntypes + 1) / 2; for np = 1 : 1 : n_pair for i = 1 : 1 : nr/5 pair(i,:,np) = str2num(fgetl(fid));