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

Comparing trunk/OOPSE-4/src/applications/oopse/oopse.cpp (file contents):
Revision 1930 by gezelter, Wed Jan 12 22:41:40 2005 UTC vs.
Revision 2207 by gezelter, Fri Apr 15 22:40:33 2005 UTC

# 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 73 | Line 73 | int main(int argc,char* argv[]){
73        "  |    ____  ____  ____  _____ ______  The OpenSource, Object-oriented   |\n" <<
74        "  |   / __ \\/ __ \\/ __ \\/ ___// ____/  Parallel Simulation Engine.       |\n" <<
75        "  |  / / / / / / / /_/ /\\__ \\/ __/                                       |\n" <<
76 <      "  | / /_/ / /_/ / ____/___/ / /___     Copyright 2004 by the             |\n" <<
76 >      "  | / /_/ / /_/ / ____/___/ / /___     Copyright 2004-2005 by the        |\n" <<
77        "  | \\____/\\____/_/    /____/_____/     University of Notre Dame.         |\n" <<
78      "  |                                    http://www.oopse.org              |\n" <<
78        "  |                                                                      |\n" <<
79 +      "  |                     version " <<
80 +      OOPSE_VERSION_MAJOR << "." << OOPSE_VERSION_MINOR << "." << OOPSE_VERSION_TINY <<
81 +      "  http://www.oopse.org              |\n" <<
82 +      "  |                                                                      |\n" <<
83        "  | OOPSE is an OpenScience project.  All source code is available for   |\n" <<
84        "  | any use subject to only one condition:                               |\n" <<
85        "  |                                                                      |\n" <<
86        "  | Any published work resulting from the use of this code must cite the |\n" <<
87        "  | following paper:       M. A. Meineke, C. F. Vardeman II, T. Lin,     |\n" <<
88        "  |                        C. J. Fennell, and J. D. Gezelter,            |\n" <<
89 <      "  |                        J. Comp. Chem. XX, XXXX (2004).               |\n" <<
89 >      "  |                        J. Comput. Chem. 26, pp. 252-271 (2005).      |\n" <<
90        "  +----------------------------------------------------------------------+\n" <<
91        "\n";
92      
# Line 103 | Line 106 | int main(int argc,char* argv[]){
106  
107  
108  
109 <    //register forcefields, integrators and minimizers
110 <    registerAll();
109 >  //register forcefields, integrators and minimizers
110 >  registerAll();
111  
112 <    //create simulation model
113 <    SimCreator creator;
114 <    SimInfo* info = creator.createSim(argv[1]);
115 <    Globals* simParams = info->getSimParams();
112 >  //create simulation model
113 >  SimCreator creator;
114 >  SimInfo* info = creator.createSim(argv[1]);
115 >  Globals* simParams = info->getSimParams();
116  
117 <    if (simParams->haveMinimizer() && simParams->haveEnsemble()) {
118 <        sprintf(painCave.errMsg, "Minimizer keyword and Ensemble keyword can not exist together\n");
119 <        painCave.isFatal = 1;
120 <        simError();        
121 <    }
117 >  if (simParams->haveMinimizer() && simParams->haveEnsemble()) {
118 >    sprintf(painCave.errMsg, "Minimizer keyword and Ensemble keyword can not exist together\n");
119 >    painCave.isFatal = 1;
120 >    simError();        
121 >  }
122      
123 <    if (simParams->haveMinimizer()) {
124 <        //create minimizer
125 <        Minimizer* myMinimizer = MinimizerFactory::getInstance()->createMinimizer(simParams->getMinimizer(), info);
123 >  if (simParams->haveMinimizer()) {
124 >    //create minimizer
125 >    Minimizer* myMinimizer = MinimizerFactory::getInstance()->createMinimizer(simParams->getMinimizer(), info);
126  
127 <        if (myMinimizer == NULL) {
128 <            sprintf(painCave.errMsg, "Minimizer Factory can not create %s Minimizer\n",
129 <                    simParams->getMinimizer());
130 <            painCave.isFatal = 1;
131 <            simError();
132 <        }
127 >    if (myMinimizer == NULL) {
128 >      sprintf(painCave.errMsg, "Minimizer Factory can not create %s Minimizer\n",
129 >              simParams->getMinimizer());
130 >      painCave.isFatal = 1;
131 >      simError();
132 >    }
133  
134 <        myMinimizer->minimize();
135 <        delete myMinimizer;
136 <    } else if (simParams->haveEnsemble()) {
137 <        //create Integrator
134 >    myMinimizer->minimize();
135 >    delete myMinimizer;
136 >  } else if (simParams->haveEnsemble()) {
137 >    //create Integrator
138  
139 <        Integrator* myIntegrator = IntegratorFactory::getInstance()->createIntegrator(simParams->getEnsemble(), info);
139 >    Integrator* myIntegrator = IntegratorFactory::getInstance()->createIntegrator(simParams->getEnsemble(), info);
140  
141 <        if (myIntegrator == NULL) {
142 <            sprintf(painCave.errMsg, "Integrator Factory can not create %s Integrator\n",
143 <                    simParams->getEnsemble());
144 <            painCave.isFatal = 1;
145 <            simError();
146 <        }
141 >    if (myIntegrator == NULL) {
142 >      sprintf(painCave.errMsg, "Integrator Factory can not create %s Integrator\n",
143 >              simParams->getEnsemble());
144 >      painCave.isFatal = 1;
145 >      simError();
146 >    }
147                  
148 <        //Thermodynamic Integration Method
149 <        //ForceManager* fman = new ThermodynamicForceManager(info);
150 <       //myIntegrator->setForceManager(fman);
148 >    //Thermodynamic Integration Method
149 >    //ForceManager* fman = new ThermodynamicForceManager(info);
150 >    //myIntegrator->setForceManager(fman);
151  
152  
153 <        //Zconstraint-Method
154 <        if (simParams->haveZconstraints()) {
155 <            info->setNZconstraint(simParams->getNzConstraints());
156 <            ForceManager* fman = new ZconstraintForceManager(info);
157 <            myIntegrator->setForceManager(fman);
158 <        }
153 >    //Zconstraint-Method
154 >    if (simParams->haveZconstraints()) {
155 >      info->setNZconstraint(simParams->getNzConstraints());
156 >      ForceManager* fman = new ZconstraintForceManager(info);
157 >      myIntegrator->setForceManager(fman);
158 >    }
159          
160 <        myIntegrator->integrate();
161 <        delete myIntegrator;
162 <    }else {
163 <            sprintf(painCave.errMsg, "Integrator Factory can not create %s Integrator\n",
160 >    myIntegrator->integrate();
161 >    delete myIntegrator;
162 >  }else {
163 >    sprintf(painCave.errMsg, "Integrator Factory can not create %s Integrator\n",
164              simParams->getEnsemble());
165 <            painCave.isFatal = 1;
166 <            simError();
167 <    }
165 >    painCave.isFatal = 1;
166 >    simError();
167 >  }
168  
169  
170      
171 <    delete info;
171 >  delete info;
172  
173   #ifdef IS_MPI
174    strcpy( checkPointMsg, "Oh what a lovely Tea Party!" );

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines