56#include "brains/Register.hpp"
59#include "integrators/Integrator.hpp"
63#include "optimization/OptimizationFactory.hpp"
64#include "optimization/PotentialEnergyObjectiveFunction.hpp"
66#include "utils/CaseConversion.hpp"
67#include "utils/Revision.hpp"
68#include "utils/simError.h"
71using namespace QuantLib;
73int main(
int argc,
char* argv[]) {
77 MPI_Init(&argc, &argv);
88 <<
" +--------------------------------------------------------------------------+\n"
89 <<
" | ____ __ ___ ____ |\n"
90 <<
" | / __ \\____ ___ ____ / |/ // __ \\ The Open Molecular Dynamics |\n"
91 <<
" | / / / / __ \\/ _ \\/ __ \\ / /|_/ // / / / Engine: openmd.org |\n"
92 <<
" | / /_/ / /_/ / __/ / / // / / // /_/ / |\n"
93 <<
" | \\____/ /___/\\___/_/ /_//_/ /_//_____/ Copyright 2004-2024 by the |\n"
94 <<
" | /_/ University of Notre Dame |\n"
96 <<
" | " << r.getHalfRevision() <<
" |\n"
98 <<
" | All source code is available under a BSD 3-Clause License. If you use |\n"
99 <<
" | OpenMD or its source code in your research, please cite the following |\n"
100 <<
" | paper when you publish your work: |\n"
102 <<
" | [1] Drisko et al., J. Open Source Softw. 9, 7004 (2024). |\n"
104 <<
" | Good starting points for code and simulation methodology are: |\n"
106 <<
" | [2] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |\n"
107 <<
" | [3] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |\n"
108 <<
" | [4] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). |\n"
109 <<
" | [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |\n"
110 <<
" | [6] Kuang & Gezelter, Mol. Phys., 110, 691-701 (2012). |\n"
111 <<
" | [7] Lamichhane, Gezelter & Newman, J. Chem. Phys. 141, 134109 (2014). |\n"
112 <<
" | [8] Bhattarai, Newman & Gezelter, Phys. Rev. B 99, 094106 (2019). |\n"
113 <<
" | [9] Drisko & Gezelter, J. Chem. Theory Comput. 20, 4986-4997 (2024). |\n"
114 <<
" +--------------------------------------------------------------------------+\n"
118 strcpy(painCave.errMsg,
119 "No meta-data file was specified on the command line.\n");
120 painCave.isFatal = 1;
127 strcpy(checkPointMsg,
"Successful number of arguments");
137 Globals* simParams = info->getSimParams();
140 if (miniPars->getUseMinimizer() && simParams->haveEnsemble()) {
142 painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
143 "Ensemble keyword can not co-exist with useMinimizer = \"true\" in the "
144 "minimizer block\n");
145 painCave.isFatal = 1;
149 if (miniPars->getUseMinimizer()) {
153 toUpperCopy(miniPars->getMethod()), info);
155 if (myMinimizer == NULL) {
156 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
157 "Optimization Factory can not create %s OptimizationMethod\n",
158 miniPars->getMethod().c_str());
159 painCave.isFatal = 1;
170 Problem problem(potObjf, noConstraint, dsf, initCoords);
172 int maxIter = miniPars->getMaxIterations();
173 int mssIter = miniPars->getMaxStationaryStateIterations();
174 RealType rEps = miniPars->getRootEpsilon();
175 RealType fEps = miniPars->getFunctionEpsilon();
176 RealType gnEps = miniPars->getGradientNormEpsilon();
177 RealType initialStepSize = miniPars->getInitialStepSize();
179 EndCriteria endCriteria(maxIter, mssIter, rEps, fEps, gnEps);
180 myMinimizer->
minimize(problem, endCriteria, initialStepSize);
183 }
else if (simParams->haveEnsemble()) {
187 toUpperCopy(simParams->getEnsemble()), info);
189 if (myIntegrator == NULL) {
190 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
191 "Integrator Factory can not create %s Integrator\n",
192 simParams->getEnsemble().c_str());
193 painCave.isFatal = 1;
197 myIntegrator->integrate();
200 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
201 "Integrator Factory can not create %s Integrator\n",
202 simParams->getEnsemble().c_str());
203 painCave.isFatal = 1;
209 strcpy(checkPointMsg,
"Great googly moogly! It worked!");
Abstract constraint class.
Abstract optimization method class.
Abstract optimization problem class.
Dynamically-sized vector class.
ForceManager is responsible for calculating both the short range (bonded) interactions and long range...
Integrator * createIntegrator(const std::string &id, SimInfo *info)
Looks up the type identifier in the internal map.
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.
QuantLib::OptimizationMethod * createOptimization(const std::string &id, SimInfo *info)
Looks up the type identifier in the internal map.
The only responsibility of SimCreator is to parse the meta-data file and create a SimInfo instance ba...
SimInfo * createSim(const std::string &mdFileName, bool loadInitCoords=true)
Setup Simulation.
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.
virtual EndCriteria::Type minimize(Problem &P, const EndCriteria &endCriteria, RealType initialStepSize)=0
minimize the optimization problem P
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