ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-4/src/applications/oopse/oopse.cpp
Revision: 1883
Committed: Mon Dec 13 22:30:27 2004 UTC (19 years, 7 months ago) by tim
File size: 4247 byte(s)
Log Message:
MPI version is built

File Contents

# Content
1
2 #ifdef IS_MPI
3 #include <mpi.h>
4 #endif
5
6 #include "utils/simError.h"
7 #include "brains/SimCreator.hpp"
8 #include "brains/SimInfo.hpp"
9 #include "integrators/IntegratorFactory.hpp"
10 #include "integrators/IntegratorCreator.hpp"
11 #include "integrators/Integrator.hpp"
12 #include "integrators/NVE.hpp"
13 #include "integrators/NVT.hpp"
14 #include "integrators/NPTi.hpp"
15 #include "integrators/NPTf.hpp"
16 #include "integrators/NPTxyz.hpp"
17 #include "UseTheForce/DUFF.hpp"
18 #include "UseTheForce/ForceFieldCreator.hpp"
19
20 using namespace oopse;
21
22 int main(int argc,char* argv[]){
23
24 // first things first, all of the initializations
25
26 #ifdef IS_MPI
27 MPI_Init( &argc, &argv ); // the MPI communicators
28 #endif
29
30 initSimError(); // the error handler
31 srand48( 1337 ); // the random number generator.
32
33 #ifdef IS_MPI
34 if( worldRank == 0 ){
35 #endif
36 std::cerr <<
37 " +----------------------------------------------------------------------+\n" <<
38 " | ____ ____ ____ _____ ______ The OpenSource, Object-oriented |\n" <<
39 " | / __ \\/ __ \\/ __ \\/ ___// ____/ Parallel Simulation Engine. |\n" <<
40 " | / / / / / / / /_/ /\\__ \\/ __/ |\n" <<
41 " | / /_/ / /_/ / ____/___/ / /___ Copyright 2004 by the |\n" <<
42 " | \\____/\\____/_/ /____/_____/ University of Notre Dame. |\n" <<
43 " | http://www.oopse.org |\n" <<
44 " | |\n" <<
45 " | OOPSE is an OpenScience project. All source code is available for |\n" <<
46 " | any use subject to only one condition: |\n" <<
47 " | |\n" <<
48 " | Any published work resulting from the use of this code must cite the |\n" <<
49 " | following paper: M. A. Meineke, C. F. Vardeman II, T. Lin, |\n" <<
50 " | C. J. Fennell, and J. D. Gezelter, |\n" <<
51 " | J. Comp. Chem. XX, XXXX (2004). |\n" <<
52 " +----------------------------------------------------------------------+\n" <<
53 "\n";
54
55 if( argc < 2 ){
56 strcpy( painCave.errMsg, "Error, a meta-data file is needed to run.\n" );
57 painCave.isFatal = 1;
58 simError();
59 }
60 #ifdef IS_MPI
61 }
62 #endif
63
64 #ifdef IS_MPI
65 strcpy( checkPointMsg, "Successful number of arguments" );
66 MPIcheckPoint();
67 #endif
68
69 /** @todo move to a seperate initialization module */
70 ForceFieldBuilder<DUFF> DUFFCreator("DUFF");
71 ForceFieldBuilder<DUFF> WATERCreator("WATER");
72 IntegratorBuilder<NVE> NVECreator("NVE");
73 IntegratorBuilder<NVT> NVTCreator("NVT");
74 IntegratorBuilder<NPTi> NPTiCreator("NPTi");
75 IntegratorBuilder<NPTf> NPTfCreator("NPTf");
76 IntegratorBuilder<NPTxyz> NPTxyzCreator("NPTxyz");
77
78 //create simulation model
79 SimCreator creator;
80 SimInfo* info = creator.createSim(argv[1]);
81
82 //create Integrator
83 Globals* simParams = info->getSimParams();
84 if (simParams->haveEnsemble()) {
85 Integrator* myIntegrator = IntegratorFactory::getInstance()->createIntegrator(simParams->getEnsemble(), info);
86
87 //Thermodynamic Integration Method
88 //ForceManager* fman = new ThermodynamicForceManager(info);
89 //myIntegrator->setForceManager(fman);
90
91
92 //Zconstraint-Method
93 //ForceManager* fman = new ZconstraintForceManager(info);
94 //myIntegrator->setForceManager(fman);
95
96 if (myIntegrator == NULL) {
97 sprintf(painCave.errMsg, "Integrator Factory can not create %s Integrator\n",
98 simParams->getEnsemble());
99 painCave.isFatal = 1;
100 simError();
101 }
102
103 myIntegrator->integrate();
104 delete myIntegrator;
105 }
106 //minimizer
107 // Minimizer* minimizer = MinimizerFactory::getInstance()->createMininizer();
108 //minimizer->run();
109 //delete minimizer
110
111 delete info;
112
113 #ifdef IS_MPI
114 strcpy( checkPointMsg, "Oh what a lovely Tea Party!" );
115 MPIcheckPoint();
116
117 MPI_Finalize();
118 #endif
119
120 return 0 ;
121 }