18 |
|
curX = getCoor(); |
19 |
|
curG.resize(ndim); |
20 |
|
|
21 |
< |
//preMove(); |
21 |
> |
shakeAlgo = new ShakeMinFramework(theInfo); |
22 |
> |
shakeAlgo->doPreConstraint(); |
23 |
|
} |
24 |
|
|
25 |
|
OOPSEMinimizer::~OOPSEMinimizer(){ |
39 |
|
double force[3]; |
40 |
|
double dAtomGrad[6]; |
41 |
|
int shakeStatus; |
42 |
+ |
|
43 |
+ |
status = 1; |
44 |
|
|
45 |
|
setCoor(x); |
46 |
|
|
47 |
< |
//if (nConstrained && bShake){ |
48 |
< |
// shakeStatus = shakeR(); |
49 |
< |
//} |
47 |
> |
if (bShake){ |
48 |
> |
shakeStatus = shakeAlgo->doShakeR(); |
49 |
> |
if(shakeStatus < 0) |
50 |
> |
status = -1; |
51 |
> |
} |
52 |
|
|
48 |
– |
shakeAlgo->doShakeR(); |
49 |
– |
|
53 |
|
calcForce(1, 1); |
51 |
– |
|
52 |
– |
//if (nConstrained && bShake){ |
53 |
– |
// shakeStatus |= shakeF(); |
54 |
– |
//} |
54 |
|
|
55 |
< |
shakeAlgo->doShakeF(); |
56 |
< |
|
55 |
> |
if (bShake){ |
56 |
> |
shakeStatus = shakeAlgo->doShakeF(); |
57 |
> |
if(shakeStatus < 0) |
58 |
> |
status = -1; |
59 |
> |
} |
60 |
> |
|
61 |
|
x = getCoor(); |
62 |
|
|
63 |
|
|
91 |
|
|
92 |
|
energy = tStats->getPotential(); |
93 |
|
|
91 |
– |
status = shakeStatus; |
94 |
|
} |
95 |
|
|
96 |
|
/** |
549 |
|
lsTol = paramSet->getLineSearchTol(); |
550 |
|
|
551 |
|
//calculate the derivative at a = 0 |
552 |
+ |
slopeA = 0; |
553 |
|
for (size_t i = 0; i < ndim; i++) |
554 |
|
slopeA += curG[i]*direction[i]; |
555 |
|
|
724 |
|
|
725 |
|
stepStatus = step(); |
726 |
|
|
727 |
+ |
if (bShake) |
728 |
+ |
shakeAlgo->doPreConstraint(); |
729 |
+ |
|
730 |
|
if (stepStatus < 0){ |
731 |
|
saveResult(); |
732 |
|
minStatus = MIN_LSERROR; |
739 |
|
writeOut(curX, curIter); |
740 |
|
} |
741 |
|
|
736 |
– |
//if (curIter == nextResetIter){ |
737 |
– |
// reset(); |
738 |
– |
// nextResetIter += resetFrq; |
739 |
– |
//} |
740 |
– |
|
742 |
|
convgStatus = checkConvg(); |
743 |
|
|
744 |
|
if (convgStatus > 0){ |