| 1 |
|
/* |
| 2 |
< |
* Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. |
| 2 |
> |
* Copyright (c) 2006 The University of Notre Dame. All Rights Reserved. |
| 3 |
|
* |
| 4 |
|
* The University of Notre Dame grants you ("Licensee") a |
| 5 |
|
* non-exclusive, royalty free, license to use, modify and |
| 43 |
|
#include <mpi.h> |
| 44 |
|
#endif |
| 45 |
|
|
| 46 |
+ |
#include <fstream> |
| 47 |
|
#include "utils/simError.h" |
| 48 |
+ |
#include "utils/CaseConversion.hpp" |
| 49 |
|
#include "brains/Register.hpp" |
| 50 |
|
#include "brains/SimCreator.hpp" |
| 51 |
|
#include "brains/SimInfo.hpp" |
| 54 |
|
#include "integrators/Integrator.hpp" |
| 55 |
|
#include "minimizers/MinimizerFactory.hpp" |
| 56 |
|
#include "minimizers/Minimizer.hpp" |
| 57 |
+ |
#include "restraints/ThermoIntegrationForceManager.hpp" |
| 58 |
+ |
|
| 59 |
|
using namespace oopse; |
| 60 |
|
|
| 61 |
+ |
|
| 62 |
|
int main(int argc,char* argv[]){ |
| 63 |
< |
|
| 63 |
> |
|
| 64 |
|
// first things first, all of the initializations |
| 65 |
|
|
| 66 |
|
#ifdef IS_MPI |
| 78 |
|
" | ____ ____ ____ _____ ______ The OpenSource, Object-oriented |\n" << |
| 79 |
|
" | / __ \\/ __ \\/ __ \\/ ___// ____/ Parallel Simulation Engine. |\n" << |
| 80 |
|
" | / / / / / / / /_/ /\\__ \\/ __/ |\n" << |
| 81 |
< |
" | / /_/ / /_/ / ____/___/ / /___ Copyright 2004-2005 by the |\n" << |
| 81 |
> |
" | / /_/ / /_/ / ____/___/ / /___ Copyright 2004-2008 by the |\n" << |
| 82 |
|
" | \\____/\\____/_/ /____/_____/ University of Notre Dame. |\n" << |
| 83 |
+ |
" | |\n" << |
| 84 |
|
" | version " << |
| 85 |
|
OOPSE_VERSION_MAJOR << "." << OOPSE_VERSION_MINOR << "." << OOPSE_VERSION_TINY << |
| 86 |
|
" http://www.oopse.org |\n" << |
| 104 |
|
} |
| 105 |
|
#endif |
| 106 |
|
|
| 101 |
– |
#ifdef IS_MPI |
| 107 |
|
strcpy( checkPointMsg, "Successful number of arguments" ); |
| 108 |
< |
MPIcheckPoint(); |
| 104 |
< |
#endif |
| 108 |
> |
errorCheckPoint(); |
| 109 |
|
|
| 106 |
– |
|
| 107 |
– |
|
| 110 |
|
//register forcefields, integrators and minimizers |
| 111 |
|
registerAll(); |
| 112 |
|
|
| 123 |
|
|
| 124 |
|
if (simParams->haveMinimizer()) { |
| 125 |
|
//create minimizer |
| 126 |
< |
Minimizer* myMinimizer = MinimizerFactory::getInstance()->createMinimizer(simParams->getMinimizer(), info); |
| 126 |
> |
Minimizer* myMinimizer = MinimizerFactory::getInstance()->createMinimizer(toUpperCopy(simParams->getMinimizer()), info); |
| 127 |
|
|
| 128 |
|
if (myMinimizer == NULL) { |
| 129 |
|
sprintf(painCave.errMsg, "Minimizer Factory can not create %s Minimizer\n", |
| 130 |
< |
simParams->getMinimizer()); |
| 130 |
> |
simParams->getMinimizer().c_str()); |
| 131 |
|
painCave.isFatal = 1; |
| 132 |
|
simError(); |
| 133 |
|
} |
| 137 |
|
} else if (simParams->haveEnsemble()) { |
| 138 |
|
//create Integrator |
| 139 |
|
|
| 140 |
< |
Integrator* myIntegrator = IntegratorFactory::getInstance()->createIntegrator(simParams->getEnsemble(), info); |
| 141 |
< |
|
| 140 |
> |
Integrator* myIntegrator = IntegratorFactory::getInstance()->createIntegrator(toUpperCopy(simParams->getEnsemble()), info); |
| 141 |
> |
|
| 142 |
|
if (myIntegrator == NULL) { |
| 143 |
|
sprintf(painCave.errMsg, "Integrator Factory can not create %s Integrator\n", |
| 144 |
< |
simParams->getEnsemble()); |
| 144 |
> |
simParams->getEnsemble().c_str()); |
| 145 |
|
painCave.isFatal = 1; |
| 146 |
|
simError(); |
| 147 |
|
} |
| 148 |
|
|
| 149 |
|
//Thermodynamic Integration Method |
| 150 |
< |
//ForceManager* fman = new ThermodynamicForceManager(info); |
| 151 |
< |
//myIntegrator->setForceManager(fman); |
| 150 |
> |
//set the force manager for thermodynamic integration if specified |
| 151 |
> |
if (simParams->getUseSolidThermInt() || simParams->getUseLiquidThermInt()){ |
| 152 |
> |
ForceManager* fman = new ThermoIntegrationForceManager(info); |
| 153 |
> |
myIntegrator->setForceManager(fman); |
| 154 |
> |
} |
| 155 |
|
|
| 151 |
– |
|
| 156 |
|
//Zconstraint-Method |
| 157 |
< |
if (simParams->haveZconstraints()) { |
| 158 |
< |
info->setNZconstraint(simParams->getNzConstraints()); |
| 157 |
> |
if (simParams->getNZconsStamps() > 0) { |
| 158 |
> |
info->setNZconstraint(simParams->getNZconsStamps()); |
| 159 |
|
ForceManager* fman = new ZconstraintForceManager(info); |
| 160 |
|
myIntegrator->setForceManager(fman); |
| 161 |
|
} |
| 164 |
|
delete myIntegrator; |
| 165 |
|
}else { |
| 166 |
|
sprintf(painCave.errMsg, "Integrator Factory can not create %s Integrator\n", |
| 167 |
< |
simParams->getEnsemble()); |
| 167 |
> |
simParams->getEnsemble().c_str()); |
| 168 |
|
painCave.isFatal = 1; |
| 169 |
|
simError(); |
| 170 |
|
} |
| 173 |
|
|
| 174 |
|
delete info; |
| 175 |
|
|
| 176 |
< |
#ifdef IS_MPI |
| 177 |
< |
strcpy( checkPointMsg, "Oh what a lovely Tea Party!" ); |
| 178 |
< |
MPIcheckPoint(); |
| 179 |
< |
|
| 176 |
> |
|
| 177 |
> |
strcpy( checkPointMsg, "Great googly moogly! It worked!" ); |
| 178 |
> |
errorCheckPoint(); |
| 179 |
> |
|
| 180 |
> |
#ifdef IS_MPI |
| 181 |
|
MPI_Finalize(); |
| 182 |
|
#endif |
| 183 |
|
|