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: 1889
Committed: Wed Dec 15 19:40:16 2004 UTC (19 years, 7 months ago) by tim
File size: 4344 byte(s)
Log Message:
add more force fields

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 ForceFieldBuilder<DUFF> LJCreator("LJ");
73 ForceFieldBuilder<DUFF> EAMCreator("EAM");
74
75 IntegratorBuilder<NVE> NVECreator("NVE");
76 IntegratorBuilder<NVT> NVTCreator("NVT");
77 IntegratorBuilder<NPTi> NPTiCreator("NPTi");
78 IntegratorBuilder<NPTf> NPTfCreator("NPTf");
79 IntegratorBuilder<NPTxyz> NPTxyzCreator("NPTxyz");
80
81 //create simulation model
82 SimCreator creator;
83 SimInfo* info = creator.createSim(argv[1]);
84
85 //create Integrator
86 Globals* simParams = info->getSimParams();
87 if (simParams->haveEnsemble()) {
88 Integrator* myIntegrator = IntegratorFactory::getInstance()->createIntegrator(simParams->getEnsemble(), info);
89
90 //Thermodynamic Integration Method
91 //ForceManager* fman = new ThermodynamicForceManager(info);
92 //myIntegrator->setForceManager(fman);
93
94
95 //Zconstraint-Method
96 //ForceManager* fman = new ZconstraintForceManager(info);
97 //myIntegrator->setForceManager(fman);
98
99 if (myIntegrator == NULL) {
100 sprintf(painCave.errMsg, "Integrator Factory can not create %s Integrator\n",
101 simParams->getEnsemble());
102 painCave.isFatal = 1;
103 simError();
104 }
105
106 myIntegrator->integrate();
107 delete myIntegrator;
108 }
109 //minimizer
110 // Minimizer* minimizer = MinimizerFactory::getInstance()->createMininizer();
111 //minimizer->run();
112 //delete minimizer
113
114 delete info;
115
116 #ifdef IS_MPI
117 strcpy( checkPointMsg, "Oh what a lovely Tea Party!" );
118 MPIcheckPoint();
119
120 MPI_Finalize();
121 #endif
122
123 return 0 ;
124 }