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: 1843
Committed: Fri Dec 3 21:30:30 2004 UTC (21 years, 6 months ago) by tim
File size: 3885 byte(s)
Log Message:
more missing function get implemented

File Contents

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