| 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 |
|
|
| 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 |