ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/oopse/oopse.cpp
(Generate patch)

Comparing trunk/src/applications/oopse/oopse.cpp (file contents):
Revision 510 by gezelter, Fri Apr 15 22:40:33 2005 UTC vs.
Revision 1290 by cli2, Wed Sep 10 19:51:45 2008 UTC

# Line 1 | Line 1
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
# Line 43 | Line 43
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"
# Line 52 | Line 54
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
# Line 73 | Line 78 | int main(int argc,char* argv[]){
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 " <<
# Line 99 | Line 104 | int main(int argc,char* argv[]){
104    }
105   #endif
106    
102 #ifdef IS_MPI
107    strcpy( checkPointMsg, "Successful number of arguments" );
108 <  MPIcheckPoint();
105 < #endif
108 >  errorCheckPoint();
109  
107
108
110    //register forcefields, integrators and minimizers
111    registerAll();
112  
# Line 122 | Line 123 | int main(int argc,char* argv[]){
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      }
# Line 136 | Line 137 | int main(int argc,char* argv[]){
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  
152
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      }
# Line 161 | Line 164 | int main(int argc,char* argv[]){
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    }
# Line 170 | Line 173 | int main(int argc,char* argv[]){
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines