ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/OOPSEMinimizer.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/OOPSEMinimizer.cpp (file contents):
Revision 1234 by tim, Fri Jun 4 03:15:31 2004 UTC vs.
Revision 1248 by tim, Fri Jun 4 19:30:05 2004 UTC

# Line 18 | Line 18 | OOPSEMinimizer::OOPSEMinimizer( SimInfo *theInfo, Forc
18    curX = getCoor();
19    curG.resize(ndim);
20  
21 <  //preMove();
21 >  shakeAlgo = new ShakeMinFramework(theInfo);
22 >  shakeAlgo->doPreConstraint();
23   }
24  
25   OOPSEMinimizer::~OOPSEMinimizer(){
# Line 38 | Line 39 | void OOPSEMinimizer::calcEnergyGradient(vector<double>
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);
54 <  
55 <  //if (nConstrained && bShake){
56 <  //  shakeStatus |= shakeF();
57 <  //}
54 >
55 >  if (bShake){
56 >    shakeStatus = shakeAlgo->doShakeF();
57 >    if(shakeStatus < 0)
58 >      status = -1;
59 >  }
60  
56  shakeAlgo->doShakeF();
57  
61    x = getCoor();
62    
63  
# Line 88 | Line 91 | void OOPSEMinimizer::calcEnergyGradient(vector<double>
91  
92    energy = tStats->getPotential();
93  
91  status = shakeStatus;
94   }
95  
96   /**
# Line 721 | Line 723 | void OOPSEMinimizer::minimize(){
723  
724      stepStatus = step();
725  
726 +    if (bShake)
727 +      shakeAlgo->doPreConstraint();
728 +    
729      if (stepStatus < 0){
730        saveResult();
731        minStatus = MIN_LSERROR;
# Line 733 | Line 738 | void OOPSEMinimizer::minimize(){
738        writeOut(curX, curIter);
739      }
740  
736    //if (curIter == nextResetIter){
737    //  reset();
738    //  nextResetIter += resetFrq;      
739    //}
740
741      convgStatus = checkConvg();
742  
743      if (convgStatus > 0){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines