53#include "brains/Register.hpp"
56#include "integrators/Integrator.hpp"
60#include "optimization/OptimizationFactory.hpp"
61#include "optimization/PotentialEnergyObjectiveFunction.hpp"
63#include "utils/CaseConversion.hpp"
64#include "utils/Revision.hpp"
65#include "utils/simError.h"
68using namespace QuantLib;
70int main(
int argc,
char* argv[]) {
74 MPI_Init(&argc, &argv);
86 "+------------------------------------------------------------------"
89 <<
" | ____ __ ___ ____ "
92 <<
" | / __ \\____ ___ ____ / |/ // __ \\ The Open Molecular "
94 <<
" | / / / / __ \\/ _ \\/ __ \\ / /|_/ // / / / Engine (formerly "
96 <<
" | / /_/ / /_/ / __/ / / // / / // /_/ / "
99 <<
" | \\____/ .___/\\___/_/ /_//_/ /_//_____/ Copyright "
102 <<
" | /_/ University of Notre "
104 <<
" | http://openmd.org "
110 <<
" | " << r.getFullRevision() <<
" |\n"
111 <<
" | " << r.getBuildDate()
116 <<
" | OpenMD is an OpenScience project. All source code is "
119 <<
" | use whatsoever under a BSD-style license. "
125 <<
" | Support OpenScience! If you use OpenMD or its source code in "
128 <<
" | research, please cite the appropriate papers when you publish "
131 <<
" | Good starting points for code and simulation methodology are: "
137 <<
" | [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). "
140 <<
" | [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). "
143 <<
" | [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). "
146 <<
" | [4] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, "
149 <<
" | [5] Kuang & Gezelter, Mol. Phys., 110, 691-701 (2012). "
152 <<
" | [6] Lamichhane, Gezelter & Newman, J. Chem. Phys. 141, 134109 "
154 <<
" | [7] Lamichhane, Newman & Gezelter, J. Chem. Phys. 141, 134110 "
156 <<
" | [8] Bhattarai, Newman & Gezelter, Phys. Rev. B 99, 094106 "
160 "+------------------------------------------------------------------"
166 strcpy(painCave.errMsg,
167 "No meta-data file was specified on the command line.\n");
168 painCave.isFatal = 1;
175 strcpy(checkPointMsg,
"Successful number of arguments");
183 SimInfo* info = creator.createSim(argv[1]);
185 Globals* simParams = info->getSimParams();
188 if (miniPars->getUseMinimizer() && simParams->haveEnsemble()) {
190 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
191 "Ensemble keyword can not co-exist with useMinimizer = \"true\" in the "
192 "minimizer block\n");
193 painCave.isFatal = 1;
197 if (miniPars->getUseMinimizer()) {
201 toUpperCopy(miniPars->getMethod()), info);
203 if (myMinimizer == NULL) {
204 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
205 "Optimization Factory can not create %s OptimizationMethod\n",
206 miniPars->getMethod().c_str());
207 painCave.isFatal = 1;
217 DynamicVector<RealType> initCoords = potObjf.setInitialCoords();
218 Problem problem(potObjf, noConstraint, dsf, initCoords);
220 int maxIter = miniPars->getMaxIterations();
221 int mssIter = miniPars->getMaxStationaryStateIterations();
222 RealType rEps = miniPars->getRootEpsilon();
223 RealType fEps = miniPars->getFunctionEpsilon();
224 RealType gnEps = miniPars->getGradientNormEpsilon();
225 RealType initialStepSize = miniPars->getInitialStepSize();
227 EndCriteria endCriteria(maxIter, mssIter, rEps, fEps, gnEps);
228 myMinimizer->minimize(problem, endCriteria, initialStepSize);
231 }
else if (simParams->haveEnsemble()) {
235 toUpperCopy(simParams->getEnsemble()), info);
237 if (myIntegrator == NULL) {
238 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
239 "Integrator Factory can not create %s Integrator\n",
240 simParams->getEnsemble().c_str());
241 painCave.isFatal = 1;
245 myIntegrator->integrate();
248 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
249 "Integrator Factory can not create %s Integrator\n",
250 simParams->getEnsemble().c_str());
251 painCave.isFatal = 1;
257 strcpy(checkPointMsg,
"Great googly moogly! It worked!");
Abstract constraint class.
Abstract optimization method class.
Abstract optimization problem class.
ForceManager is responsible for calculating both the short range (bonded) interactions and long range...
static IntegratorFactory & getInstance()
Returns an instance of Integrator factory.
Declaration of the Integrator base class, which all other integrators inherit from.
static OptimizationFactory & getInstance()
Returns an instance of Optimization factory.
The only responsibility of SimCreator is to parse the meta-data file and create a SimInfo instance ba...
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
Criteria to end optimization process:
Abstract class for constrained optimization method.
Constrained optimization problem.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
void registerAll()
register force fields, integrators and optimizers