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 2051 by gezelter, Fri Feb 18 15:58:33 2005 UTC vs.
Revision 2364 by tim, Thu Oct 13 22:26:47 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 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        "  |                                                                      |\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" <<
# 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().c_str());
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().c_str());
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);
155 <        }
156 <        
157 <        myIntegrator->integrate();
158 <        delete myIntegrator;
159 <    }else {
160 <            sprintf(painCave.errMsg, "Integrator Factory can not create %s Integrator\n",
161 <            simParams->getEnsemble());
162 <            painCave.isFatal = 1;
163 <            simError();
153 >    //Zconstraint-Method
154 >    if (simParams->haveNZconstraints()) {
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",
164 +            simParams->getEnsemble().c_str());
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