git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5451 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -193,15 +193,15 @@ int MinFire::iterate(int maxiter)
|
|||||||
neval++;
|
neval++;
|
||||||
|
|
||||||
// energy tolerance criterion
|
// energy tolerance criterion
|
||||||
|
// only check after DELAYSTEP elapsed since velocties reset to 0
|
||||||
// sync across replicas if running multi-replica minimization
|
// sync across replicas if running multi-replica minimization
|
||||||
|
|
||||||
if (update->etol > 0.0) {
|
if (update->etol > 0.0 && ntimestep-last_negative > DELAYSTEP) {
|
||||||
if (update->multireplica == 0) {
|
if (update->multireplica == 0) {
|
||||||
if (fabs(ecurrent-eprevious) <
|
if (fabs(ecurrent-eprevious) <
|
||||||
update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
|
update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
|
||||||
return ETOL;
|
return ETOL;
|
||||||
} else {
|
} else {
|
||||||
printf("EEE %g %g\n",ecurrent,eprevious);
|
|
||||||
if (fabs(ecurrent-eprevious) <
|
if (fabs(ecurrent-eprevious) <
|
||||||
update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
|
update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
|
||||||
flag = 0;
|
flag = 0;
|
||||||
|
|||||||
@ -35,6 +35,8 @@ enum{MAXITER,MAXEVAL,ETOL,FTOL,DOWNHILL,ZEROALPHA,ZEROFORCE,ZEROQUAD};
|
|||||||
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
|
#define MIN(A,B) ((A) < (B)) ? (A) : (B)
|
||||||
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
|
#define MAX(A,B) ((A) > (B)) ? (A) : (B)
|
||||||
|
|
||||||
|
#define DELAYSTEP 5
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
MinQuickMin::MinQuickMin(LAMMPS *lmp) : Min(lmp) {}
|
MinQuickMin::MinQuickMin(LAMMPS *lmp) : Min(lmp) {}
|
||||||
@ -82,6 +84,7 @@ int MinQuickMin::iterate(int maxiter)
|
|||||||
double dtvone,dtv,dtfm;
|
double dtvone,dtv,dtfm;
|
||||||
|
|
||||||
alpha_final = 0.0;
|
alpha_final = 0.0;
|
||||||
|
int last_negative = update->ntimestep;
|
||||||
|
|
||||||
for (int iter = 0; iter < maxiter; iter++) {
|
for (int iter = 0; iter < maxiter; iter++) {
|
||||||
ntimestep = ++update->ntimestep;
|
ntimestep = ++update->ntimestep;
|
||||||
@ -100,6 +103,7 @@ int MinQuickMin::iterate(int maxiter)
|
|||||||
MPI_Allreduce(&vdotf,&vdotfall,1,MPI_DOUBLE,MPI_SUM,world);
|
MPI_Allreduce(&vdotf,&vdotfall,1,MPI_DOUBLE,MPI_SUM,world);
|
||||||
|
|
||||||
if (vdotfall < 0.0) {
|
if (vdotfall < 0.0) {
|
||||||
|
last_negative = ntimestep;
|
||||||
for (int i = 0; i < nlocal; i++)
|
for (int i = 0; i < nlocal; i++)
|
||||||
v[i][0] = v[i][1] = v[i][2] = 0.0;
|
v[i][0] = v[i][1] = v[i][2] = 0.0;
|
||||||
|
|
||||||
@ -163,15 +167,15 @@ int MinQuickMin::iterate(int maxiter)
|
|||||||
neval++;
|
neval++;
|
||||||
|
|
||||||
// energy tolerance criterion
|
// energy tolerance criterion
|
||||||
|
// only check after DELAYSTEP elapsed since velocties reset to 0
|
||||||
// sync across replicas if running multi-replica minimization
|
// sync across replicas if running multi-replica minimization
|
||||||
|
|
||||||
if (update->etol > 0.0) {
|
if (update->etol > 0.0 && ntimestep-last_negative > DELAYSTEP) {
|
||||||
if (update->multireplica == 0) {
|
if (update->multireplica == 0) {
|
||||||
if (fabs(ecurrent-eprevious) <
|
if (fabs(ecurrent-eprevious) <
|
||||||
update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
|
update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
|
||||||
return ETOL;
|
return ETOL;
|
||||||
} else {
|
} else {
|
||||||
printf("EEE %g %g\n",ecurrent,eprevious);
|
|
||||||
if (fabs(ecurrent-eprevious) <
|
if (fabs(ecurrent-eprevious) <
|
||||||
update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
|
update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
|
||||||
flag = 0;
|
flag = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user