38 |
|
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
39 |
|
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
|
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
+ |
* [6] Kuang & Gezelter, Mol. Phys., 110, 691-701 (2012). |
42 |
|
*/ |
43 |
|
|
44 |
|
#ifdef IS_MPI |
116 |
|
" | [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |\n"<< |
117 |
|
" | [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |\n"<< |
118 |
|
" | [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |\n"<< |
119 |
< |
" | [6] Kuang & Gezelter, Mol. Phys., in press (2012). |\n"<< |
119 |
> |
" | [6] Kuang & Gezelter, Mol. Phys., 110, 691-701 (2012). |\n"<< |
120 |
|
" +--------------------------------------------------------------------------+\n"<< |
121 |
|
"\n"; |
122 |
|
|
140 |
|
SimInfo* info = creator.createSim(argv[1]); |
141 |
|
|
142 |
|
Globals* simParams = info->getSimParams(); |
143 |
+ |
MinimizerParameters* miniPars = simParams->getMinimizerParameters(); |
144 |
|
|
145 |
< |
if (simParams->haveMinimizer() && simParams->haveEnsemble()) { |
146 |
< |
sprintf(painCave.errMsg, "Minimizer keyword and Ensemble keyword can not exist together\n"); |
145 |
> |
if (miniPars->getUseMinimizer() && simParams->haveEnsemble()) { |
146 |
> |
sprintf(painCave.errMsg, "Ensemble keyword can not co-exist with useMinimizer = \"true\" in the minimizer block\n"); |
147 |
|
painCave.isFatal = 1; |
148 |
|
simError(); |
149 |
|
} |
148 |
– |
|
150 |
|
|
151 |
< |
if (simParams->haveMinimizer()) { |
151 |
> |
if (miniPars->getUseMinimizer()) { |
152 |
|
//create minimizer |
153 |
< |
OptimizationMethod* myMinimizer =OptimizationFactory::getInstance()->createOptimization(toUpperCopy(simParams->getMinimizer()), info); |
153 |
> |
OptimizationMethod* myMinimizer =OptimizationFactory::getInstance()->createOptimization(toUpperCopy(miniPars->getMethod()), info); |
154 |
|
|
155 |
|
if (myMinimizer == NULL) { |
156 |
|
sprintf(painCave.errMsg, "Optimization Factory can not create %s OptimizationMethod\n", |
157 |
< |
simParams->getMinimizer().c_str()); |
157 |
> |
miniPars->getMethod().c_str()); |
158 |
|
painCave.isFatal = 1; |
159 |
|
simError(); |
160 |
|
} |
166 |
|
DumpStatusFunction dsf(info); |
167 |
|
DynamicVector<RealType> initCoords = potObjf.setInitialCoords(); |
168 |
|
Problem problem(potObjf, *(new NoConstraint()), dsf, initCoords); |
168 |
– |
EndCriteria endCriteria(1000, 100, 1e-5, 1e-5, 1e-5); |
169 |
|
|
170 |
+ |
|
171 |
+ |
int maxIter = miniPars->getMaxIterations(); |
172 |
+ |
int mssIter = miniPars->getMaxStationaryStateIterations(); |
173 |
+ |
RealType rEps = miniPars->getRootEpsilon(); |
174 |
+ |
RealType fEps = miniPars->getFunctionEpsilon(); |
175 |
+ |
RealType gnEps = miniPars->getGradientNormEpsilon(); |
176 |
+ |
|
177 |
+ |
EndCriteria endCriteria(maxIter, mssIter, rEps, fEps, gnEps); |
178 |
+ |
|
179 |
|
myMinimizer->minimize(problem, endCriteria); |
180 |
|
|
181 |
|
delete myMinimizer; |