# | Line 1 | Line 1 | |
---|---|---|
1 | < | /* |
1 | > | /* |
2 | * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. | |
3 | * | |
4 | * The University of Notre Dame grants you ("Licensee") a | |
# | Line 75 | Line 75 | int main(int argc,char* argv[]){ | |
75 | " | / / / / / / / /_/ /\\__ \\/ __/ |\n" << | |
76 | " | / /_/ / /_/ / ____/___/ / /___ Copyright 2004-2005 by the |\n" << | |
77 | " | \\____/\\____/_/ /____/_____/ University of Notre Dame. |\n" << | |
78 | < | " | http://www.oopse.org |\n" << |
78 | > | " | version " << |
79 | > | OOPSE_VERSION_MAJOR << "." << OOPSE_VERSION_MINOR << "." << OOPSE_VERSION_TINY << |
80 | > | " http://www.oopse.org |\n" << |
81 | " | |\n" << | |
82 | " | OOPSE is an OpenScience project. All source code is available for |\n" << | |
83 | " | any use subject to only one condition: |\n" << | |
# | Line 103 | Line 105 | int main(int argc,char* argv[]){ | |
105 | ||
106 | ||
107 | ||
108 | < | //register forcefields, integrators and minimizers |
109 | < | registerAll(); |
108 | > | //register forcefields, integrators and minimizers |
109 | > | registerAll(); |
110 | ||
111 | < | //create simulation model |
112 | < | SimCreator creator; |
113 | < | SimInfo* info = creator.createSim(argv[1]); |
114 | < | Globals* simParams = info->getSimParams(); |
111 | > | //create simulation model |
112 | > | SimCreator creator; |
113 | > | SimInfo* info = creator.createSim(argv[1]); |
114 | > | Globals* simParams = info->getSimParams(); |
115 | ||
116 | < | if (simParams->haveMinimizer() && simParams->haveEnsemble()) { |
117 | < | sprintf(painCave.errMsg, "Minimizer keyword and Ensemble keyword can not exist together\n"); |
118 | < | painCave.isFatal = 1; |
119 | < | simError(); |
120 | < | } |
116 | > | if (simParams->haveMinimizer() && simParams->haveEnsemble()) { |
117 | > | sprintf(painCave.errMsg, "Minimizer keyword and Ensemble keyword can not exist together\n"); |
118 | > | painCave.isFatal = 1; |
119 | > | simError(); |
120 | > | } |
121 | ||
122 | < | if (simParams->haveMinimizer()) { |
123 | < | //create minimizer |
124 | < | Minimizer* myMinimizer = MinimizerFactory::getInstance()->createMinimizer(simParams->getMinimizer(), info); |
122 | > | if (simParams->haveMinimizer()) { |
123 | > | //create minimizer |
124 | > | Minimizer* myMinimizer = MinimizerFactory::getInstance()->createMinimizer(simParams->getMinimizer(), info); |
125 | ||
126 | < | if (myMinimizer == NULL) { |
127 | < | sprintf(painCave.errMsg, "Minimizer Factory can not create %s Minimizer\n", |
128 | < | simParams->getMinimizer()); |
129 | < | painCave.isFatal = 1; |
130 | < | simError(); |
131 | < | } |
126 | > | if (myMinimizer == NULL) { |
127 | > | sprintf(painCave.errMsg, "Minimizer Factory can not create %s Minimizer\n", |
128 | > | simParams->getMinimizer()); |
129 | > | painCave.isFatal = 1; |
130 | > | simError(); |
131 | > | } |
132 | ||
133 | < | myMinimizer->minimize(); |
134 | < | delete myMinimizer; |
135 | < | } else if (simParams->haveEnsemble()) { |
136 | < | //create Integrator |
133 | > | myMinimizer->minimize(); |
134 | > | delete myMinimizer; |
135 | > | } else if (simParams->haveEnsemble()) { |
136 | > | //create Integrator |
137 | ||
138 | < | Integrator* myIntegrator = IntegratorFactory::getInstance()->createIntegrator(simParams->getEnsemble(), info); |
138 | > | Integrator* myIntegrator = IntegratorFactory::getInstance()->createIntegrator(simParams->getEnsemble(), info); |
139 | ||
140 | < | if (myIntegrator == NULL) { |
141 | < | sprintf(painCave.errMsg, "Integrator Factory can not create %s Integrator\n", |
142 | < | simParams->getEnsemble()); |
143 | < | painCave.isFatal = 1; |
144 | < | simError(); |
145 | < | } |
140 | > | if (myIntegrator == NULL) { |
141 | > | sprintf(painCave.errMsg, "Integrator Factory can not create %s Integrator\n", |
142 | > | simParams->getEnsemble()); |
143 | > | painCave.isFatal = 1; |
144 | > | simError(); |
145 | > | } |
146 | ||
147 | < | //Thermodynamic Integration Method |
148 | < | //ForceManager* fman = new ThermodynamicForceManager(info); |
149 | < | //myIntegrator->setForceManager(fman); |
147 | > | //Thermodynamic Integration Method |
148 | > | //ForceManager* fman = new ThermodynamicForceManager(info); |
149 | > | //myIntegrator->setForceManager(fman); |
150 | ||
151 | ||
152 | < | //Zconstraint-Method |
153 | < | if (simParams->haveZconstraints()) { |
154 | < | info->setNZconstraint(simParams->getNzConstraints()); |
155 | < | ForceManager* fman = new ZconstraintForceManager(info); |
156 | < | myIntegrator->setForceManager(fman); |
157 | < | } |
152 | > | //Zconstraint-Method |
153 | > | if (simParams->haveZconstraints()) { |
154 | > | info->setNZconstraint(simParams->getNzConstraints()); |
155 | > | ForceManager* fman = new ZconstraintForceManager(info); |
156 | > | myIntegrator->setForceManager(fman); |
157 | > | } |
158 | ||
159 | < | myIntegrator->integrate(); |
160 | < | delete myIntegrator; |
161 | < | }else { |
162 | < | sprintf(painCave.errMsg, "Integrator Factory can not create %s Integrator\n", |
159 | > | myIntegrator->integrate(); |
160 | > | delete myIntegrator; |
161 | > | }else { |
162 | > | sprintf(painCave.errMsg, "Integrator Factory can not create %s Integrator\n", |
163 | simParams->getEnsemble()); | |
164 | < | painCave.isFatal = 1; |
165 | < | simError(); |
166 | < | } |
164 | > | painCave.isFatal = 1; |
165 | > | simError(); |
166 | > | } |
167 | ||
168 | ||
169 | ||
170 | < | delete info; |
170 | > | delete info; |
171 | ||
172 | #ifdef IS_MPI | |
173 | strcpy( checkPointMsg, "Oh what a lovely Tea Party!" ); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |