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 1097 by gezelter, Mon Apr 12 20:32:20 2004 UTC vs.
Revision 1234 by tim, Fri Jun 4 03:15:31 2004 UTC

# Line 1 | Line 1
1   #include <math.h>
2   #include "OOPSEMinimizer.hpp"
3 + #include "ShakeMin.hpp"
4  
5   OOPSEMinimizer::OOPSEMinimizer( SimInfo *theInfo, ForceFields* the_ff ,
6                                                MinimizerParameterSet * param)
7                       :RealIntegrator(theInfo, the_ff), bVerbose(false), bShake(true){
8 +  dumpOut = NULL;
9 +  statOut = NULL;
10  
11    tStats = new Thermo(info);
12 <  dumpOut = new DumpWriter(info);
10 <  statOut = new StatWriter(info);
12 >
13    
14    paramSet = param;
15  
# Line 16 | Line 18 | OOPSEMinimizer::OOPSEMinimizer( SimInfo *theInfo, Forc
18    curX = getCoor();
19    curG.resize(ndim);
20  
21 <  preMove();
21 >  //preMove();
22   }
23  
24   OOPSEMinimizer::~OOPSEMinimizer(){
25    delete tStats;
26 <  delete dumpOut;
27 <  delete statOut;
26 >  if(dumpOut)
27 >    delete dumpOut;
28 >  if(statOut)
29 >    delete statOut;
30    delete paramSet;
31   }
32  
# Line 37 | Line 41 | void OOPSEMinimizer::calcEnergyGradient(vector<double>
41    
42    setCoor(x);
43  
44 <  if (nConstrained && bShake){
45 <    shakeStatus = shakeR();
46 <  }
44 >  //if (nConstrained && bShake){
45 >  //  shakeStatus = shakeR();
46 >  //}
47 >
48 >  shakeAlgo->doShakeR();
49        
50    calcForce(1, 1);
51    
52 <  if (nConstrained && bShake){
53 <    shakeStatus |= shakeF();
54 <  }
52 >  //if (nConstrained && bShake){
53 >  //  shakeStatus |= shakeF();
54 >  //}
55 >
56 >  shakeAlgo->doShakeF();
57    
58    x = getCoor();
59    
# Line 159 | Line 167 | vector<double> OOPSEMinimizer::getCoor(){
167  
168   }
169  
170 + /*
171   int OOPSEMinimizer::shakeR(){
172    int i, j;
173    int done;
# Line 398 | Line 407 | int OOPSEMinimizer::shakeF(){
407      return 1;
408   }
409  
410 <    //calculate the value of object function
410 > */
411 >
412 > //calculate the value of object function
413   void OOPSEMinimizer::calcF(){
414    calcEnergyGradient(curX, curG, curF, egEvalStatus);
415   }
# Line 483 | Line 494 | void OOPSEMinimizer::printMinimizerInfo(){
494  
495   /**
496   * In thoery, we need to find the minimum along the search direction
497 < * However, function evaluation is too expensive. I
497 > * However, function evaluation is too expensive.
498   * At the very begining of the problem, we check the search direction and make sure
499   * it is a descent direction
500   * we will compare the energy of two end points,
# Line 692 | Line 703 | void OOPSEMinimizer::minimize(){
703    
704    if (bVerbose)
705      printMinimizerInfo();
706 +
707 +  dumpOut = new DumpWriter(info);
708 +  statOut = new StatWriter(info);
709    
710    init();
711  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines