ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/applications/openmd/openmd.cpp
(Generate patch)

Comparing branches/development/src/applications/openmd/openmd.cpp (file contents):
Revision 1665 by gezelter, Tue Nov 22 20:38:56 2011 UTC vs.
Revision 1744 by gezelter, Tue Jun 5 18:07:08 2012 UTC

# Line 54 | Line 54
54   #include "restraints/RestraintForceManager.hpp"
55   #include "integrators/IntegratorFactory.hpp"
56   #include "integrators/Integrator.hpp"
57 < #include "minimizers/MinimizerFactory.hpp"
58 < #include "minimizers/Minimizer.hpp"
57 > #include "optimization/OptimizationFactory.hpp"
58 > #include "optimization/Method.hpp"
59 > #include "optimization/Constraint.hpp"
60 > #include "optimization/Problem.hpp"
61 > #include "optimization/PotentialEnergyObjectiveFunction.hpp"
62   #include "restraints/ThermoIntegrationForceManager.hpp"
63  
64   using namespace OpenMD;
65 + using namespace QuantLib;
66  
67   int main(int argc,char* argv[]){
68    
# Line 92 | Line 96 | int main(int argc,char* argv[]){
96        "  |   / __ \\____  ___  ____   /  |/  // __ \\  The Open Molecular Dynamics    |\n"<<
97        "  |  / / / / __ \\/ _ \\/ __ \\ / /|_/ // / / /  Engine (formerly OOPSE).       |\n"<<
98        "  | / /_/ / /_/ /  __/ / / // /  / // /_/ /                                  |\n"<<
99 <      "  | \\____/ .___/\\___/_/ /_//_/  /_//_____/    Copyright 2004-2011 by the     |\n"<<
99 >      "  | \\____/ .___/\\___/_/ /_//_/  /_//_____/    Copyright 2004-2012 by the     |\n"<<
100        "  |     /_/                                   University of Notre Dame.      |\n"<<
101        "  |                                                                          |\n"<<
102        "  |        version " <<
# Line 111 | Line 115 | int main(int argc,char* argv[]){
115        "  | [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).               |\n"<<
116        "  | [4] Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).                |\n"<<
117        "  | [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |\n"<<
118 +      "  | [6] Kuang & Gezelter, Mol. Phys., in press (2012).                       |\n"<<
119        "  +--------------------------------------------------------------------------+\n"<<
120        "\n";
121      
# Line 144 | Line 149 | int main(int argc,char* argv[]){
149  
150    if (simParams->haveMinimizer()) {
151      //create minimizer
152 <    Minimizer* myMinimizer = MinimizerFactory::getInstance()->createMinimizer(toUpperCopy(simParams->getMinimizer()), info);
152 >    OptimizationMethod* myMinimizer =OptimizationFactory::getInstance()->createOptimization(toUpperCopy(simParams->getMinimizer()), info);
153  
154      if (myMinimizer == NULL) {
155 <      sprintf(painCave.errMsg, "Minimizer Factory can not create %s Minimizer\n",
155 >      sprintf(painCave.errMsg, "Optimization Factory can not create %s OptimizationMethod\n",
156                simParams->getMinimizer().c_str());
157        painCave.isFatal = 1;
158        simError();
159      }
160  
161 <    myMinimizer->minimize();
161 >    ForceManager* fman = new ForceManager(info);      
162 >    fman->initialize();
163 >
164 >    PotentialEnergyObjectiveFunction potObjf(info, fman);
165 >    DumpStatusFunction dsf(info);
166 >    DynamicVector<RealType> initCoords = potObjf.setInitialCoords();
167 >    Problem problem(potObjf, *(new NoConstraint()), dsf, initCoords);
168 >    EndCriteria endCriteria(1000, 100, 1e-5, 1e-5, 1e-5);
169 >
170 >    myMinimizer->minimize(problem, endCriteria);
171 >
172      delete myMinimizer;
173    } else if (simParams->haveEnsemble()) {
174      //create Integrator

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines