ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-2.0/src/applications/oopse/oopse.cpp
Revision: 1837
Committed: Thu Dec 2 22:15:31 2004 UTC (19 years, 8 months ago) by tim
File size: 3415 byte(s)
Log Message:
refine factory pattern to make it initialized correctly

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